Skip to main content

Query Japanese open data on Queria (data.queria.io) from the terminal, Python, and MCP

Project description

queria

English | 日本語

Query Japanese open data on Queria from the terminal, Python, and MCP.

A read-only client for exploring Japanese open data published on Queria — e-Stat, National Land Numerical Information, EDINET, the Japan Meteorological Agency, and more — from the terminal, Python, and MCP. The data is published in DuckLake format, and all computation runs locally in DuckDB.

Installation

uvx queria list          # run without installing
pip install queria       # or install normally

Requires Python 3.10+.

Usage

queria list                              # list datasets
queria search 人口                        # search datasets, tables and columns
queria info e_stat                       # metadata (license, source, etc.)
queria schema e_stat                     # list tables
queria columns e_stat mart_population    # list columns
queria summarize zipcode.main.zipcodes   # per-column statistics (scans the whole table)
queria sql "SELECT * FROM zipcode.main.zipcodes LIMIT 10"
queria sql "SELECT * FROM zipcode.main.zipcodes" --out zipcodes.parquet

Tables are referenced as <dataset>.<schema>.<table>. Referenced datasets are attached automatically.

API token

The client works without a token, but rate limits apply. Logging in via the browser issues a token (valid for 90 days) and raises the limit:

queria login                    # opens the browser for approval
queria login --no-browser       # for SSH etc.: paste the code shown on the page
queria logout                   # remove the saved token

Tokens can also be issued manually at https://queria.io/profile/api-keys (for CI and other tools) and registered with:

queria auth set-token <token>   # saved to ~/.config/queria/config.toml
queria auth status              # check

You can also pass a token via the --token option or the QUERIA_TOKEN environment variable (in that order of precedence).

Python API

import queria

with queria.connect() as conn:
    conn.sql("SELECT * FROM catalog.main.mart_datasets").show()

MCP server

Works with MCP clients such as Claude Code, Claude Desktop, and Cursor:

{
  "mcpServers": {
    "queria": {
      "command": "uvx",
      "args": ["--from", "queria[mcp]", "queria", "mcp"]
    }
  }
}

The query tool only runs SELECT statements against the Queria catalog. Besides writes, it rejects functions that read local files or arbitrary URLs (read_text / read_csv / glob / ST_Read, etc.) and dynamic SQL (query()), so agents processing untrusted data cannot use it to read local files or perform SSRF against internal endpoints. If you need unrestricted SQL, such as joining with local data, use the CLI (queria sql).

Telemetry

To help improve the tool, we collect anonymous usage data (command name, success/failure, version, and target dataset name). SQL contents, file paths, and personal information are never sent. Opt out with any of the following:

queria telemetry disable        # saved to the config file
export DO_NOT_TRACK=1           # standard environment variable
export QUERIA_NO_TELEMETRY=1

Details: https://docs.queria.io/telemetry

Documentation

https://docs.queria.io/

The docs are also served in agent-readable form:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

queria-0.6.0.tar.gz (105.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

queria-0.6.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file queria-0.6.0.tar.gz.

File metadata

  • Download URL: queria-0.6.0.tar.gz
  • Upload date:
  • Size: 105.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for queria-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e1847c34a2d8e98480883d82c7a11680bbc350de6df06bb32de993b4cc71310f
MD5 918fa023ce2560e3c29db86f5390e183
BLAKE2b-256 cd47e8fcf3faeddad59751e85855deaf37b0390902207ad3bca962afb0c20d20

See more details on using hashes here.

Provenance

The following attestation bundles were made for queria-0.6.0.tar.gz:

Publisher: release.yml on queria-io/queria-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file queria-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: queria-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for queria-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8db75f22c9f2e73c0a9b5f4e411fddf522a09a84b88cd6fdc92c167599fcf139
MD5 ff807fc97b38717e4bf16167b431b4ce
BLAKE2b-256 89e4ddc8e9e942c0fb728bde9bd297a34623d5384141027d5f71753a08571494

See more details on using hashes here.

Provenance

The following attestation bundles were made for queria-0.6.0-py3-none-any.whl:

Publisher: release.yml on queria-io/queria-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page