Skip to content

CH6832/xbrl-taxonomy-package-conformant-processor

Repository files navigation

XBRL Taxonomy Package Conformant Processor

📰 About the project

A small command line program that checks whether an XBRL Taxonomy Package complies with the Standard Taxonomy Package 1.0 and adjusts it if necessary.

How it works

  1. Run for example app.py EDINET "full/path/to/input/archive.zip". The app.py file is the starting point of the application. EDINET represents the Electronic Disclosure System provided by the JFSA. The path afterwards can be any path locating an XBRL Taxonomy Package (ZIP). In this case EDINET is the abbreveation of the taxonomy package provider and full/path/to/archive.zip is the path to the zip archive. Packages to test/to experiment with the application are located in the input-folder.

  2. The class Checker class in TPChecker.py analyzes the package according to the Taxonomy Package 1.0 standard. The result of the analyzation is displayed on the command line.

  3. Based on the result calculated by the Checker-class, the next step is to fix the package. TPFixer.py contains an Interface with relevant abstract methods. Each class represents a package by a specific provider. When the class is initialized, the package to fix will be copied over to the output-folder. The definied methods from the Interface are responsible for fixing the package. The result of the fixed package will be a fixed zip archive containing all relevant data.

Content overview

.
├── .vscode/ - visual studio code settings
├── tests/ - code and data for tests
├── input/ - xbrl taxonomy packages
├── output/ - folder for fixed taxonomy packages
├── venv/ - data for virtual environemnt 
├── .gitignore - contains folders/files ignored by git
├── app.py - program entry point
├── CODE_OF_CONDUCT.md - project code of conduct
├── COPYRIGHT - project copyright
├── LICENSE - license text
├── README.md - relevant information about the project
├── requirements.txt - requirements to run the project
├── TPChecker.py - check package according to the standard
├── TPFixer.py - Fix package according to standard
└── TPMisc.py - module with helper functions

📓 Features

  • Checking and fixing:
    • xml format checking
    • case sensitivity checking (done by python)
    • archive format ceck
    • top-level directory checking and fixing
    • META-INF folder checking and fixing
    • taxonomyPackage.xml checkng and fixing
    • catalog.xml checking and fixing
    • URL resolution checking and fixing
    • Entrypoint localiazation

🏃 Getting started

Prerequisites and example usage

  1. Activate virtual environment:
source venv/bin/activate
  1. Install requirements:
pip3 install -r requirements.txt
  1. Run script:
python3 app.py [PROVIDER] [PATH/TO/PKG]
python3 app.py EDINET "input/ALL_20221101/ALL_20221101.zip"
Input information:
------------------
    Provider -> EDINET
    Package  -> ..\input\ALL_20221101\ALL_20221101.zip

Analyzis results:
------------------
    DONE: Package is ZIP
    ERROR: Package has not single toplevel dir
    ERROR: Package has no META-INF folder
    ERROR: Package has no catalog.xml
    ERROR: Package has no taxonomy-package.xml

Fixing package...
    META-INF directory generated
    Top level directory generated
    Package content restructured
    catalog.xml file generated
    catalog.xml is xml file
    taxonomyPackage.xml file generated
    taxonomyPackage.xml is xml file
    Final zip generated

Output result:
--------------
    ..\output\ALL_20221101\ALL_20221101.zip is fixed!

📚 Resources used to create this project

🔖 License

This project is licensed under the terms of the GPL v3.

©️ Copyright

See the COPYRIGHT file for copyright and licensing details.

📏 Code of Conduct

Please review our Code of Conduct before contributing to this project.

About

A small command line program that checks whether an XBRL Taxonomy Package complies with the Taxonomy Package 1.0 Standard.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages