Skip to main content

fin3

Financial time-series data tooling for downloading, normalizing, validating, storing, and retrieving OHLCV bars as pandas DataFrames. Built on ArcticDB and MinIO, with Databento, Binance, Yahoo Finance, and Massive (formerly Polygon.io) provider implementations.

Maintained by Nathan Peet. Nathan uses fin3 to download, normalize, and prepare market data for analysis in his automated portfolio workflow. This describes data preparation and analysis, not live trade execution or investment performance; no external adoption is claimed.

Implemented functionality

  • Canonical OHLCV columns (open, high, low, close, volume) with UTC timestamps.
  • Exchange-session and continuous calendars, gap detection, incremental fetching, and calendar alignment.
  • ArcticDB storage backed by MinIO/S3-compatible storage; local LMDB support for tests.
  • Raw-provider and post-alignment validation, metadata bootstrap, and per-symbol cross-process file locking.
  • Integrity auditing, HTML inspection reports, defragmentation, and resource monitoring.
  • Declarative YAML/JSON dataset manifests with an installed fin3 command (ensure, sync, and read-only status), including dry-run previews and drift detection.
  • Standalone download, audit, inspection, and Databento normalization scripts.

These are implemented capabilities, not a guarantee of error-free data or universal provider/asset coverage. Data availability, licensing, entitlements, and rate limits remain subject to each source.

Provider status

All four providers are registered in the public implementation. Live-verification notes below refer to historical public PR evidence, not a fresh live-API test of every provider on each checkout.

Provider key Implemented scope Verification and limitations
1: @ours

max_cost checks provider-reported estimates before fetching. Databento queries its cost API; Binance and Yahoo report zero, while subscription-based Massive also reports zero. A zero estimate does not make subscriptions or entitlements free, and max_cost does not cap Massive subscription charges.

Quick start (from source)

Requires Python 3.11+ and uv. Use this repository checkout; these instructions do not assume that a published PyPI package is available.

git clone https://github.com/nathanpt/fin3.git
cd fin3
uv sync --extra databento

For Yahoo support, add --extra yfinance. Binance and Massive use stdlib HTTP and need no provider-specific extra. ArcticDB storage still requires its core dependencies.

Configure

Start a local MinIO instance and supply its credentials plus your Databento key in an uncommitted .env file (the credentials below are development placeholders):

FIN3_MINIO__ENDPOINT=localhost:9000
FIN3_MINIO__ACCESS_KEY=minioadmin
FIN3_MINIO__SECRET_KEY=minioadmin
FIN3_PROVIDERS__DATABENTO__PROVIDER_TYPE=databento
FIN3_PROVIDERS__DATABENTO__API_KEY=db-your-key-here

Do not use placeholder storage credentials in production. See the usage guide for storage configuration and other providers.

Fetch and analyze

The following performs network requests and may incur Databento charges. Choose symbols, dates, dataset, and entitlements appropriate to your account before running.

from datetime import datetime, timezone

from fin3 import AssetType, ClientConfig, MarketDataFetcher, Resolution

fetcher = MarketDataFetcher(ClientConfig.from_env())
df = fetcher.get_data(
    asset_type=AssetType.EQUITY_US,
    provider="databento",
    resolution=Resolution.ONE_MINUTE,
    symbols=["AAPL"],
    start=datetime(2024, 1, 2, tzinfo=timezone.utc),
    end=datetime(2024, 1, 2, 23, 59, tzinfo=timezone.utc),
)
aapl = df["AAPL"]
closes = df[("AAPL", "close")]

get_data() checks existing coverage, fetches missing ranges, validates raw data, aligns bars to a calendar, validates again, and writes to ArcticDB before returning a symbol/field MultiIndex DataFrame. Library names follow {asset_prefix}-{resolution}-{provider}, for example equities-1m-databento or crypto-1h-binance. Missing in-session bars are represented by NaN OHLC and zero volume. Trading sessions depend on the asset calendar and daylight-saving time; NYSE hours are not a fixed UTC interval year-round.

A request whose range is already fully covered is served from storage alone: no provider configuration or provider extra is needed, and no provider calls are made. The provider is required only when a gap would actually be fetched — without one, get_data() raises ConfigurationError naming the provider and the environment variable to set. A configured provider whose SDK extra is not installed does not break construction; it fails only if a fetch needs it.

Standalone tools

The installed fin3 command drives the declarative manifest workflow (fin3 ensure, fin3 sync, and read-only fin3 status; see docs/USAGE.md). The scripts below remain standalone: run them from the checkout with uv run python scripts/<name>.py --help before using them. Some commands download paid data or modify storage; review their options first.

Script Purpose
download_symbols.py Download data for multiple symbols with cost estimation
audit_library.py Integrity checks and HTML dashboard
inspect_library.py Per-symbol library overview and HTML reports
defragment_library.py Compact ArcticDB segments, with dry-run support
normalize_databento.py Convert raw Databento parquet to canonical schema
fix_meta_rename.py Handle the FB-to-META symbol rename gap

Unfinished / planned

  • High-level DataManager retrieval, alignment, and multi-format output API.
  • Additional providers such as ThetaData; no ThetaData provider is in the public tree.

Binance, Yahoo, and Massive are implemented, not future provider stubs. The older Massive implementation plan is historical context, not current status. The internal .docs/ROADMAP.md referenced in repository conventions is not included in the public checkout; this README summarizes public implemented/planned status.

Documentation and development

uv sync --all-extras
uv run pytest tests/ -m "not integration"
uv run ruff check .
uv run mypy fin3/

Live integration tests require explicit opt-in and relevant keys/infrastructure. Mocked tests alone do not establish live provider compatibility; see the live-test requirements in AGENTS.md. Do not point validation runs at production stores.

License

Copyright 2026 Nathan Peet.

Licensed under the Apache License, Version 2.0. The license covers this repository's code; it does not grant rights to redistribute third-party market data or replace provider agreements.

Metadata

Release files for fin3 0.4.1

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

Source distribution (sdist)

Source distribution for fin3 0.4.1
File Size Uploaded Provenance Actions
fin3-0.4.1.tar.gz 213.5 kB With provenance Details for fin3-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fin3 0.4.1
File Interpreter ABI Platform Actions
fin3-0.4.1-py3-none-any.whl Python 3 none any Details for fin3-0.4.1-py3-none-any.whl

Total release size: 354.7 kB

Release files / fin3-0.4.1.tar.gz

Download URL fin3-0.4.1.tar.gz
Size 213.5 kB
Tags Source
SHA-256 checksum
How to use checksums
894e023dd66ef26ca753fa8906a5b49af77171183e8e74554ebe291b769f97e4
BLAKE2b-256 checksum
How to use checksums
3ec9e97d890c62ce0ce785e8047eaaddfaf748adc86e92f5eb07b839cd6c2658
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 12, 2026.

Transparency log

Release files / fin3-0.4.1-py3-none-any.whl

Download URL fin3-0.4.1-py3-none-any.whl
Size 141.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
758a0b360df73106dba2d0b9666cf14cf92d5c3d7383377e82841a0b7034f617
BLAKE2b-256 checksum
How to use checksums
4226fe16e741f715f7278fcc9bf83770d3c15200e909e4d7388c09822f649bd6
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 12, 2026.

Transparency log

Security for fin3 0.4.1

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 fin3-0.4.1.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 12, 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.

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