Views: 51
昨年の記事は、Macでしたが今回はWindows 10で確認した。
インストール
Arelleのダウンロードページの記載に従ってarelle-win-x64-2022-02-22.exeをダウンロードして、ダブルクリック実行するとインストールされる。
Windows x64 Installer
- Download the Windows x64 installer. It is a .exe installer file with the App inside.
- (All the Python and resources needed are built inside the installation, you do not have to download Python or ActiveTCL separately.)
関連ライブラリのインストール
pipで関連ライブラリをインストール。
PS C:\Users\xxxx> pip install lxml pg8000 pymysql numpy rdflib isodate regex aniso8601 graphviz holidays openpyxl Pillow pycountry cherrypy cheroot python-dateutil pytz tornado pyparsing matplotlib pyodbc
PS C:\Users\xxxx> pip install lxml pg8000 pymysql numpy rdflib isodate regex aniso8601 graphviz holidays openpyxl Pillow pycountry cherrypy cheroot python-dateutil pytz tornado pyparsing matplotlib pyodbc Collecting lxml Downloading lxml-4.8.0-cp310-cp310-win_amd64.whl (3.6 MB) ---------------------------------------- 3.6/3.6 MB 13.6 MB/s eta 0:00:00 Collecting pg8000 Downloading pg8000-1.24.1-py3-none-any.whl (33 kB) Collecting pymysql Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB) ---------------------------------------- 43.8/43.8 KB 2.2 MB/s eta 0:00:00 Requirement already satisfied: numpy in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (1.22.2) Collecting rdflib Downloading rdflib-6.1.1-py3-none-any.whl (482 kB) ---------------------------------------- 482.8/482.8 KB 14.8 MB/s eta 0:00:00 Collecting isodate Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB) ---------------------------------------- 41.7/41.7 KB 2.0 MB/s eta 0:00:00 Collecting regex Downloading regex-2022.3.2-cp310-cp310-win_amd64.whl (274 kB) ---------------------------------------- 274.4/274.4 KB 16.5 MB/s eta 0:00:00 Collecting aniso8601 Downloading aniso8601-9.0.1-py2.py3-none-any.whl (52 kB) ---------------------------------------- 52.8/52.8 KB ? eta 0:00:00 Collecting graphviz Downloading graphviz-0.19.1-py3-none-any.whl (46 kB) ---------------------------------------- 46.3/46.3 KB ? eta 0:00:00 Collecting holidays Downloading holidays-0.13-py3-none-any.whl (172 kB) ---------------------------------------- 172.1/172.1 KB 10.8 MB/s eta 0:00:00 Requirement already satisfied: openpyxl in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (3.0.9) Requirement already satisfied: Pillow in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (9.0.1) Collecting pycountry Downloading pycountry-22.3.5.tar.gz (10.1 MB) ---------------------------------------- 10.1/10.1 MB 15.4 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting cherrypy Downloading CherryPy-18.6.1-py2.py3-none-any.whl (419 kB) ---------------------------------------- 419.9/419.9 KB 13.2 MB/s eta 0:00:00 Collecting cheroot Downloading cheroot-8.6.0-py2.py3-none-any.whl (104 kB) ---------------------------------------- 104.7/104.7 KB ? eta 0:00:00 Requirement already satisfied: python-dateutil in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (2.8.2) Requirement already satisfied: pytz in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (2021.3) Collecting tornado Downloading tornado-6.1.tar.gz (497 kB) ---------------------------------------- 497.4/497.4 KB 15.7 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Requirement already satisfied: pyparsing in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (3.0.7) Requirement already satisfied: matplotlib in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (3.5.1) Collecting pyodbc Downloading pyodbc-4.0.32.tar.gz (280 kB) ---------------------------------------- 280.0/280.0 KB 8.7 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting scramp>=1.4.1 Downloading scramp-1.4.1-py3-none-any.whl (8.5 kB) Requirement already satisfied: setuptools in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from rdflib) (58.1.0) Requirement already satisfied: six in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from isodate) (1.16.0) Collecting hijri-converter Downloading hijri_converter-2.2.3-py3-none-any.whl (14 kB) Collecting convertdate>=2.3.0 Downloading convertdate-2.4.0-py3-none-any.whl (47 kB) ---------------------------------------- 47.9/47.9 KB ? eta 0:00:00 Collecting korean-lunar-calendar Downloading korean_lunar_calendar-0.2.1-py3-none-any.whl (8.0 kB) Requirement already satisfied: et-xmlfile in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from openpyxl) (1.1.0) Collecting portend>=2.1.1 Downloading portend-3.1.0-py3-none-any.whl (5.3 kB) Collecting zc.lockfile Downloading zc.lockfile-2.0-py2.py3-none-any.whl (9.7 kB) Collecting more-itertools Downloading more_itertools-8.12.0-py3-none-any.whl (54 kB) ---------------------------------------- 54.3/54.3 KB 2.9 MB/s eta 0:00:00 Collecting jaraco.collections Downloading jaraco.collections-3.5.1-py3-none-any.whl (10 kB) Collecting jaraco.functools Downloading jaraco.functools-3.5.0-py3-none-any.whl (7.0 kB) Requirement already satisfied: packaging>=20.0 in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (21.3) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (1.3.2) Requirement already satisfied: cycler>=0.10 in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in c:\users\xxxx\appdata\local\programs\python\python310\lib\site-packages (from matplotlib) (4.29.1) Collecting pymeeus<=1,>=0.3.13 Downloading PyMeeus-0.5.11.tar.gz (5.4 MB) ---------------------------------------- 5.4/5.4 MB 16.3 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting tempora>=1.8 Downloading tempora-5.0.1-py3-none-any.whl (15 kB) Collecting asn1crypto>=1.4.0 Downloading asn1crypto-1.5.0-py2.py3-none-any.whl (105 kB) ---------------------------------------- 105.0/105.0 KB ? eta 0:00:00 Collecting jaraco.classes Downloading jaraco.classes-3.2.1-py3-none-any.whl (5.6 kB) Collecting jaraco.text Downloading jaraco.text-3.7.0-py3-none-any.whl (8.6 kB) Collecting jaraco.context>=4.1 Downloading jaraco.context-4.1.1-py3-none-any.whl (4.4 kB) Building wheels for collected packages: pycountry, tornado, pyodbc, pymeeus Building wheel for pycountry (pyproject.toml) ... done Created wheel for pycountry: filename=pycountry-22.3.5-py2.py3-none-any.whl size=10681845 sha256=3cdebae06572e970ef24a5ae6bcbc38aa7586b715e397ed353c2b191068a66cc Stored in directory: c:\users\xxxx\appdata\local\pip\cache\wheels\03\57\cc\290c5252ec97a6d78d36479a3c5e5ecc76318afcb241ad9dbe Building wheel for tornado (setup.py) ... done Created wheel for tornado: filename=tornado-6.1-cp310-cp310-win_amd64.whl size=414478 sha256=a1f2bda8425b4ad2e76aed6d21d888866c08a7b2bec619cf2a43b86f194d5f18 Stored in directory: c:\users\xxxx\appdata\local\pip\cache\wheels\80\32\8d\21cf0fa6ee4e083f6530e5b83dfdfa9489a3890d320803f4c7 Building wheel for pyodbc (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_ext building 'pyodbc' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyodbc Running setup.py clean for pyodbc Building wheel for pymeeus (setup.py) ... done Created wheel for pymeeus: filename=PyMeeus-0.5.11-py3-none-any.whl size=730985 sha256=6efbc6dd5db1dbd63568da3ad2e71b83fab1c0e8d153a6eb3a4058e23a1b5b63 Stored in directory: c:\users\xxxx\appdata\local\pip\cache\wheels\f0\b1\2c\21f06b25512237684d1254a7233fce2489a3a0d15a931e88dd Successfully built pycountry tornado pymeeus Failed to build pyodbc Installing collected packages: pyodbc, pymeeus, korean-lunar-calendar, asn1crypto, aniso8601, zc.lockfile, tornado, scramp, regex, pymysql, pycountry, more-itertools, lxml, jaraco.context, isodate, hijri-converter, graphviz, convertdate, rdflib, pg8000, jaraco.functools, jaraco.classes, holidays, tempora, jaraco.text, cheroot, portend, jaraco.collections, cherrypy Running setup.py install for pyodbc ... error error: subprocess-exited-with-error × Running setup.py install for pyodbc did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running install running build running build_ext building 'pyodbc' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> pyodbc note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available. You should consider upgrading via the 'C:\Users\xxxx\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command. PS C:\Users\xxxx>
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”とエラーが出ていてC++が古いよということだが先に進む。
OIM-CSVからXMLインスタンス生成
OIM処理には、loadFromOIMとsaveLoadableOIMの二つのプラグインを使用する。
-f whyOrWhyNot-metadata.json
でJSONメタファイルを指定し、
–saveOIMinstance whyOrWhyNot.xml
で変換後のXBRLインスタンスファイルを指定して実行する。
OIM-CSVファイルは、JSONメタファイルに記述する。
PS C:\Program Files\Arelle> .\arelleCmdLine.exe --plugins 'loadFromOIM|saveLoadableOIM' -f \Users\nobuy\OneDrive\ドキュメント\GitHub\xBRL-Alpha\xBRL-CSV\whyOrWhyNot-metadata.json --saveOIMinstance \Users\nobuy\OneDrive\ドキュメント\GitHub\xBRL-Alpha\xBRL-CSV\whyOrWhyNot.xml [info] Activation of plug-in Load From OIM successful, version 1.2. - loadFromOIM [info] Activation of plug-in Save Loadable OIM successful, version 1.2. - saveLoadableOIM [info:duplicatedSchema] Schema file with same targetNamespace http://xbrl.org/2005/xbrldt loaded from http://www.xbrl.org/2005/xbrldt-2005.xsd and http://xbrl.org/2005/xbrldt-2005.xsd - ../xBRL/SRCD/frTaxonomy/FRTaxonomy.xsd 24 [info] loaded in 9.56 secs at 2022-03-12T11:30:38 - \Users\nobuy\OneDrive\ドキュメント\GitHub\xBRL-Alpha\xBRL-CSV\whyOrWhyNot-metadata.json PS C:\Program Files\Arelle>
使用したファイルは、前回と同じ。
タクソノミ | xBRL/gl/plt/case-srcd/gl-plt-2020-12-31.xsd |
csvインスタンス | xBRL-CSV/whyOrWhyNot-metadata.json |
xBRLインスタンス | xBRL-CSV/whyOrWhyNot.xml(28.6KB) |
但し、JSONメタファイルのdocumentTypeを
"documentInfo": { "documentType": "https://xbrl.org/2021/xbrl-csv",
に変更した。