# pypassbolt-api
## About
Python library for Passbolt API based on [httpx](https://www.python-httpx.org/) and [PGPy](https://pgpy.readthedocs.io/en/latest/).
You can also use [python-gnupg](https://docs.red-dove.com/python-gnupg/) if needed but it is not the default.
## How to install
```sh
python -m pip install pypassbolt-api
```
## How to use
### config.json configuration file
Basically, create a `config.json` file containing needed configuration. You will find samples:
* For PGPy (default): [config.json.PGPy.sample](https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/config.json.PGPy.sample)
* For python-gnupg: [config.json.gnupg.sample](https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/config.json.gnupg.sample)
Then have a look at [https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/example.py](example.py) python script.
### Environment variables
Mandatory:
* PASSBOLT_BASE_URL: Your passbolt URL
For PGPy:
* PASSBOLT_PRIVATE_KEY: Your passbolt private key in one-line format (See below about how to format)
* PASSBOLT_PASSPHRASE: Your passbolt passphrase
For python-gnupg:
* PASSBOLT_GPG_BINARY (Optional): path to your gpg binary, default to "gpg"
* PASSBOLT_GPG_LIBRARY: Set this to gnupg, otherwise it will be the default "PGPy"
* PASSBOLT_FINGERPRINT: The OpenPGP key fingerprint to use
## How to set OpenPGP key in config.json or environment variables
### Linux:
```sh
sed -z 's/\n/\\n/g' passbolt_private.txt
```
### MacOS
Install `gnu-sed` with brew:
```sh
brew install gnu-sed
```
Use gsed instead of sed:
```sh
gsed -z 's/\n/\\n/g' passbolt_private.txt
```
>Note: Almost all the source code has been obtained from the existing py-passbolt library, with some extra functions. [py-passbolt](https://github.com/passbolt/lab-passbolt-py.git)
Raw data
{
"_id": null,
"home_page": "https://github.com/mjavint/pypassbolt_api",
"name": "pypassbolt-api",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Manuel Vinent Guilarte",
"author_email": "mjavint@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f4/39/82a463e051ffde750ffe208a18d21f70bc839e4e1322c788bc083eab6ea8/pypassbolt_api-0.0.4.tar.gz",
"platform": null,
"description": "# pypassbolt-api\n\n## About\n\nPython library for Passbolt API based on [httpx](https://www.python-httpx.org/) and [PGPy](https://pgpy.readthedocs.io/en/latest/).\n\nYou can also use [python-gnupg](https://docs.red-dove.com/python-gnupg/) if needed but it is not the default.\n\n## How to install\n\n```sh\npython -m pip install pypassbolt-api\n```\n\n## How to use\n\n### config.json configuration file\n\nBasically, create a `config.json` file containing needed configuration. You will find samples:\n\n* For PGPy (default): [config.json.PGPy.sample](https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/config.json.PGPy.sample)\n* For python-gnupg: [config.json.gnupg.sample](https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/config.json.gnupg.sample)\n\nThen have a look at [https://gitlab.com/AnatomicJC/py-passbolt/-/blob/main/example.py](example.py) python script.\n\n### Environment variables\n\nMandatory:\n\n* PASSBOLT_BASE_URL: Your passbolt URL\n\nFor PGPy:\n\n* PASSBOLT_PRIVATE_KEY: Your passbolt private key in one-line format (See below about how to format)\n* PASSBOLT_PASSPHRASE: Your passbolt passphrase\n\nFor python-gnupg:\n\n* PASSBOLT_GPG_BINARY (Optional): path to your gpg binary, default to \"gpg\"\n* PASSBOLT_GPG_LIBRARY: Set this to gnupg, otherwise it will be the default \"PGPy\"\n* PASSBOLT_FINGERPRINT: The OpenPGP key fingerprint to use\n\n## How to set OpenPGP key in config.json or environment variables\n\n### Linux:\n\n```sh\nsed -z 's/\\n/\\\\n/g' passbolt_private.txt\n```\n\n### MacOS\n\nInstall `gnu-sed` with brew:\n\n```sh\nbrew install gnu-sed\n```\n\nUse gsed instead of sed:\n\n```sh\ngsed -z 's/\\n/\\\\n/g' passbolt_private.txt\n```\n\n>Note: Almost all the source code has been obtained from the existing py-passbolt library, with some extra functions. [py-passbolt](https://github.com/passbolt/lab-passbolt-py.git)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library for Passbolt, an open-source manager for teams",
"version": "0.0.4",
"project_urls": {
"Documentation": "https://github.com/mjavint/pypassbolt_api/blob/main/README.md",
"Homepage": "https://github.com/mjavint/pypassbolt_api",
"Source": "https://github.com/mjavint/pypassbolt_api",
"Tracker": "https://github.com/mjavint/pypassbolt_api/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "155895599d43b697b4e6a14f9640763062fbe587da9eeabd49d3cda1a30265df",
"md5": "32eeb01ce72c0862219e628f041e3b2e",
"sha256": "6b3e1dd268da7a29a0eb32bc7c2821fc9f7869594a623a7d5c26c3a7b0193b9c"
},
"downloads": -1,
"filename": "pypassbolt_api-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "32eeb01ce72c0862219e628f041e3b2e",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 5294,
"upload_time": "2024-08-25T21:32:47",
"upload_time_iso_8601": "2024-08-25T21:32:47.661694Z",
"url": "https://files.pythonhosted.org/packages/15/58/95599d43b697b4e6a14f9640763062fbe587da9eeabd49d3cda1a30265df/pypassbolt_api-0.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f43982a463e051ffde750ffe208a18d21f70bc839e4e1322c788bc083eab6ea8",
"md5": "51fab5766a6021c92e27ad1c59de9fff",
"sha256": "ffcd718d76d258696b946954aff5427bafe8b84b7e5a8512d7959b68062bcf55"
},
"downloads": -1,
"filename": "pypassbolt_api-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "51fab5766a6021c92e27ad1c59de9fff",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 8566,
"upload_time": "2024-08-25T21:32:49",
"upload_time_iso_8601": "2024-08-25T21:32:49.926795Z",
"url": "https://files.pythonhosted.org/packages/f4/39/82a463e051ffde750ffe208a18d21f70bc839e4e1322c788bc083eab6ea8/pypassbolt_api-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-25 21:32:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mjavint",
"github_project": "pypassbolt_api",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pypassbolt-api"
}