Skip to content

Releases: opensanctions/pravda

v0.9.0

Choose a tag to compare

@monneyboi monneyboi released this 21 Oct 18:42
06dc076

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

Choose a tag to compare

@monneyboi monneyboi released this 20 Oct 15:11
605e98c

New: Storage is now public — exported from pravda — with a new read_blob() method that returns the bytes of a stored artifact path.

v0.7.0

Choose a tag to compare

@monneyboi monneyboi released this 20 Oct 12:15
d46ca3c

Breaking changes:

  • Timeout model reworked. Capture budgets moved to Timeouts on PravdaConfig, 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 to Liveness; their expiry raises InfrastructureError and persists nothing.
  • Pravda owns the browser connection lifecycle. Connection setup and recording-context close are Pravda's own infrastructure: their failures raise InfrastructureError and persist nothing, like storage and database failures. A plain async_sessionmaker is now accepted — expire_on_commit=False is no longer required.
  • New standalone_html artifact. Each snapshot derives a self-contained HTML file from its HAR with unmhtml (new dependency). This adds a standalone_html column to pravda.db.Base and the field on the public Snapshot. Regenerate your migrations from the metadata to add the column.
  • Pravda.snapshots() removed. Query history with your own selects against SnapshotRecord on pravda.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

Choose a tag to compare

@monneyboi monneyboi released this 01 Oct 14:53
6427463

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

Choose a tag to compare

@monneyboi monneyboi released this 29 Sep 22:07
07c50f8

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.metadata

The 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

Choose a tag to compare

@monneyboi monneyboi released this 28 Sep 16:07
ee2b0c0

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 head

v0.3.0

Choose a tag to compare

@monneyboi monneyboi released this 28 Sep 14:19
e9efc30

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 head

Each 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

Choose a tag to compare

@monneyboi monneyboi released this 24 Sep 19:30
6416c7d

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 with expire_on_commit=False) to Pravda. PravdaConfig no longer takes database_url, and Pravda is 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

v0.1.7

Choose a tag to compare

@monneyboi monneyboi released this 08 Sep 07:54
129da30

Full Changelog: v0.1.6...v0.1.7

v0.1.6

Choose a tag to compare

@monneyboi monneyboi released this 25 Aug 15:14
02487e2

Full Changelog: v0.1.5...v0.1.6