-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
391625c
commit eba524f
Showing
5 changed files
with
74 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include hibpwned/py.typed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,15 @@ | |
import hashlib | ||
import requests | ||
|
||
ReturnAlias = int | list[dict[str, str | int | bool]] | ||
|
||
AltReturnAlias = int | list[dict[str, str | int | bool]] | list[str] | ||
|
||
DataAlias = list[dict[str, str | int | bool]] | dict[str, str | int | bool] | ||
|
||
AltDataAlias = (list[dict[str, str | int | bool]] | ||
| dict[str, str | int | bool] | list[str]) | ||
|
||
|
||
def _check(resp: requests.models.Response) -> None: | ||
"""Helper function to check the response code and prints anything | ||
|
@@ -196,15 +205,6 @@ class Pwned: | |
>>> foo = Pwned("[email protected]", "My_App", "My_API_Key") | ||
>>> data = foo.search_password("BadPassword") | ||
""" | ||
ReturnAlias = (int | list[dict[str, str | int | bool]]) | ||
|
||
AltReturnAlias = (int | list[dict[str, str | int | bool]] | list[str]) | ||
|
||
DataAlias = (list[dict[str, str | int | bool]] | ||
| dict[str, str | int | bool]) | ||
AltDataAlias = (list[dict[str, str | int | bool]] | ||
| dict[str, str | int | bool] | list[str]) | ||
|
||
url: str | ||
resp: requests.models.Response | ||
truncate_string: str | ||
|
@@ -229,7 +229,6 @@ def __init__(self, account: str, agent: str, key: str) -> None: | |
} | ||
self.timeout = 300 | ||
|
||
# pylint: disable=undefined-variable | ||
def search_all_breaches(self, | ||
truncate: bool | None = False, | ||
domain: str | None = None, | ||
|
@@ -296,7 +295,6 @@ def search_all_breaches(self, | |
return alt_data | ||
return resp.status_code | ||
|
||
# pylint: disable=undefined-variable | ||
def all_breaches(self, domain: str | None = None) -> ReturnAlias: | ||
"""Retrieves all breached sites from the system. The result set | ||
can also be filtered by domain by passing the argument | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
"""__init__.pyi""" | ||
|
||
from __future__ import annotations | ||
import requests | ||
|
||
ReturnAlias = int | list[dict[str, str | int | bool]] | ||
|
||
AltReturnAlias = int | list[dict[str, str | int | bool]] | list[str] | ||
|
||
DataAlias = list[dict[str, str | int | bool]] | dict[str, str | int | bool] | ||
|
||
AltDataAlias = (list[dict[str, str | int | bool]] | ||
| dict[str, str | int | bool] | list[str]) | ||
|
||
|
||
def _check(resp: requests.models.Response) -> None: | ||
... | ||
|
||
|
||
class Pwned: | ||
|
||
url: str | ||
resp: requests.models.Response | ||
truncate_string: str | ||
domain_string: str | ||
unverified_string: str | ||
classes: list[str] | ||
hashes: str | ||
hash_list: list[str] | ||
hexdig: str | ||
hsh: str | ||
pnum: str | ||
data: DataAlias | ||
alt_data: AltDataAlias | ||
|
||
def __init__(self, account: str, agent: str, key: str) -> None: | ||
... | ||
|
||
def search_all_breaches(self, | ||
truncate: bool | None = False, | ||
domain: str | None = None, | ||
unverified: bool | None = False) -> AltReturnAlias: | ||
... | ||
|
||
def all_breaches(self, domain: str | None = None) -> ReturnAlias: | ||
... | ||
|
||
def single_breach(self, name: str) -> ReturnAlias: | ||
... | ||
|
||
def data_classes(self) -> int | list[str]: | ||
... | ||
|
||
def search_pastes(self) -> ReturnAlias: | ||
... | ||
|
||
def search_password(self, password: str) -> int | str: | ||
... | ||
|
||
def search_hashes(self, hsh: str) -> int | str: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Marker file for PEP 561. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "hibpwned" | ||
version = "1.3.8" | ||
version = "1.3.9" | ||
authors = [ | ||
{ name="plasticuproject", email="[email protected]" }, | ||
] | ||
|
@@ -15,7 +15,7 @@ requires-python = ">=3.11" | |
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", | ||
"Operating System :: OS Independent", | ||
"Topic :: Utilities", "Topic :: Utilities" | ||
] | ||
|