Skip to main content

Library for easily interfacing with Have I Been Pwned API v2

Project description

# `pwnedapi` (Have I Been Pwned)

A small utility class to leverage Troy Hunt's [_Have I Been Pwned API v2_](https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange) and the _k-Anonymity_ model. Inspired by Phil Nash's Ruby gem [_pwned_](https://philnash.github.io/pwned/).

## Installation

```bash
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.

```python
>>> from pwnedapi import Password
>>> password = Password("mysupersecretpassword")
>>>
>>> if password.is_pwned():
... print(f"Your password has been pwned {password.pwned_count} times.")
...
Your password has been pwned 2 times.
>>>
```

## Support

This is my first official Python package so if something is off feel free to send a PR. :fist:

# TODO

- [ ] Add password change form validators to Django and Flask

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

Uploaded Source

File details

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

File metadata

  • Download URL: pwnedapi-0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pwnedapi-0.1.tar.gz
Algorithm Hash digest
SHA256 56047c1c2e7082142aa4ae6da96c0bb24a4e1c7ca3eca37a99879544ceebcad4
MD5 af2b78bbc1c7b4bdbf3d04c677c3529e
BLAKE2b-256 61d2258cd1e12842db40bd3374eb1afe5e11b9f24c4d2a41871f8298f94afa4b

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