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.1.tar.gz (105.3 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.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for queria-0.6.1.tar.gz
Algorithm Hash digest
SHA256 6bd03f205a9c3849b2b59f1c04207df2810c53166068ea6e66c39d3ae590c13f
MD5 612e1acacc234a0de99c29453148ee9b
BLAKE2b-256 6157104b790dca7024175cb342b2b45c00c25f19fb689960b8ecd1178d5ab364

See more details on using hashes here.

Provenance

The following attestation bundles were made for queria-0.6.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for queria-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 630f32a09e190eb89de20b414c15d9fedf21320b28e87cb7bbb3c66951694c56
MD5 ad4bddc9542e386cd32091985761b217
BLAKE2b-256 c3f184513439908e5555f700c00829e846648bd0629a7295b2cfc00b4b152ca2

See more details on using hashes here.

Provenance

The following attestation bundles were made for queria-0.6.1-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