Skip to main content

A Python interface to the Have I Been Pwned API

Project description

# Have I Been Pwned?

Python interface to Have I Been Pwned API

## What is Have I Been Pwned?

[Have I Been Pwned](https://haveibeenpwned.com/) is a free resource to quickly assess if an account or domain has been compromised or “pwned” in a data breach. By aggregating the data here the project helps victims be aware of account compromises, and highlights the severity of the risks of Internet-wide attacks. For more information on who, what, and why, click [here](https://haveibeenpwned.com/About).

## Dependencies

` requests gevent `

## Setup

This library runs on Python3.x+

To install, run:

` $ pip install hibp `

## To run

You can query breach data on individual accounts/domains as well as data on full breaches. Each service request object contains a response attribute that holds the raw data output in JSON format. To perform a query, just setup a service request object, and then execute:

`python >> req = HIBP.get_account_breaches("pegasos1") >> req.execute() >> req.response `

If you want to query on multiple accounts or domains at once, you can use the AsyncHIBP object, which performs queries concurrently via gevent.

`python >> names = ['adobe','ashleymadison', 'myspace'] >> breaches = [HIBP.get_breach(x) for x in names] >> async_reqs = AsyncHIBP().map(breaches) >> [async_req.response for async_req in async_reqs] `

In addition to a canonical map method, AsyncHIBP also supports the imap method, which returns a generator object for lazy queries.

`python >> domains = ['twitter.com','facebook.com', 'adobe.com'] >> breaches = [HIBP.get_domain_breaches(x) for x in domains] >> async_reqs = AsyncHIBP().imap(breaches) >> next(async_reqs) `

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

hibp-0.0.5.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hibp-0.0.5-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file hibp-0.0.5.tar.gz.

File metadata

  • Download URL: hibp-0.0.5.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hibp-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6f139a9c40ac8b4681e5250d88f74e200f3d1f0fdcf4c702f00a9303551882b7
MD5 eb511e0fe2727ced6b6a9fc14e97ff07
BLAKE2b-256 300916c2b4fd511e25ec747bfe5227f42e91ca2dcb698c1892634dda53f9f147

See more details on using hashes here.

File details

Details for the file hibp-0.0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for hibp-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d31f25b8b4034fb561aebec91e81eadae92d40afb59b4f562e9aed2318b71f23
MD5 cfd49d66ed3fef559e80bbd8f201468e
BLAKE2b-256 fd167d990a23b19325ad13945fed40d8a2453c0d2d923f4869793a62ab052485

See more details on using hashes here.

Supported by

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