Skip to main content

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.

Metadata

Release files for pwnedapi 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pwnedapi 1.0.2
File Size Uploaded
pwnedapi-1.0.2.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pwnedapi 1.0.2
File Interpreter ABI Platform
pwnedapi-1.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 14.2 kB

Release files / pwnedapi-1.0.2.tar.gz

Download URL pwnedapi-1.0.2.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
04bd60c9a0643c6b741775bdfe9c70b9433d44553cad623996569b1489e19537
BLAKE2b-256 checksum
How to use checksums
c8d4ad0929eee6e58a72c6353d9a599a4aa809b5e439dfcbe0602ebe8dd731b4
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pwnedapi-1.0.2-py2.py3-none-any.whl

Download URL pwnedapi-1.0.2-py2.py3-none-any.whl
Size 7.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3663236ce0f15f796b966a988e9fa1dab20c7e81955a5f3b86bd73adef90da93
BLAKE2b-256 checksum
How to use checksums
2b3c59364e23fc52e99a0f871e1509823c44d1075d6379ad813fe87eb6ec1b55
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page