Python client for KeePassHTTP to interact with KeePass's credentials
Project description
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")
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.kdbx
inKeePass
password istest
- set
TEST_WITH_KEEPASS
environment variable - run test normally
Coverage
To run tests with coverage:
pip install pytest-cov
pytest --cov
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
keepasshttp-1.2.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for keepasshttp-1.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02fbc76b41a80e73ed48208cbbf472be1bcaa32177524014101c20662e163ad |
|
MD5 | 6566858378b93f087a3c2d6dfcc6a2f0 |
|
BLAKE2b-256 | bd0d7e810076a6944041a82a96be30a7c26a215b28b1052a71ee57bcd4e5a290 |