mdb-changelog-runner
Lightweight Python execution for Liquibase-style Neo4j/MDB changelog XML.
This package parses ordered <changeSet> entries and executes their
<neo4j:cypher> queries in a single Neo4j transaction. It does not require
Java, the JDK, Liquibase, or the Liquibase Neo4j extension at runtime.
Install
uv add mdb-changelog-runner
For local development:
uv sync
uv run pytest
XML format
Existing Liquibase Neo4j changelogs are supported:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:neo4j="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:mdb="https://cbiit.github.io/mdb/changelog">
<changeSet id="1" author="MDB-runner">
<neo4j:cypher>CREATE (n:test {handle:'TEST'})</neo4j:cypher>
</changeSet>
</databaseChangeLog>
Parameterized Cypher can use MDB JSON params:
<changeSet id="2" author="MDB-runner">
<neo4j:cypher>
MERGE (n:term {handle: $handle, value: $value})
</neo4j:cypher>
<mdb:params>{"handle": "C123", "value": "Example"}</mdb:params>
</changeSet>
Usage
import logging
from neo4j import GraphDatabase
from mdb_changelog_runner import ChangelogExecutor
driver = GraphDatabase.driver(uri, auth=(user, password))
logger = logging.getLogger("mdb_changelog_runner")
executor = ChangelogExecutor(driver, logger=logger)
result = executor.execute(
"local_changelog.xml",
"s3://my-bucket/model_changelogs/CTDC/local_changelog.xml",
# Optional changelog_scope
changelog_scope="model",
# Optional changelog_scope_path
changelog_scope_path="model_changelogs/CTDC",
# Optional schema_mode=True for schema-only changelogs
)
print(result.changesets_executed)
execute() opens a session when given a Neo4j driver. It can also accept an
already-open session-like object that provides begin_transaction().
Behavior
- Each
<changeSet>must have anid,author, and<neo4j:cypher>element. - Changesets run in XML order.
- All changesets run inside one transaction unless
schema_mode=Trueis used. - In schema mode, each changeSet is committed separately.
- After all changesets succeed, one
_changelogmetadata node is written. In single-transaction mode it is written in the same transaction; in schema mode it is written in a final transaction. It records the run timestamp, changelog S3 location, optional scope values, number of executed changesets, unique authors, and adeprecate_aftertimestamp. - The new
_changelognode links to the previous matching run with:prev_changelog. Matching uses scope values when provided, otherwiselocation. - Empty changelogs do not write
_changelogmetadata. - If any changeset fails, the transaction is rolled back and
ChangelogExecutionErroris raised. No metadata is written for failed runs. dry_run=Trueparses the changelog and returns a summary without executing Cypher.- By default,
deprecate_afteris 6 months after the run timestamp. Pass adatetime.timedeltaasChangelogExecutor(..., deprecate_after=...)to override it.
Release files for mdb-changelog-runner 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdb_changelog_runner-1.0.4.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdb_changelog_runner-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.2 kB
Release files / mdb_changelog_runner-1.0.4.tar.gz
| Download URL | mdb_changelog_runner-1.0.4.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
57bab5bbc25f5d4e6f22e458b6a6b0f17e46adc82932f9df584d80381cba75ca
|
|
BLAKE2b-256 checksum How to use checksums |
03edaf1b632c01c316d25146b11e29aea341383b3cd608386925571dec5f0efd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 25, 2026.
Transparency logRelease files / mdb_changelog_runner-1.0.4-py3-none-any.whl
| Download URL | mdb_changelog_runner-1.0.4-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
437dcf84051bd79ba386d41c44679822727dbcefc55096b73dde6d6aee723bc1
|
|
BLAKE2b-256 checksum How to use checksums |
9351f7a1c220ddc4ef738f92b7eccb7c590bc1795735217b753a2b140ed40151
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 25, 2026.
Transparency log