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.
-
Run for example
app.py EDINET "full/path/to/input/archive.zip"
. Theapp.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 caseEDINET
is the abbreveation of the taxonomy package provider andfull/path/to/archive.zip
is the path to the zip archive. Packages to test/to experiment with the application are located in theinput
-folder. -
The class
Checker
class inTPChecker.py
analyzes the package according to the Taxonomy Package 1.0 standard. The result of the analyzation is displayed on the command line. -
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 theoutput
-folder. The definied methods from the Interface are responsible for fixing the package. The result of the fixed package will be a fixedzip
archive containing all relevant data.
.
├── .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
- 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
- Activate virtual environment:
source venv/bin/activate
- Install requirements:
pip3 install -r requirements.txt
- 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!
- Python
- XBRL
- Markdwon
- Editor
This project is licensed under the terms of the GPL v3.
See the COPYRIGHT file for copyright and licensing details.
Please review our Code of Conduct before contributing to this project.