webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

SQL経由でAPIを簡単にクエリ・照会できるPythonライブラリ「shillelagh」のインストール

カテゴリ: Python【初歩から現場実務的なもの】

SQL経由でAPIを簡単にクエリ・照会できるPythonライブラリ「shillelagh」のインストールについて解説しています。

「shillelagh(https://github.com/betodealmeida/shillelagh/)」は、SQLを使用してAPI、ファイル、インメモリオブジェクトをクエリ・照会できるPythonライブラリおよびCLIです。

■Python

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

■shillelaghをインストールする

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

pip install shillelagh

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

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

py -3.8 -m pip install shillelagh

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

Defaulting to user installation because normal site-packages is not writeable

Collecting shillelagh

Downloading shillelagh-1.1.0-py2.py3-none-any.whl (90 kB)

---------------------------------------- 90.2/90.2 kB 639.6 kB/s eta 0:00:00

Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\user_\appdata\roaming\python\python38\site-packages (from shillelagh) (4.3.0)

Collecting apsw>=3.9.2

Downloading apsw-3.38.5.post1-cp38-cp38-win_amd64.whl (1.0 MB)

---------------------------------------- 1.0/1.0 MB 1.3 MB/s eta 0:00:00

Requirement already satisfied: python-dateutil>=2.8.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from shillelagh) (2.8.2)

Collecting sqlalchemy>=1.3

Using cached SQLAlchemy-1.4.39-cp38-cp38-win_amd64.whl (1.6 MB)

Requirement already satisfied: requests>=2.25.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from shillelagh) (2.28.1)

Requirement already satisfied: six>=1.5 in c:\users\user_\appdata\roaming\python\python38\site-packages (from python-dateutil>=2.8.1->shillelagh) (1.16.0)

Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.25.1->shillelagh) (3.3)

Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.25.1->shillelagh) (2.1.0)

Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.25.1->shillelagh) (1.26.11)

Requirement already satisfied: certifi>=2017.4.17 in c:\users\user_\appdata\roaming\python\python38\site-packages (from requests>=2.25.1->shillelagh) (2022.6.15)

Collecting greenlet!=0.4.17

Using cached greenlet-1.1.2-cp38-cp38-win_amd64.whl (101 kB)

Installing collected packages: apsw, greenlet, sqlalchemy, shillelagh

Successfully installed apsw-3.38.5.post1 greenlet-1.1.2 shillelagh-1.1.0 sqlalchemy-1.4.39

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

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