Skip to main content

Python interface to the Diário de Obras (diariodeobras.net) API

Project description

diariopy

CI PyPI Python

diariopy is a Python interface to the diariodeobras.net ("Diário de Obras") platform — the Python counterpart of the R package diario. It securely stores an API token and wraps authenticated requests to retrieve projects, tasks, reports, and more.

Disclaimer. This package is a wrapper for the API provided by the Diário de Obras platform, which owns the data. Function and argument names are in English, but because the source API is in Portuguese, response keys and some data values are returned in Portuguese. Access requires a valid authentication token issued by the platform.

Installation

pip install diariopy

Getting started

import diariopy

# 1. Store your API token securely (uses the system keyring)
diariopy.store_token("YOUR_API_TOKEN_HERE")

# 2. Confirm it was stored
diariopy.retrieve_token()

# 3. Make authenticated requests
company = diariopy.get_company()
projects = diariopy.get_projects()

Usage

project_id = "6717f864d163f517ae06e242"

diariopy.get_entities()                      # registered entities (cadastros)
diariopy.get_project_details(project_id)     # one project
diariopy.get_task_list(project_id)           # schedule items (cronograma)
diariopy.get_task_details(project_id, task_id)
diariopy.get_reports(project_id, limit=10, order="asc")
diariopy.get_report_details(project_id, report_id)

All getters return parsed JSON (Python dict/list). Request failures raise diariopy.DiarioError; invalid arguments raise ValueError.

Configuration

  • Base URL — override with the DIARIO_BASE_URL environment variable (useful for staging or testing).
  • Logging — the package logs through the diariopy logger and does not print.

Development

uv sync --extra test      # or: pip install -e ".[test]"
uv run pytest             # tests mock the network; no token required
uv build                  # build sdist + wheel

License

MIT — see LICENSE.

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

diariopy-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

diariopy-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file diariopy-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for diariopy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2397c3209a38da1d119c46c32d0a7ab72b3d2ca0de361a7a2a87aef610d66e39
MD5 f69ebdac746e3b1111acdbf43950934d
BLAKE2b-256 6169047d47a36c6995e85cf312bb0c8d219c95fa5db9bb3a70020288f240be0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for diariopy-0.1.0.tar.gz:

Publisher: publish.yml on StrategicProjects/diariopy

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

File details

Details for the file diariopy-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for diariopy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb7a8d182607ec331c91b87d8369e7c47555ee5fbcc4a151e0e668e426cbccdb
MD5 945cd52ec5e046b1c7bd7cf8ec0013e7
BLAKE2b-256 b0a3dd8c49ff9db314de7b2718c3394562e997afc7d10699e89f03269d6f32d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for diariopy-0.1.0-py3-none-any.whl:

Publisher: publish.yml on StrategicProjects/diariopy

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