Merge Changes (#2)
* finalizing example - added raw_ouput example * updated lib to 0.1.0 - added tests and build checks
This commit is contained in:
parent
4ac83bd497
commit
da6c0270ea
3
Makefile
3
Makefile
|
@ -1,8 +1,9 @@
|
|||
install:
|
||||
@python3 setup.py install --user
|
||||
|
||||
build:
|
||||
release:
|
||||
@python3 setup.py sdist
|
||||
@python3 setup.py sdist bdist_wheel
|
||||
|
||||
upload:
|
||||
@twine upload dist/*
|
||||
|
|
|
@ -5,7 +5,7 @@ This library handles All Requests done to https://api.intellivoid.net/spamprotec
|
|||
## Getting Started
|
||||
- Installing the library:
|
||||
|
||||
`pip install git+https://github.com/OpenRestfulAPI/intellivoid-spam-protection`
|
||||
`pip install Intellivoid-SPB`
|
||||
|
||||
- For those who wants to try out Development Builds:
|
||||
|
||||
|
|
2
docs.md
2
docs.md
|
@ -5,7 +5,7 @@ This library handles All Requests done to https://api.intellivoid.net/spamprotec
|
|||
## ✨ Getting Started
|
||||
- Installing the library:
|
||||
|
||||
`pip install git+https://github.com/OpenRestfulAPI/intellivoid-spam-protection`
|
||||
`pip install Intellivoid-SPB`
|
||||
|
||||
- For those who wants to try out Development Builds:
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from spamprotection.sync import SPBClient
|
||||
from spamprotection.types import Blacklist
|
||||
|
||||
# initializing the client
|
||||
client = SPBClient()
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
from spamprotection import SPBClient as AsyncClient
|
||||
from spamprotection.sync import SPBClient as SyncClient
|
||||
from spamprotection.types import Blacklist
|
||||
import asyncio
|
||||
import logging
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
async def async_types_check():
|
||||
return AsyncClient()
|
||||
|
||||
|
||||
async def async_raw_check():
|
||||
return AsyncClient()
|
||||
|
||||
|
||||
def sync_types_check():
|
||||
return SyncClient()
|
||||
|
||||
|
||||
def sync_raw_check():
|
||||
return SyncClient()
|
||||
|
||||
|
||||
def types_check():
|
||||
return Blacklist
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(async_types_check())
|
||||
asyncio.run(async_raw_check())
|
||||
sync_types_check()
|
||||
sync_raw_check()
|
|
@ -1,4 +1,4 @@
|
|||
"""Initial Directory."""
|
||||
from .client import SPBClient # noqa: F401
|
||||
|
||||
__version__ = "0.0.4"
|
||||
__version__ = "0.1.0"
|
||||
|
|
|
@ -12,13 +12,19 @@ class SPBClient:
|
|||
*,
|
||||
host: str = "https://api.intellivoid.net/spamprotection/v1/lookup"
|
||||
) -> None:
|
||||
"""
|
||||
[SPBClient]
|
||||
|
||||
Args:
|
||||
host (str): [current spam protection lookup endpoint].
|
||||
"""
|
||||
self._host = host
|
||||
|
||||
async def do_request(
|
||||
self,
|
||||
user_id: str,
|
||||
):
|
||||
"""[Requests to the url]
|
||||
"""
|
||||
[Requests to the url]
|
||||
|
||||
Args:
|
||||
user_id (str): [username or user_id can be passed into the arg]
|
||||
|
@ -37,7 +43,8 @@ class SPBClient:
|
|||
self,
|
||||
user_id: Union[int, str]
|
||||
):
|
||||
"""[raw json output]
|
||||
"""
|
||||
[raw json output]
|
||||
|
||||
Args:
|
||||
user_id (Union[int, str]): [can pass user_id or username]
|
||||
|
@ -55,7 +62,8 @@ class SPBClient:
|
|||
self,
|
||||
user_id: Union[int, str]
|
||||
) -> Union[Blacklist, bool]:
|
||||
"""[checks spb for blacklist]
|
||||
"""
|
||||
[checks spb for blacklist]
|
||||
|
||||
Args:
|
||||
user_id (Union[int, str]): [can pass user_id or username]
|
||||
|
|
|
@ -13,6 +13,12 @@ class SPBClient:
|
|||
*,
|
||||
host: str = "https://api.intellivoid.net/spamprotection/v1/lookup"
|
||||
) -> None:
|
||||
"""
|
||||
[SPBClient]
|
||||
|
||||
Args:
|
||||
host (str): [current spam protection lookup endpoint].
|
||||
"""
|
||||
self._host = host
|
||||
|
||||
def do_request(
|
||||
|
|
Loading…
Reference in New Issue