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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f139a9c40ac8b4681e5250d88f74e200f3d1f0fdcf4c702f00a9303551882b7
|
|
| MD5 |
eb511e0fe2727ced6b6a9fc14e97ff07
|
|
| BLAKE2b-256 |
300916c2b4fd511e25ec747bfe5227f42e91ca2dcb698c1892634dda53f9f147
|
File details
Details for the file hibp-0.0.5-py2.py3-none-any.whl.
File metadata
- Download URL: hibp-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d31f25b8b4034fb561aebec91e81eadae92d40afb59b4f562e9aed2318b71f23
|
|
| MD5 |
cfd49d66ed3fef559e80bbd8f201468e
|
|
| BLAKE2b-256 |
fd167d990a23b19325ad13945fed40d8a2453c0d2d923f4869793a62ab052485
|