Skip to main content

quantilica-cli

CLI unificada para o ecossistema Quantilica de dados abertos brasileiros. For full documentation, please visit https://docs.quantilica.com.

Instalação

pip install quantilica-cli

Instale os fetchers desejados separadamente:

pip install comex-fetcher inmet-fetcher rtn-fetcher

Uso

quantilica --help
quantilica list-sources
quantilica comex sync 2024
quantilica inmet sync 2020 2021
quantilica td sync --dataset prices

Lake

quantilica lake monta e audita o lake de Parquet a partir de um bruto local, sem depender de banco de dados nem do ledger do acervo (ele é opcional). O fluxo é bruto local → select → build → audit:

# 1. visão só com a versão vigente de cada arquivo (hardlink; cai em symlink e em cópia)
quantilica lake select --raw /dados/bruto --out /dados/vigente --exclude excluir.txt

# 2. conversão em Parquet, por fonte e dataset, em processos separados; retoma uma execução interrompida
quantilica lake build --input /dados/vigente --lake /dados/lake --workers 4 --memory 12GB

# 3. auditoria: rodapés, proveniência (sha256), cobertura, estrutura e leitores
quantilica lake audit --lake /dados/lake --input /dados/vigente --json-file auditoria.json
  • select só precisa do quantilica-core. build e audit usam o quantilica-analytics, que entra com pip install "quantilica-cli[lake]"; sem ele esses dois comandos avisam o que instalar e saem com código 1.
  • --exclude e --exceptions aceitam um arquivo texto com um item por linha (linhas vazias e iniciadas por # são ignoradas): sha256 ou caminho relativo no select, caminho relativo ou padrão fnmatch no audit.
  • build sai com código 1 se alguma tarefa falhar, e com 130 se for interrompido (Ctrl+C); rodar de novo retoma e --retry-errors refaz só o que falhou. O andamento sai em stderr.
  • audit sai com 0 se o lake for aprovado e com 1 se houver achados. --json imprime o relatório em JSON no stdout (o andamento fica em stderr); --json-file ARQ o grava.
  • --ledger ARQ (opcional, só em audit) confere a proveniência também contra uma exportação do ledger; sem ele, a conferência usa o sha256 dos manifestos ou do próprio arquivo.

Lake numa pasta sincronizada

Quando o lake mora numa pasta sincronizada por um cliente de nuvem, uma máquina constrói e audita ali, e outra lê a mesma pasta sem nunca escrever nela. O cliente envia os arquivos em ordem qualquer, então quem lê precisa de um critério próprio de "publicado":

  • build grava <lake>/<fonte>/_em-atualizacao.json antes de escrever a fonte, e <lake>/<fonte>/_build.json (o manifesto: build_id e o tamanho de todos os Parquets da fonte) ao fim de um build bem-sucedido. Um build que falha na fonte não grava o manifesto e mantém o marcador.
  • Na máquina que constrói, audit --limpar-marcador remove o marcador das fontes cuja auditoria passa.
  • Na máquina que lê, audit --somente-leitura --estado ESTADO.json não escreve nada no lake e confere o manifesto (todo arquivo listado existe com o mesmo tamanho, e não há Parquet fora dele). Por fonte, o ESTADO.json (fora do lake) recebe o build_id auditado e o resultado: publicado, em_atualizacao (há marcador; não reprova), incompleto (faltou arquivo, tamanho diferente, Parquet extra ou sem _build.json) ou falhou (outro achado).
  • catalog sync e docs schema aceitam --estado ESTADO.json (ou a variável QUANTILICA_LAKE_ESTADO): só leem as fontes publicado cujo build_id é o do _build.json atual e cujo disco bate com esse manifesto na hora da leitura (cada Parquet listado existe com o mesmo tamanho e não há Parquet fora da lista; o cliente de sincronização pode ter entregue arquivos de um build novo depois da auditoria). As demais são puladas com aviso. Quem lê deve sempre usar o estado (de preferência pela variável de ambiente): sem ele só o marcador protege a leitura, e um lake sem _build.json segue como antes.
  • --estado do audit só vale com --somente-leitura (exit 2 sem ele). O manifesto só vale para o que o build escreveu: Parquets gravados por outros caminhos (os convert dos fetchers) não o têm, e a auditoria --somente-leitura chama essa fonte de incompleto. O manifesto compara nomes e tamanhos, não o conteúdo: um arquivo reescrito com o mesmo tamanho passa despercebido.

Metadata

Release files for quantilica-cli 0.26.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantilica-cli 0.26.0
File Size Uploaded Provenance Actions
quantilica_cli-0.26.0.tar.gz 136.9 kB With provenance Details for quantilica_cli-0.26.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quantilica-cli 0.26.0
File Interpreter ABI Platform Actions
quantilica_cli-0.26.0-py3-none-any.whl Python 3 none any Details for quantilica_cli-0.26.0-py3-none-any.whl

Total release size: 210.9 kB

Release files / quantilica_cli-0.26.0.tar.gz

Download URL quantilica_cli-0.26.0.tar.gz
Size 136.9 kB
Tags Source
SHA-256 checksum
How to use checksums
22418aeabf9de8b517146a35158f6e75475610572e96638bcff66be76a51604a
BLAKE2b-256 checksum
How to use checksums
f074c12692cf19a5e8452d93f0c20c78c8c68dbb186bb6cc8931335627c8bf2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / quantilica_cli-0.26.0-py3-none-any.whl

Download URL quantilica_cli-0.26.0-py3-none-any.whl
Size 74.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f71c6cf90497ead621512b579fa0844c13d8cf262d340fff6185b0f5c5866d8
BLAKE2b-256 checksum
How to use checksums
5113b3cb4cfcd3c6c159cede31694900136e38ea27d3ebafb19beb42c1e17d79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for quantilica-cli 0.26.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for quantilica_cli-0.26.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.26.0 This release

2 release files Full provenance

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