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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pwnedapi-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for pwnedapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d0e0b2e27db8af07f01c964daac4acc12b668f8799004ef3781cd4e46dd11a74
MD5 a731a173f36d4cc25d7bae7c007d360d
BLAKE2b-256 17c0ceb82b9fa68678c3dbff5e341f34ba1b0b62c02ff404df247a6ee60c7efb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pwnedapi-1.0.0-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.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2

File hashes

Hashes for pwnedapi-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b68acc08b3fd44d46e475428c4082207eb9bd5bc21f751f0a9fdec66023d28e1
MD5 d5c7278a7e8f5ecf320027771daecc8c
BLAKE2b-256 8af86d78c3c8404155de8ac402e6639ac631836b5da1a5f531e7e91580d4bccb

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