pypleasant
pypleasant is a Python script and library which interfaces with the API of Pleasant Password Server.
pleasant-cli /path/to/entry --password # print an entry's password
pleasant-cli /path/to/entry --attachments secret_file.txt # download an attachment
pleasant-cli /path/to/entry --custom-field test # print value of a custom field
pleasant-cli 36a9f39f-78a1-4ec5-ae1a-421d91f59d2a --password # alternatively you can also use the uuid of the entry
Requirements
pypleasant requires Python >= 3.6 and is only compatible with Pleasant Password Server API v5.
Installation
pypleasant is available on PyPi and can be easily installed via pip:
pip install pypleasant
In order to use the command-line client pleasant-cli, ensure that your PATH variable includes
Python's bin directory (adapt if necessary):
export PATH+=":$HOME/.local/bin"
Use the --help switch to check whether everything is setup correctly:
pleasant-cli --help
Alternatively, pypleasant can be executed as a Python module without modifying the PATH variable:
python -m pypleasant --help
Configuration
pleasant-cli prompts the user for missing login information required for the Pleasant API.
This information can be configured (partially or completely) using command-line parameters
or environment variables:
--api-urlorPYPLEASANT_API_URL--api-userorPYPLEASANT_API_USER--api-password(NOT RECOMMENDED) orPYPLEASANT_API_PASSWORD
In case self-signed certificates are used, consider disabling the HTTPS certificate check via
--disable-cert-check or by setting PYPLEASANT_DISABLE_CERT_CHECK=true.
Usage
Print entry attributes:
pleasant-cli /path/to/entry --username
pleasant-cli /path/to/entry --password
pleasant-cli /path/to/entry --url
Access a custom field's value:
pleasant-cli /path/to/entry --custom-field test
Download attachments (defaults to the current directory):
pleasant-cli /path/to/entry --attachments # downloads all attachments
pleasant-cli /path/to/entry --attachments secret_file.txt
pleasant-cli /path/to/entry --attachments file_1.txt file_2.txt --download-dir /path/to/download/dir
For a complete overview of all parameters, run pleasant-cli with the --help switch:
> pleasant-cli --help
usage: pleasant-client [-h]
(--username | --password | --url | --custom-field [CUSTOM_FIELD] | --attachments [ATTACHMENTS [ATTACHMENTS ...]])
[--download-dir DOWNLOAD_DIR] [--api-url API_URL]
[--api-user API_USER] [--api-password API_PASSWORD]
[--disable-cert-check] [--verbose] [--debug]
PATH | ENTRY-ID
positional arguments:
PATH | ENTRY-ID the path (e.g. /Development/git) or entry-id (e.g.
36a9f39f-78a1-4ec5-ae1a-421d91f59d2a) on the pleasant
server to the credential entry (env var:
PYPLEASANT_PATH_TO_ENTRY)
optional arguments:
-h, --help show this help message and exit
--username print the username
--password print the password
--url print the URL
--custom-field [CUSTOM_FIELD]
print the given custom field
--attachments [ATTACHMENTS [ATTACHMENTS ...]]
download the given attachment(s); if no attachment is
given, all attachments are downloaded
--download-dir DOWNLOAD_DIR
attachments are downloaded to this directory (DEFAULT:
'.', env var: PYPLEASANT_DOWNLOAD_DIR)
--api-url API_URL URL of the pleasant server API (env var:
PYPLEASANT_API_URL)
--api-user API_USER user for the pleasant server API (env var:
PYPLEASANT_API_USER)
--api-password API_PASSWORD
password for the pleasant server API (env var:
PYPLEASANT_API_PASSWORD)
--disable-cert-check disable HTTPS cert check (env var:
PYPLEASANT_DISABLE_CERT_CHECK)
--verbose activate verbose output
--debug activate debug output (env var: PYPLEASANT_DEBUG)
Metadata
Release files for pypleasant 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pypleasant-2.0.0.tar.gz | 7.1 kB | Without provenance | Details for pypleasant-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypleasant-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for pypleasant-2.0.0-py3-none-any.whl |
Total release size: 16.7 kB
Release files / pypleasant-2.0.0.tar.gz
| Download URL | pypleasant-2.0.0.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2179bd41c6f8f1af2496b6098bac66e9d1a345907137e12aeea8a33abbb51371
|
|
BLAKE2b-256 checksum How to use checksums |
e501200e2d561482f12c9e7fefe0ced43ccf091bf2d3772244a639543b4ad8f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.9
|
Release files / pypleasant-2.0.0-py3-none-any.whl
| Download URL | pypleasant-2.0.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e33f453a15fe62504abd4a208c0fc998312332c2166bb7c8e699c3257d89bf01
|
|
BLAKE2b-256 checksum How to use checksums |
72b8b201107f978d9f8536e8312068b154dfcaaa51fe84c36c2c25e72e99ed79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.9
|
Security for pypleasant 2.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.