Skip to main content

PyPwned

Build Status

A Python client for the HaveIBeenPwned REST API. https://haveibeenpwned.com/

Installation

pip install pypwned

Requires

  • requests
  • pyOpenSSL
  • ndg-httpsclient
  • pyasn1

Usage

Note: The below examples assume you have loaded the envrionment variable HIBP_API_KEY with your appropriate Have I Been Pwned API key. More details here, https://haveibeenpwned.com/API/Key.

Breaches

Getting all breaches for an account

Get all breaches for an account across all domains.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreachesForAccount(email="foo@bar.com")
Get all breaches for an account across a specific domain.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreachesForAccount(email="foo@bar.com",domain="adobe.com")

Getting all breached sites in the system

Return the details of each breach in the system.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreaches()
Return the details of each breach associated with a specific domain.
import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllBreaches(domain="adobe.com")

Getting a single breached site

Return the details of a single breach, by breach name.

import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getSingleBreachedSite(name="adobe")

Getting all data classes in the system

Return the different types of data classes that are associated with a record in a breach. E.G, Email addresses and passwords

import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllDataClasses()

Pastes

Getting all pastes for an account

Return any pastes that contain the given email address

import pypwned, os
your_hibp_key = os.environ.get("HIBP_API_KEY")
pwny = pypwned.pwned(your_hibp_key)
pwny.getAllPastesForAccount(account="foo@bar.com")

Metadata

Release files for pypwned 1.0.0

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

Source distribution (sdist)

Source distribution for pypwned 1.0.0
File Size Uploaded
pypwned-1.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypwned 1.0.0
File Interpreter ABI Platform
pypwned-1.0.0-py2-none-any.whl Python 2 none any Details

Total release size: 7.9 kB

Release files / pypwned-1.0.0.tar.gz

Download URL pypwned-1.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5709712183ec8e09f081dface3dd8deaaacf1418f1cb6177799c644477e5ea2c
BLAKE2b-256 checksum
How to use checksums
2d39188029f83a84a69f041777a6cec6fdf4f0b6857d4fd382444d321f219c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.10

Release files / pypwned-1.0.0-py2-none-any.whl

Download URL pypwned-1.0.0-py2-none-any.whl
Size 4.1 kB
Tags Python 2
SHA-256 checksum
How to use checksums
20b84629651ad09402f3b288dc60689502d4ca67ca276fec3ccd32f2658d8ceb
BLAKE2b-256 checksum
How to use checksums
96eceed0a2b0ef13176855fe8485513d1cd418c00683e6b882b646375a7c82c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/2.7.10

Release history Release notifications | RSS feed

1.0.1

This release

1.0.0 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.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