[![License](http://img.shields.io/:license-apache%202.0-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)
[![Create Pypi Release](https://github.com/memiiso/pyliquibase/actions/workflows/release.yml/badge.svg)](https://github.com/memiiso/pyliquibase/actions/workflows/release.yml)
# pyliquibase
A Python module to use [liquibase](http://www.liquibase.org/) in python, using the Java Native Interface (JNI).
For further details on python-java integration [please see here](#python-java-integration)
## Installation
install:
```shell
pip install pyliquibase
```
install from github:
```shell
pip install https://github.com/memiiso/pyliquibase/archive/master.zip --upgrade --user
```
## How to Use
using command line:
```shell
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:
```python
from pyliquibase import Pyliquibase
if __name__ == '__main__':
liquibase = Pyliquibase(defaultsFile="changelogs/liquibase.properties", logLevel="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
Python library is based on `LiquibaseCommandLine` Python class. It is reflection of Java `LiquibaseCommandLine` class.
liquibase calls are passed to Java `LiquibaseCommandLine.execute(liquibaseargs)` method.
[Pyjnius](https://github.com/kivy/pyjnius) is a Python library for accessing Java classes. It either starts a new JVM inside the process, or retrieves the already surrounding JVM. To read more on pyjnius please see https://pyjnius.readthedocs.io/en/latest/
```python
class LiquibaseCommandLine(JavaClass, metaclass=MetaJavaClass):
__javaclass__ = 'liquibase/integration/commandline/LiquibaseCommandLine'
# methods
execute = JavaMethod('([Ljava/lang/String;)I')
```
### Contributors
<a href="https://github.com/memiiso/pyliquibase/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=memiiso/pyliquibase" />
</a>
##
LIQUIBASE is a registered trademark of [Liquibase](https://www.liquibase.com) , INC.
Raw data
{
"_id": null,
"home_page": "https://github.com/memiiso/pyliquibase",
"name": "pyliquibase",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Memiiso Organization",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d5/e9/2c8d0165425efd069edfe68bba23209d2484c5e7b25d2bef02e4dab98a42/pyliquibase-2.3.0.tar.gz",
"platform": null,
"description": "[![License](http://img.shields.io/:license-apache%202.0-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)\n[![Create Pypi Release](https://github.com/memiiso/pyliquibase/actions/workflows/release.yml/badge.svg)](https://github.com/memiiso/pyliquibase/actions/workflows/release.yml)\n# pyliquibase\n\nA Python module to use [liquibase](http://www.liquibase.org/) in python, using the Java Native Interface (JNI).\n\nFor further details on python-java integration [please see here](#python-java-integration)\n\n## Installation\n\ninstall:\n```shell\npip install pyliquibase\n```\n\ninstall from github:\n```shell\npip install https://github.com/memiiso/pyliquibase/archive/master.zip --upgrade --user\n```\n\n## How to Use\n\nusing command line:\n```shell\npyliquibase --defaultsFile=changelogs/liquibase.properties status\npyliquibase --defaultsFile=changelogs/liquibase.properties validate\npyliquibase --defaultsFile=changelogs/liquibase.properties updateSQL\npyliquibase --defaultsFile=changelogs/liquibase.properties update\n```\n\nusing python:\n```python\nfrom pyliquibase import Pyliquibase\n\nif __name__ == '__main__':\n liquibase = Pyliquibase(defaultsFile=\"changelogs/liquibase.properties\", logLevel=\"INFO\")\n # call execute with arguments\n liquibase.execute(\"status\")\n liquibase.execute(\"rollback\", \"MyTag\")\n # or \n liquibase.validate()\n liquibase.status()\n liquibase.updateSQL()\n liquibase.update()\n liquibase.update_to_tag(\"MyTag\")\n liquibase.rollback(\"MyTag\")\n # liquibase maintenance commands\n liquibase.changelog_sync()\n liquibase.changelog_sync_to_tag(\"MyTag\")\n liquibase.clear_checksums()\n liquibase.release_locks()\n```\n\n## Python Java Integration\n\nPython library is based on `LiquibaseCommandLine` Python class. It is reflection of Java `LiquibaseCommandLine` class.\nliquibase calls are passed to Java `LiquibaseCommandLine.execute(liquibaseargs)` method.\n\n[Pyjnius](https://github.com/kivy/pyjnius) is a Python library for accessing Java classes. It either starts a new JVM inside the process, or retrieves the already surrounding JVM. To read more on pyjnius please see https://pyjnius.readthedocs.io/en/latest/\n```python\nclass LiquibaseCommandLine(JavaClass, metaclass=MetaJavaClass):\n __javaclass__ = 'liquibase/integration/commandline/LiquibaseCommandLine'\n # methods\n execute = JavaMethod('([Ljava/lang/String;)I')\n```\n\n### Contributors\n<a href=\"https://github.com/memiiso/pyliquibase/graphs/contributors\">\n <img src=\"https://contributors-img.web.app/image?repo=memiiso/pyliquibase\" />\n</a>\n\n\n##\nLIQUIBASE is a registered trademark of [Liquibase](https://www.liquibase.com) , INC.\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Python liquibase",
"version": "2.3.0",
"project_urls": {
"Download": "https://github.com/memiiso/pyliquibase/archive/master.zip",
"Homepage": "https://github.com/memiiso/pyliquibase"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e7f80d29ac2b1a9516bce2ceec7f8e4f6f7e03d1ea722675abf42383f3fb7127",
"md5": "ddae6eb6b2af1408547ab2a18c6b6c0a",
"sha256": "4851a69a23efba445d46c936801737d2eda30aa1617aab5ad28d0bbf498cc1e2"
},
"downloads": -1,
"filename": "pyliquibase-2.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ddae6eb6b2af1408547ab2a18c6b6c0a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 10646,
"upload_time": "2024-07-22T12:14:39",
"upload_time_iso_8601": "2024-07-22T12:14:39.074589Z",
"url": "https://files.pythonhosted.org/packages/e7/f8/0d29ac2b1a9516bce2ceec7f8e4f6f7e03d1ea722675abf42383f3fb7127/pyliquibase-2.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d5e92c8d0165425efd069edfe68bba23209d2484c5e7b25d2bef02e4dab98a42",
"md5": "2a58d366d36ba90f97c6040ae1b4e3f0",
"sha256": "7041533406edfd58a98b52e985df09986ef512c48a15d854917239ae39130fb9"
},
"downloads": -1,
"filename": "pyliquibase-2.3.0.tar.gz",
"has_sig": false,
"md5_digest": "2a58d366d36ba90f97c6040ae1b4e3f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9465,
"upload_time": "2024-07-22T12:14:40",
"upload_time_iso_8601": "2024-07-22T12:14:40.424604Z",
"url": "https://files.pythonhosted.org/packages/d5/e9/2c8d0165425efd069edfe68bba23209d2484c5e7b25d2bef02e4dab98a42/pyliquibase-2.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-22 12:14:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "memiiso",
"github_project": "pyliquibase",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyliquibase"
}