Common foundation utilities for Quantilica data projects
Project description
quantilica-core: Fundação de infraestrutura para projetos Quantilica
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
- Neutralidade de domínio — o core nunca sabe o que é IBGE, DATASUS ou INMET.
- Leveza — dependências mínimas no núcleo; integrações pesadas são extras opcionais.
- Estabilidade — alta cobertura de testes em todos os componentes de infraestrutura.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99da83b0b7ef31fd31a40c902abb2045035959df20e4cd89b11889f7764f312b
|
|
| MD5 |
42ad99254abe5353a88ab239771fe8b6
|
|
| BLAKE2b-256 |
2138b3cd713637c112e9b818221dcf350ff4f4d628b8f4a31cf90222c644879b
|
Provenance
The following attestation bundles were made for quantilica_core-0.3.1.tar.gz:
Publisher:
publish.yml on Quantilica/quantilica-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantilica_core-0.3.1.tar.gz -
Subject digest:
99da83b0b7ef31fd31a40c902abb2045035959df20e4cd89b11889f7764f312b - Sigstore transparency entry: 2192401316
- Sigstore integration time:
-
Permalink:
Quantilica/quantilica-core@3f2f1eb24048265a234c47b627097c6350613a6d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Quantilica
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f2f1eb24048265a234c47b627097c6350613a6d -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b3d31560662b448ed238738775f26b9d89de65b1dca505c9ed32f3e1916350
|
|
| MD5 |
ffb5285aa1c1d27fffa8a9855f76467e
|
|
| BLAKE2b-256 |
01ccea5043e5b5770e9ef4f3677e5249308c3b46259d2ee45342bebf621bb346
|
Provenance
The following attestation bundles were made for quantilica_core-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on Quantilica/quantilica-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quantilica_core-0.3.1-py3-none-any.whl -
Subject digest:
b5b3d31560662b448ed238738775f26b9d89de65b1dca505c9ed32f3e1916350 - Sigstore transparency entry: 2192401351
- Sigstore integration time:
-
Permalink:
Quantilica/quantilica-core@3f2f1eb24048265a234c47b627097c6350613a6d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Quantilica
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f2f1eb24048265a234c47b627097c6350613a6d -
Trigger Event:
push
-
Statement type: