Skip to main content

queria

English | 日本語

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

A client for the Japanese open data published on Queria — e-Stat, National Land Numerical Information, EDINET, the Japan Meteorological Agency, and more. Explore it from the terminal, Python and MCP, and declare your own datasets for the catalog. 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.

Publishing a dataset

queria validate and queria compile work on the metadata you declare for a dataset, turning it into dataset.json, the file Queria reads to list your data in the catalog. It works whether or not you build the dataset with dbt, and it never talks to the network — it only reads your declarations and your local data.

You declare two kinds of file. Directory names are up to you.

File Content
dataset.yml (repository root, required) the dataset itself
**/*.table.yml (anywhere) one table, or several
# dataset.yml
spec_version: "0.1"
name: calendar
title: Japanese calendar
description: A date spine from 1955 to 2027 with holidays, weekdays and Japanese eras.
language: ja
licenses: [CC-BY-4.0]          # the ID is enough; title, URL and rights come from the registry
contributors:
  - title: Cabinet Office
    roles: [rightsHolder]
# models/main/mart/mart_calendar.table.yml
schema: main
name: mart_calendar
title: Japanese calendar
description: A date spine with holidays, weekdays, Japanese eras and fiscal years.
published: true
fields:
  - name: date
    title: Date
    semantic: { role: entity, name: date }

Tables that share a column layout can go in one file, so YAML anchors can carry the shared part:

_fields: &fields
  - { name: area, title: Area code }
  - { name: value, title: Value, semantic: { role: measure, agg: sum } }
tables:
  - { schema: ssds, name: a_population, title: Population, fields: *fields }
  - { schema: ssds, name: b_land,       title: Land,       fields: *fields }

Do not write column types. They are read from your data, so they cannot drift from it.

queria validate                    # check the declarations against the data
queria compile -o dist/dataset.json

Point it at your data with --ducklake / --data-path, or --parquet for plain Parquet files. Inside fdl run, the catalog location is picked up from the environment. Pass --manifest target/manifest.json to also pull lineage and compiled SQL out of dbt (target/manifest.json is used automatically when it exists).

Where each piece of information comes from:

Information Source
title, description, license, published, semantic roles your declarations
tables, columns, types, column order, nullability your data
lineage, compiled SQL, source file paths dbt's manifest.json, when present

Without dbt you can still declare lineage with depends_on, and a .sql file next to a *.table.yml of the same name is picked up as the table's SQL.

If you keep *.table.yml under dbt's model-paths, add *.table.yml to .dbtignore — dbt reads every .yml there as a properties file and would fail on these. validate tells you when this is missing.

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

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.9.1.tar.gz (133.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.9.1-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for queria-0.9.1.tar.gz
Algorithm Hash digest
SHA256 a4a0025427db368845b0c3462e5ef05b4b50fb8e076dfff9ad4b6ed0343d915d
MD5 cfa005b1a3af7e4df200cadb413c2b05
BLAKE2b-256 ced37a5ae6026b850cc2e12ae0aeabf246a46af07cab1ac6691f80485642e968

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: queria-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 46.1 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.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de106ed22a25d837af108a43039c010f44a86b0702e7a2071522e762b7ec9867
MD5 a3ea2cbfee7cf31344b72afebfe3faba
BLAKE2b-256 e62f3fe8e43264b03373531beba8c2ef642910749d0a9e5ac526c9cb659ca030

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.1

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.10.0

2 files

This release

0.9.1 This release

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page