Skip to main content

Common foundation utilities for Quantilica data projects

Project description

quantilica-core: Fundação de infraestrutura para projetos Quantilica

License: MIT Python

Biblioteca de utilitários domain-neutral que serve como base para todos os coletores e pipelines Quantilica. Centraliza rede resiliente, armazenamento atômico, proveniência de dados e logging estruturado — permitindo que cada pacote de domínio foque exclusivamente na lógica de sua fonte de dados.

Instalação

pip install quantilica-core

Com uv:

uv add quantilica-core

Uso Rápido

from quantilica.core.http import HttpClient
from quantilica.core.storage import LocalStorage
from quantilica.core.manifests import DownloadManifest

# Cliente HTTP com retry automático
client = HttpClient(attempts=3)
response = client.get("https://api.ibge.gov.br/...")

# Escrita atômica em disco
storage = LocalStorage("dados/raw")
stat = storage.write_bytes("sidra/tabela.csv", response.content)

# Registro de proveniência (SHA-256)
manifest = DownloadManifest.from_file(
    source_id="ibge",
    dataset_id="sidra-1234",
    url="https://...",
    file_path=stat.path,
    producer="sidra-fetcher",
)
manifest.write_json(stat.path.with_suffix(".manifest.json"))

Módulos

Módulo Descrição
http HttpClient e AsyncHttpClient com backoff exponencial e jitter
retry Lógica de retry configurável para falhas de rede e erros transientes
storage LocalStorage para gerenciar artefatos brutos e processados atomicamente
manifests DownloadManifest e ExecutionManifest para rastreabilidade completa
metadata Modelos MetadataCatalog, Source, Dataset para interoperabilidade
logging Logging estruturado via get_logger e log_step
exceptions Hierarquia padrão: FetchError, ParseError, StorageError

Princípios de Design

  1. Neutralidade de domínio — o core nunca sabe o que é IBGE, DATASUS ou INMET.
  2. Leveza — dependências mínimas no núcleo; integrações pesadas são extras opcionais.
  3. Estabilidade — alta cobertura de testes em todos os componentes de infraestrutura.
  4. DX — APIs tipadas e tratamento de erros consistente em toda a organização.

Desenvolvimento

git clone https://github.com/Quantilica/quantilica-core.git
cd quantilica-core
uv sync --dev
uv run pytest

Licença

MIT — veja 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

quantilica_core-0.3.1.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

quantilica_core-0.3.1-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

Details for the file quantilica_core-0.3.1.tar.gz.

File metadata

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

File hashes

Hashes for quantilica_core-0.3.1.tar.gz
Algorithm Hash digest
SHA256 99da83b0b7ef31fd31a40c902abb2045035959df20e4cd89b11889f7764f312b
MD5 42ad99254abe5353a88ab239771fe8b6
BLAKE2b-256 2138b3cd713637c112e9b818221dcf350ff4f4d628b8f4a31cf90222c644879b

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantilica_core-0.3.1.tar.gz:

Publisher: publish.yml on Quantilica/quantilica-core

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

File details

Details for the file quantilica_core-0.3.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for quantilica_core-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5b3d31560662b448ed238738775f26b9d89de65b1dca505c9ed32f3e1916350
MD5 ffb5285aa1c1d27fffa8a9855f76467e
BLAKE2b-256 01ccea5043e5b5770e9ef4f3677e5249308c3b46259d2ee45342bebf621bb346

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantilica_core-0.3.1-py3-none-any.whl:

Publisher: publish.yml on Quantilica/quantilica-core

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