Skip to main content

Library for easily interfacing with Have I Been Pwned API v2.

Project description

pwnedapi (Have I Been Pwned)

Codacy grade Travis (.org) Codecov PyPI PyPI - Downloads Read the Docs GitHub Twitter Follow

A Python library to leverage Troy Hunt's Have I Been Pwned API v2 and the k-Anonymity model. Inspired by Phil Nash's Ruby gem pwned.

Support

This library is supported on Python versions 3.5 and up. Some development packages require Python 3.6 or newer so issues regarding the development environment compatibility should not be reported without first attempting to install newer version of Python.

Installation

# Option 1: From the PyPI repository
pip install pwnedapi

# Option 2: For people of great taste
pipenv install pwnedapi

# Option 3: Locally
git clone https://github.com/nikoheikkila/pwnedapi
cd pwnedapi
python setup.py install

Usage

In its simplest form you'll only need to use two methods. Will probably add more if and when the API grows.

Check a single password

You can also scan a file of passwords, and export results in any format supported by the tablib library.

Scan a file of passwords

CLI usage

The library also installs a command-line tool which you can use to check your password from the comfort of your terminal. Run pwned to see all the possibilities.

Development

Clone the repository normally. Then run make to install the dependencies.

While developing it's useful to ensure an acceptable code quality where the Pylama linter is helpful: run make lint to check your code. Once you have written your tests run make test to invoke the PyTest suites.

To run tests and calculate the code coverage run make coverage. This command will fail if you haven't set up a Codecov project with $CODECOV_TOKEN variable.

Remember to document your features and see that the documentation compiles successfully by running make docs.

Contributing

Check the source code and issues from this repository, and should anything interesting pop out feel free to open a pull request.

Before your changes will be merged make sure that Travis CI pipeline is green and code coverage is on acceptable level. GitHub takes care of these eventually but to save time always consider running the tests locally before pushing.

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

pwnedapi-1.0.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

pwnedapi-1.0.2-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pwnedapi-1.0.2.tar.gz.

File metadata

  • Download URL: pwnedapi-1.0.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pwnedapi-1.0.2.tar.gz
Algorithm Hash digest
SHA256 04bd60c9a0643c6b741775bdfe9c70b9433d44553cad623996569b1489e19537
MD5 139411203994f4d038f2eb1c3bf2aa26
BLAKE2b-256 c8d4ad0929eee6e58a72c6353d9a599a4aa809b5e439dfcbe0602ebe8dd731b4

See more details on using hashes here.

File details

Details for the file pwnedapi-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: pwnedapi-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for pwnedapi-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3663236ce0f15f796b966a988e9fa1dab20c7e81955a5f3b86bd73adef90da93
MD5 bf6f4c268d29401758130451b04eeb34
BLAKE2b-256 2b3c59364e23fc52e99a0f871e1509823c44d1075d6379ad813fe87eb6ec1b55

See more details on using hashes here.

Supported by

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