Skip to main content

Chronicle

The web scraping library that remembers.

Chronicle is a data-science-native web scraping framework with temporal versioning and drift detection built in. Every scrape is stored, profiled, and compared to history — so you know exactly when your data changes and why.

PyPI version Python 3.10+ License: MIT Status: Alpha


Why Chronicle?

Existing scraping libraries hand you raw data and walk away. Chronicle remembers.

Tool Strength The gap Chronicle fills
Requests HTTP requests No parsing, no structure
BeautifulSoup HTML parsing No fetching, no data quality
Scrapy Large-scale crawling No drift detection, no reproducibility
Selenium JS-rendered pages No data pipeline, no versioning
lxml Fast parsing No fetching, no schema

Chronicle sits on top of these tools and adds the layer data scientists actually need:

  • 🕐 Temporal versioning — every scrape is stored, versioned, and replayable
  • 🔍 Drift detection — catch broken selectors before they poison your pipeline
  • 📊 DataFrame-native — one line from URL to analysis-ready data
  • 📜 Reproducible — every run produces a self-contained artifact
  • ✅ Schema validation — data quality enforced at scrape time
  • 🧠 DS-first design — built for Jupyter, pandas, and real pipelines

Install

pip install chronicle-ds

Chronicle requires Python 3.10+.


Quickstart

from chronicle import Scrape

df = Scrape("https://example.com/products").to_dataframe()
print(df.head())

Note on auto-detection: The one-liner works best on pages with HTML <table> elements or simple repeated list structures. It can pick the wrong structure on pages with navigation chrome (news sites, SPAs). For those, pass selectors={...} — see "More Control" below.

More Control

from chronicle import Scrape

df = Scrape(
    url="https://example.com/products",
    selectors={
        "_container": "div.product",
        "name": "h2",
        "price": "span.price",
        "rating": "span.rating",
    },
    pages=5,
    rate_limit=2.0,
).to_dataframe()

The Core Idea

Chronicle treats every scrape as a versioned event. This unlocks two things no other scraping library provides:

1. Temporal Versioning

Every run is stored with:

  • Raw HTML
  • Parsed data (Parquet)
  • Statistical profile
  • Run metadata (timestamps, config, library version)
# Query the full history of a scraper
history = Scrape.history("https://example.com/products")
history.drift_timeline()

2. Drift Detection

Chronicle compares each new run against a baseline and detects:

  • Schema drift — columns added, removed, or renamed
  • Null drift — fields suddenly returning None
  • Distribution drift — mean, median, or variance shifts
  • Range drift — values outside historical bounds
  • Selector health — selectors returning zero elements
result = Scrape("https://example.com/products").run()

if result.drift_detected:
    print(result.drift_report())
    # ⚠️ price null% jumped from 0.02 → 0.98 (selector likely broken)

Status

🚧 Early development. v0.1.0 in progress.

What's built

  • HTTP layer (fetch.py) — retries, rate limiting, caching
  • HTML parsing (parse.py) — selector + auto table/list detection
  • Schema validation (normalize.py) — pydantic + quality reports
  • Scrape class (core.py) — one-line API
  • Storage + versioning (storage.py) — versioned artifacts + SQLite
  • Profile generation (profile.py) — statistical fingerprints
  • Drift detection (drift.py) — null / distribution / range / schema
  • CLI (cli.py) — version, scrape, runs commands
  • 18 passing unit tests
  • Published to PyPI as chronicle-ds

Roadmap

  • Data contracts (schema + quality guarantees)
  • Reproducibility artifacts
  • Self-healing selectors
  • Playwright support for JS-rendered pages
  • CLI + recipe system

Contributing

Chronicle is in early, fast-moving development. Issues, ideas, and PRs are welcome.

git clone git@github.com:TheDataNormad/chronicle.git
cd chronicle
python -m venv .venv
source .venv/Scripts/activate  # Windows
pip install -e ".[dev]"
pytest

License

MIT — see LICENSE.


Author

Built by @TheDataNormad.

Metadata

Release files for chronicle-ds 0.1.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 chronicle-ds 0.1.1
File Size Uploaded
chronicle_ds-0.1.1.tar.gz 21.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chronicle-ds 0.1.1
File Interpreter ABI Platform
chronicle_ds-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.8 kB

Release files / chronicle_ds-0.1.1.tar.gz

Download URL chronicle_ds-0.1.1.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3cf4e1fd001f5f440c08e8eccbe12b405a055273484c3790c3748d89a09bc47c
BLAKE2b-256 checksum
How to use checksums
0570df57d71bcfed7a74ee6442af12b96a629b229595579aa8db5ff8d0ca66a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / chronicle_ds-0.1.1-py3-none-any.whl

Download URL chronicle_ds-0.1.1-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72afae49b22030be56af078aefc11687e9162f994eb6d97083888853f7c5f2b3
BLAKE2b-256 checksum
How to use checksums
44fd06c10495fd14efc3f8901d7a8899f6c9a636e5233fd001ebac021fb56bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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