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:
ポキ 2021-01-03 06:11:09 +05:00 committed by GitHub
parent 4ac83bd497
commit da6c0270ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 56 additions and 9 deletions

View File

@ -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/*

View File

@ -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:

View File

@ -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:

View File

@ -1,5 +1,4 @@
from spamprotection.sync import SPBClient
from spamprotection.types import Blacklist
# initializing the client
client = SPBClient()

33
manage.py Normal file
View File

@ -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()

View File

@ -1,4 +1,4 @@
"""Initial Directory."""
from .client import SPBClient # noqa: F401
__version__ = "0.0.4"
__version__ = "0.1.0"

View File

@ -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]

View File

@ -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(