Query Japanese open data on Queria (data.queria.io) from the terminal, Python, and MCP
Project description
queria
Query Japanese open data on Queria from the terminal, Python, and MCP.
Queria が公開する日本のオープンデータ(e-Stat、国土数値情報、EDINET、気象庁ほか)を、ターミナル・Python・MCP から read-only で探索するクライアントです。データは DuckLake 形式で公開されており、計算はすべて手元の DuckDB で行われます。
インストール
uvx queria list # インストール不要で実行
pip install queria # または通常インストール
Python 3.10+ が必要です。
使い方
queria list # データセット一覧
queria search 人口 # データセット・テーブル・カラムの横断検索
queria info e_stat # メタデータ(ライセンス・出典など)
queria schema e_stat # テーブル一覧
queria columns e_stat mart_population # カラム一覧
queria summarize zipcode.main.zipcodes # カラム統計(全件スキャン)
queria sql "SELECT * FROM zipcode.main.zipcodes LIMIT 10"
queria sql "SELECT * FROM zipcode.main.zipcodes" --out zipcodes.parquet
テーブルは <dataset>.<schema>.<table> で参照します。参照したデータセットは自動的に ATTACH されます。
API トークン
トークンなしでも使えますが、レートリミットがあります。https://queria.io/profile/api-keys で発行したトークンを登録すると上限が上がります:
queria auth set-token <token> # ~/.config/queria/config.toml に保存
queria auth status # 確認
--token オプションや環境変数 QUERIA_TOKEN でも指定できます(この順で優先)。
Python API
import queria
with queria.connect() as conn:
conn.sql("SELECT * FROM catalog.main.mart_datasets").show()
MCP サーバー
Claude Code / Claude Desktop / Cursor などの MCP クライアントから使えます:
{
"mcpServers": {
"queria": {
"command": "uvx",
"args": ["--from", "queria[mcp]", "queria", "mcp"]
}
}
}
query ツールは Queria のカタログに対する SELECT のみを実行します。書き込みに加えて、ローカルファイルや任意 URL を読む関数(read_text / read_csv / glob / ST_Read など)と動的 SQL(query())を拒否するため、未信頼データを処理するエージェントから手元のファイル読取や内部エンドポイントへの SSRF には使えません。ローカルデータとの結合など制約のない SQL が必要な場合は CLI(queria sql)を使ってください。
テレメトリ
改善のため、匿名の利用データ(コマンド名・成否・バージョン・対象データセット名)を収集します。SQL の内容・ファイルパス・個人情報は送信しません。次のいずれかでオプトアウトできます:
queria telemetry disable # 設定ファイルに保存
export DO_NOT_TRACK=1 # 標準の環境変数
export QUERIA_NO_TELEMETRY=1
詳細: https://docs.queria.io/telemetry
ドキュメント
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file queria-0.3.1.tar.gz.
File metadata
- Download URL: queria-0.3.1.tar.gz
- Upload date:
- Size: 98.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30e00a3fd8965a08015965985dfcc0a7ea311444a0d331833bd1778a1067ab00
|
|
| MD5 |
97c5324dc3ecb3d7bd02948dd381cef0
|
|
| BLAKE2b-256 |
37a923ff99043b47eda63c07e31f68afa43b0299fddfdc6e76ad26568a52cbc8
|
Provenance
The following attestation bundles were made for queria-0.3.1.tar.gz:
Publisher:
release.yml on queria-io/queria-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
queria-0.3.1.tar.gz -
Subject digest:
30e00a3fd8965a08015965985dfcc0a7ea311444a0d331833bd1778a1067ab00 - Sigstore transparency entry: 2195411242
- Sigstore integration time:
-
Permalink:
queria-io/queria-cli@d65ad42f17269e0ab1b7c8462425d31b38e5c9b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/queria-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d65ad42f17269e0ab1b7c8462425d31b38e5c9b9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file queria-0.3.1-py3-none-any.whl.
File metadata
- Download URL: queria-0.3.1-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c3403d57d793a23a6d52125108f5b5c02bca4c3d6d0c474bec397f0b6ca4b78
|
|
| MD5 |
b7199f3a951e2e6a0d3fdf0880e6c4a4
|
|
| BLAKE2b-256 |
6d24e563417693f71be23dad0aafa974e2e0a82e24fc3a3abf142004358b3e64
|
Provenance
The following attestation bundles were made for queria-0.3.1-py3-none-any.whl:
Publisher:
release.yml on queria-io/queria-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
queria-0.3.1-py3-none-any.whl -
Subject digest:
3c3403d57d793a23a6d52125108f5b5c02bca4c3d6d0c474bec397f0b6ca4b78 - Sigstore transparency entry: 2195411254
- Sigstore integration time:
-
Permalink:
queria-io/queria-cli@d65ad42f17269e0ab1b7c8462425d31b38e5c9b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/queria-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d65ad42f17269e0ab1b7c8462425d31b38e5c9b9 -
Trigger Event:
push
-
Statement type: