Repository navigation
Releases: opensanctions/pravda
Release list
v0.9.0
Breaking: the database is gone — capture() returns Snapshot values and the application owns persistence. PravdaConfig is replaced by constructor parameters with Storage injected via Storage.from_url. Standalone HTML is derived on demand via snapshot.derive_standalone_html(storage); unmhtml is now an optional extra. Failed captures are returned with error set rather than raised.
v0.8.0
v0.7.0
Breaking changes:
- Timeout model reworked. Capture budgets moved to
TimeoutsonPravdaConfig, expressed in bare float seconds. They bound only the target-facing capture: expiry is recorded evidence — a persisted failed attempt, or a dropped artifact. Browser machinery deadlines moved toLiveness; their expiry raisesInfrastructureErrorand persists nothing. - Pravda owns the browser connection lifecycle. Connection setup and recording-context close are Pravda's own infrastructure: their failures raise
InfrastructureErrorand persist nothing, like storage and database failures. A plainasync_sessionmakeris now accepted —expire_on_commit=Falseis no longer required. - New
standalone_htmlartifact. Each snapshot derives a self-contained HTML file from its HAR withunmhtml(new dependency). This adds astandalone_htmlcolumn topravda.db.Baseand the field on the publicSnapshot. Regenerate your migrations from the metadata to add the column. Pravda.snapshots()removed. Query history with your own selects againstSnapshotRecordonpravda.db.Base.
Also new: rendered HTML capture waits for the DOM to settle (mutation-quiet) before reading, so hydration scripts land in the captured HTML.
v0.6.0
Breaking change: removes the `plaintext` artifact and the `beautifulsoup4` dependency. The stored plaintext was derived from the rendered HTML, so the same information is recoverable from `rendered_html`.
Removed: the `plaintext` field on the public `Snapshot`, the `snapshot.plaintext` database column, and the stored `.txt` blobs. Regenerate your migrations from `pravda.db.Base` to drop the column; previously stored `.txt` files are no longer referenced and can be pruned.
v0.5.0
Breaking change: removes the packaged Alembic migrations (pravda:migrations) and the alembic dependency. Consumers own the database and its migration ledger.
Include pravda.db.Base metadata in your own Alembic environment and generate your migrations from it:
from pravda.db import Base
target_metadata = Base.metadataThe database schema is unchanged from v0.4.0: if you previously ran the packaged revisions, generate your initial migration from the metadata and stamp your ledger — nothing else needs to change.
v0.4.0
Breaking change: the Alembic environment's environment-variable fallback is renamed from DATABASE_URL to PRAVDA_DATABASE_URI, matching the project-prefixed opensanctions convention (ZAVOD_DATABASE_URI, NOMENKLATURA_DB_URL). sqlalchemy.url in the Alembic configuration still takes precedence and is unchanged.
If you relied on the env var (e.g. the developer command in the README), rename it:
$ PRAVDA_DATABASE_URI=postgresql+psycopg://... alembic upgrade headv0.3.0
Breaking change: removes the public pravda.migrate(database_url) API and the migration tests.
Consumers now apply the packaged Alembic migrations from their own Alembic configuration, addressing the packaged scripts via the package-resource location:
[pravda]
script_location = pravda:migrations$ alembic -n pravda upgrade headEach environment tracks its own version table (pravda_alembic_version), so Pravda's history stays independent of the consumer's and the two upgrade commands coexist in one database, in either order. The database URL comes from the consumer's sqlalchemy.url or DATABASE_URL (see pravda/migrations/env.py). See the README "Database migrations" section for the full consumer setup.
v0.2.0
Breaking changes:
- Pravda connects to an externally provisioned browser over WebSocket; the endpoint owns its launch configuration.
- Applications own the database engine and pass an
async_sessionmaker(configured withexpire_on_commit=False) toPravda.PravdaConfigno longer takesdatabase_url, andPravdais no longer an async context manager — the application disposes the engine.
Also adds Python 3.12 support.
Full Changelog: v0.1.7...v0.2.0