Skip to main content

negirau

Python client for the Negirau public API (read-only, anonymous).

Hand-written around resource namespaces, a types package, a typed exception hierarchy, and retries with exponential backoff — and kept honest by contract tests: they load the service's build-time-generated openapi.json and prove that every operation is covered, that requests only use spec-declared parameters, and that spec-conformant payloads parse into the models. Drift between the API and this client fails CI — the same guarantee code generation gave, without generated code.

Install

pip install negirau

Usage

from negirau import Negirau

client = Negirau()

found = client.subjects.list(q="消防", limit=5)  # free-text name search
for subject in found.subjects:
    print(subject.id, subject.name)

nearby = client.subjects.list_near(35.64, 139.65, radius=3000)

reactions = client.subjects.reactions.retrieve(
    "0e6f9b3a-6b1e-4b8a-9a6a-1c2d3e4f5a6b",
    period="2026-W33",  # or a month ("2026-08"), a year ("2026"), or "all"
)
print(reactions.total)  # a display value: exact up to 100, "100+" beyond

Async:

from negirau import AsyncNegirau

async with AsyncNegirau() as client:
    page = await client.subjects.list(q="花火")

Errors and retries:

from negirau import Negirau, NotFoundError, RateLimitError

client = Negirau(max_retries=2)  # 408/409/429/5xx retry with exponential backoff

try:
    client.subjects.retrieve("no-such-subject")
except NotFoundError as error:
    print(error.status_code, error.code)  # 404 not_found
except RateLimitError:
    ...

Types live in negirau.types (Subject, SubjectPage, ReactionsSummary, DisplayValue, …).

Notes

  • Counts are display values by design: exact up to 100, "100+" beyond, and never rankings — no API returns unbounded exact numbers.
  • There are no bulk dumps: resolve names with client.subjects.list(q=...) (server-side trigram search, Japanese and English substrings).

License

Apache-2.0. This package lives in the negirau monorepo, whose server code is separately licensed under AGPL-3.0-only.

Download files

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

Source Distribution

negirau-0.1.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

negirau-0.1.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file negirau-0.1.1.tar.gz.

File metadata

  • Download URL: negirau-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for negirau-0.1.1.tar.gz
Algorithm Hash digest
SHA256 561a349df745a99c6350de8d8920213d775b15d8fae513af9b557ae5174d0b10
MD5 3a8afe8044cfb9dd79a3f45b3fa965f1
BLAKE2b-256 8243a75087b6457a5373f9e7ac98922c089c523a8c38f1e0a3b1cd7ee83f921f

See more details on using hashes here.

File details

Details for the file negirau-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: negirau-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for negirau-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e4b6044ea854e60f2f7f1acdc337d323866ea4d923e6365b579e443e4c1fb76a
MD5 7deb9fcfedadc36c1a1fbcc08007fb4b
BLAKE2b-256 49fc682e12639b72d74f80c46b31ac11e7c52dcf66a9ec1d88bd82ec5d36a3ce

See more details on using hashes here.

Supported by

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