Skip to main content

Python client for KeePassHTTP to interact with KeePass's credentials

Project description

KeePassHTTP

pypi_version.svg pypi_status.svg pypi_format.svg python_versions.svg
license.svg travis_build.svg codecov.svg requirements_status.svg code_size.svg pypi_downloads.svg

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, instanciate 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 in KeePass password is test
  • set TEST_WITH_KEEPASS environment variable
  • run test normally

Coverage

To run tests with coverage:

pip install pytest-cov
pytest --cov

Project details


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.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keepasshttp-1.1.0-py2.py3-none-any.whl (7.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file keepasshttp-1.1.0.tar.gz.

File metadata

  • Download URL: keepasshttp-1.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for keepasshttp-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dd274f4dd614c390c83a6ada7fc9a27afbecb1fd6dcdeb2698594e61f89a5955
MD5 80b9e9e4af0dd677f031b13bdf2b0cd9
BLAKE2b-256 e5f34f39db7bcb545caefe417c35ea85ad08840b77106792fe1c31952d0d86c5

See more details on using hashes here.

File details

Details for the file keepasshttp-1.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: keepasshttp-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.3

File hashes

Hashes for keepasshttp-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b7351cfa24a3d10f07c574696e9cd2b05ee603d721c3bc0932696974d25abb05
MD5 210567d1fdbe345ec4bc8a6ca7140031
BLAKE2b-256 8c59cf3e15ea856293f203c8643b44d4d2a8205030bf514582d67f9ecd7329ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page