# `pwnedapi` (Have I Been Pwned)
[](https://app.codacy.com/project/nikoheikkila/pwnedapi/dashboard)
[](https://travis-ci.org/nikoheikkila/pwnedapi)
[](https://codecov.io/gh/nikoheikkila/pwnedapi)
[](https://pypi.org/project/pwnedapi/)
[](https://pypi.org/project/pwnedapi/)
[](https://pwnedapi.readthedocs.io/en/latest/)
[](LICENSE)
[](https://twitter.com/nikoheikkila)
A Python library to leverage **Troy Hunt's** [_Have I Been Pwned API v2_][hibp]
and the _k-Anonymity_ model. Inspired by **Phil Nash's** Ruby gem [_pwned_][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
```bash
# 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.

You can also scan a file of passwords, and export results in any format
supported by the [`tablib`][tablib] library.

## 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.
[hibp]: https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange
[pwned]: https://philnash.github.io/pwned/
[tablib]: http://docs.python-tablib.org/en/latest/
Raw data
{
"_id": null,
"home_page": "https://github.com/nikoheikkila/pwnedapi",
"name": "pwnedapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5.0",
"maintainer_email": "",
"keywords": "",
"author": "Niko Heikkil\u00e4",
"author_email": "yo@nikoheikkila.fi",
"download_url": "https://files.pythonhosted.org/packages/c8/d4/ad0929eee6e58a72c6353d9a599a4aa809b5e439dfcbe0602ebe8dd731b4/pwnedapi-1.0.2.tar.gz",
"platform": "",
"description": "\n# `pwnedapi` (Have I Been Pwned)\n\n[](https://app.codacy.com/project/nikoheikkila/pwnedapi/dashboard)\n[](https://travis-ci.org/nikoheikkila/pwnedapi)\n[](https://codecov.io/gh/nikoheikkila/pwnedapi)\n[](https://pypi.org/project/pwnedapi/)\n[](https://pypi.org/project/pwnedapi/)\n[](https://pwnedapi.readthedocs.io/en/latest/)\n[](LICENSE)\n[](https://twitter.com/nikoheikkila)\n\nA Python library to leverage **Troy Hunt's** [_Have I Been Pwned API v2_][hibp]\nand the _k-Anonymity_ model. Inspired by **Phil Nash's** Ruby gem [_pwned_][pwned].\n\n## Support\n\nThis library is supported on Python versions 3.5 and up. Some development packages\nrequire Python 3.6 or newer so issues regarding the development environment compatibility\nshould not be reported without first attempting to install newer version of Python.\n\n## Installation\n\n```bash\n# Option 1: From the PyPI repository\npip install pwnedapi\n\n# Option 2: For people of great taste\npipenv install pwnedapi\n\n# Option 3: Locally\ngit clone https://github.com/nikoheikkila/pwnedapi\ncd pwnedapi\npython setup.py install\n```\n\n## Usage\n\nIn its simplest form you'll only need to use two methods.\nWill probably add more if and when the API grows.\n\n\n\nYou can also scan a file of passwords, and export results in any format\nsupported by the [`tablib`][tablib] library.\n\n\n\n## CLI usage\n\nThe library also installs a command-line tool which you can use to check\nyour password from the comfort of your terminal. Run `pwned` to see all the possibilities.\n\n## Development\n\nClone the repository normally. Then run `make` to install the dependencies.\n\nWhile developing it's useful to ensure an acceptable code quality where the\nPylama linter is helpful: run `make lint` to check your code. Once you have\nwritten your tests run `make test` to invoke the PyTest suites.\n\nTo run tests and calculate the code coverage run `make coverage`. This command\nwill fail if you haven't set up a Codecov project with `$CODECOV_TOKEN`\nvariable.\n\nRemember to document your features and see that the documentation compiles\nsuccessfully by running `make docs`.\n\n## Contributing\n\nCheck the source code and issues from this repository, and should anything\ninteresting pop out feel free to open a pull request.\n\nBefore your changes will be merged make sure that Travis CI pipeline is green\nand code coverage is on acceptable level. GitHub takes care of these\neventually but to save time always consider running the tests locally before\npushing.\n\n[hibp]: https://haveibeenpwned.com/API/v2#SearchingPwnedPasswordsByRange\n[pwned]: https://philnash.github.io/pwned/\n[tablib]: http://docs.python-tablib.org/en/latest/\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Library for easily interfacing with Have I Been Pwned API v2.",
"version": "1.0.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "bf6f4c268d29401758130451b04eeb34",
"sha256": "3663236ce0f15f796b966a988e9fa1dab20c7e81955a5f3b86bd73adef90da93"
},
"downloads": -1,
"filename": "pwnedapi-1.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bf6f4c268d29401758130451b04eeb34",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.5.0",
"size": 7634,
"upload_time": "2019-07-01T16:30:23",
"upload_time_iso_8601": "2019-07-01T16:30:23.118474Z",
"url": "https://files.pythonhosted.org/packages/2b/3c/59364e23fc52e99a0f871e1509823c44d1075d6379ad813fe87eb6ec1b55/pwnedapi-1.0.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "139411203994f4d038f2eb1c3bf2aa26",
"sha256": "04bd60c9a0643c6b741775bdfe9c70b9433d44553cad623996569b1489e19537"
},
"downloads": -1,
"filename": "pwnedapi-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "139411203994f4d038f2eb1c3bf2aa26",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5.0",
"size": 6606,
"upload_time": "2019-07-01T16:30:24",
"upload_time_iso_8601": "2019-07-01T16:30:24.572025Z",
"url": "https://files.pythonhosted.org/packages/c8/d4/ad0929eee6e58a72c6353d9a599a4aa809b5e439dfcbe0602ebe8dd731b4/pwnedapi-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-07-01 16:30:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "nikoheikkila",
"github_project": "pwnedapi",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"lcname": "pwnedapi"
}