Skip to main content

pyliquibase

A Python module to use liquibase in python, using the Java Native Interface (JNI).

Documentation License contributions welcome Create Pypi Release

For full documentation, please visit https://memiiso.github.io/pyliquibase/

Installation

Python-Java integration requires Java. Ensure Java is installed on your operating system.

pip install pyliquibase

Quick Start

using command line:

pyliquibase --defaultsFile=changelogs/liquibase.properties status
pyliquibase --defaultsFile=changelogs/liquibase.properties validate
pyliquibase --defaultsFile=changelogs/liquibase.properties updateSQL
pyliquibase --defaultsFile=changelogs/liquibase.properties update

using python:

from pyliquibase import Pyliquibase

if __name__ == '__main__':
    liquibase = Pyliquibase(defaultsFile="changelogs/liquibase.properties")
    # optionally, you can add log-level or other liquibase arguments:
    # liquibase.addarg("--log-level", "info")

    # call execute with arguments
    liquibase.execute("status")
    liquibase.execute("rollback", "MyTag")
    # or 
    liquibase.validate()
    liquibase.status()
    liquibase.updateSQL()
    liquibase.update()
    liquibase.update_to_tag("MyTag")
    liquibase.rollback("MyTag")
    # liquibase maintenance commands
    liquibase.changelog_sync()
    liquibase.changelog_sync_to_tag("MyTag")
    liquibase.clear_checksums()
    liquibase.release_locks()

Python Java Integration

This Python library integrates with Java using the LiquibaseCommandLine class. Our Python LiquibaseCommandLine class acts as a reflection of the Java counterpart, passing Liquibase calls to the Java LiquibaseCommandLine.execute(liquibaseargs) method.

This integration leverages JPype1, a Python library for accessing Java classes. JPype starts a Java Virtual Machine (JVM) within the current process or connects to an existing JVM. For more information on JPype, please refer to their documentation: https://jpype.readthedocs.io/en/latest/.

import jpype
# ... setup classpath ...
jpype.startJVM(classpath=LIQUIBASE_CLASSPATH, convertStrings=True)
liquibase_cli = jpype.JClass("liquibase.integration.commandline.LiquibaseCommandLine")()
liquibase_cli.execute(args)

Contributors

LIQUIBASE is a registered trademark of Liquibase , INC.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyliquibase-3.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyliquibase-3.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pyliquibase-3.1.0.tar.gz.

File metadata

  • Download URL: pyliquibase-3.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyliquibase-3.1.0.tar.gz
Algorithm Hash digest
SHA256 c5085109c8c7ac72cd6492b0d3c3dd5f63f131bbb72e48fc37e636d4165aae70
MD5 9b5830a37fb184563363db379a6ad7ca
BLAKE2b-256 8975f3510e043676516cae0c88653cb73c8c1293bf9ebb924ba561aeabf0a940

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyliquibase-3.1.0.tar.gz:

Publisher: release.yml on memiiso/pyliquibase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyliquibase-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyliquibase-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyliquibase-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e77628949883cd1d91f9a1fb03e2c15e654341ab7c2b9605a9d00b9f18bfc10
MD5 110c744cfc5540adff72403a5c5fe6f3
BLAKE2b-256 1ffc76a9416f1c91cc099446fa42ef780a5a321cc53fd9af9a02bd83efb16b3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyliquibase-3.1.0-py3-none-any.whl:

Publisher: release.yml on memiiso/pyliquibase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 files

3.0.0

2 files

2.5.0

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.13

2 files

2.0.12

2 files

2.0.11

2 files

2.0.9

2 files

2.0.8

2 files

2.0.7

2 files

2.0.6

2 files

2.0.5

2 files

2.0.4

2 files

2.0.3

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page