巨大なXMLファイルをJSONファイルにストリーミングする「streamxml2json」のインストール

スポンサーリンク

【Python】巨大なXMLファイルをJSONファイルにストリーミングする「streamxml2json」のインストールについて解説しています。

「streamxml2json(https://github.com/rafaeelaudibert/streamxml2json)」は、大きなXMLファイルをJSONファイルにストリーミングするためのPythonライブラリです。

■Python

今回のPythonのバージョンは、「3.10.9」を使用しています。(Windows11)(pythonランチャーでの確認)

■streamxml2jsonをインストールする

streamxml2jsonをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install streamxml2json

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.10.9にインストールを行うために、バージョンの切り替えを行います。

py -3.10 -m pip install streamxml2json

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable
Collecting streamxml2json
Downloading streamxml2json-1.0.1-py2.py3-none-any.whl (4.0 kB)
Collecting jsonstreams
Downloading jsonstreams-0.6.0-py2.py3-none-any.whl (10 kB)
Collecting xmltodict
Using cached xmltodict-0.13.0-py2.py3-none-any.whl (10.0 kB)
Collecting tqdm
Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting simplejson
Downloading simplejson-3.19.1-cp310-cp310-win_amd64.whl (75 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.5/75.5 kB 1.0 MB/s eta 0:00:00
Requirement already satisfied: six in c:\users\user_\appdata\roaming\python\python310\site-packages (from jsonstreams->streamxml2json) (1.16.0)
Collecting colorama
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Installing collected packages: xmltodict, simplejson, jsonstreams, colorama, tqdm, streamxml2json
WARNING: The script tqdm.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed colorama-0.4.6 jsonstreams-0.6.0 simplejson-3.19.1 streamxml2json-1.0.1 tqdm-4.65.0 xmltodict-0.13.0

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、streamxml2jsonが正常にインストールされたことになります。

なお、今回はstreamxml2jsonのバージョン1.0.1をインストールしました。

コメント

タイトルとURLをコピーしました