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.

Supported on Python versions 3.5 and up.

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

Uploaded Source

Built Distribution

pwnedapi-1.0.1-py2.py3-none-any.whl (7.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pwnedapi-1.0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pwnedapi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dbea9dacb1c9831532eff6933a6637dc2093c1de36f839bfef22e8beb31b87fe
MD5 cfecac494c1f679414aafd7ed4ca6e27
BLAKE2b-256 267027af625b89165922d4adcfa4e23f65a70538b1331824384b10f5f2a4448f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pwnedapi-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e95cedbd7434da4fec27b24597543861853fdaa4301649765699bdd0e70490ba
MD5 fdda0b1df8b7c32e9ccef09d40ff7699
BLAKE2b-256 db3ad37940e62fff69cf2e3d4b14510492d018cc0fa41dd15a9673619356b7b5

See more details on using hashes here.

Supported by

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