KeePassHTTP
Python client for KeePassHTTP to interact with KeePass's credentials.
Install
$ pip install keepasshttp
Usage
import keepasshttp
# get single credential
credential = keepasshttp.get("my_credential_name_or_url")
print(credential.login)
print(credential.password)
# find all credentials's name
credentials = keepasshttp.list()
# fetch all partiall matching credentials
credentials = keepasshttp.search("my_credential_name_or_url")
# create a new keepasshttp entry
keepasshttp.create("login", "password", "url")
# update a keepasshttp entry
credential.password = "new password"
# or
keepasshttp.update("login", "password", "url", "uuid")
Command line
KeePassHTTP can also be called from command line:
$ python -m keepasshttp --help
usage: keepasshttp [-h] [-c CONFIG_PATH] [-u URL]
[-f {python,text,table,json,csv}]
credential [credential ...]
Fetch credentials from keepass
positional arguments:
credential Url or name to match credentials from keepass database
optional arguments:
-h, --help show this help message and exit
-c CONFIG_PATH, --config CONFIG_PATH
alternative path for keepasshttp's AES exchange key
(default: ~/.python_keepass_http)
-u URL, --url URL alternative url for keepasshttp server (default:
'http://localhost:19455/')
-f {python,text,table,json,csv}, --format {python,text,table,json,csv}
output format for credentials
$ python -m keepathhttp my_credential_name_or_url
my_credential_name_or_url
- login: login
- password: password
- name: test
- url: my_credential_name_or_url
- id: ABCDEF1234567890ABCDEF1234567890
- fields: []
Configuration
By default, this module will write AES association key to ~/.python_keepass_http
and use http://localhost:19455/ to connect to the KeePassHTTP server.
To change theses parameters, instantiate keepasshttp.KeePassHTTP class with different values.
from keepasshttp import KeePassHTTP
kph = KeePassHTTP(
storage="./keepasshttp_key",
url="https://example.com:1337/")
kph.get("...")
...
Testing
You can simply run the tests using:
python -m unittest discover
KeePassHTTP calls are mocked, to run the tests against a real server, you need to:
- open
tests/test_database.kdbxinKeePasspassword istest - set
TEST_WITH_KEEPASSenvironment variable - run test normally
Coverage
To run tests with coverage:
pip install pytest-cov
pytest --cov
Metadata
Release files for keepasshttp 1.4.1
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 |
|---|---|---|---|---|
| keepasshttp-1.4.1.tar.gz | 9.9 kB | Without provenance | Details for keepasshttp-1.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keepasshttp-1.4.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for keepasshttp-1.4.1-py2.py3-none-any.whl |
Total release size: 19.2 kB
Release files / keepasshttp-1.4.1.tar.gz
| Download URL | keepasshttp-1.4.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24f2fa5a9feca8cbc220419b1c8efa8050c6855aa8c68b191ad62218f66e17ee
|
|
BLAKE2b-256 checksum How to use checksums |
d3133f5c936a64ac67ad9d2981c6ce5b2e855b33ca089ab2baeb4f4d4c48ff68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.1
|
Release files / keepasshttp-1.4.1-py2.py3-none-any.whl
| Download URL | keepasshttp-1.4.1-py2.py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7b8be965467ed404f6aade530f202111c34b25aab8b932452c2694cf76f253cf
|
|
BLAKE2b-256 checksum How to use checksums |
33722a716ec4d9beffcbd59f7f529ea1dba6d12961be16984d97aff71982e4a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.1
|
Security for keepasshttp 1.4.1
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.