diff --git a/README.md b/README.md index d78ce1d..46e84fc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Welcome to the unofficial intellivoid-spam-protection wiki! +# Welcome to the Python-Spam-Protection-API wiki! -This library handles All Requests done to https://api.intellivoid.net/spamprotection/v1/lookup. To understand how this is meant to be used, please see read the following [Documentation](https://github.com/OpenRestfulAPI/intellivoid-spam-protection/wiki) +This library handles All Requests done to https://api.intellivoid.net/spamprotection/v1/lookup. To understand how this is meant to be used, please see read the following [Documentation](https://github.com/intellivoid/Python-Spam-Protection-API/blob/master/docs.md) ## Getting Started - Installing the library: @@ -9,7 +9,7 @@ This library handles All Requests done to https://api.intellivoid.net/spamprotec - For those who wants to try out Development Builds: - `pip install git+https://github.com/OpenRestfulAPI/intellivoid-spam-protection@dev` + `pip install git+https://github.com/intellivoid/Python-Spam-Protection-API@dev` ## Usage @@ -35,4 +35,4 @@ if __name__ == "__main__": ## Examples -All Examples are in [Examples Directory](https://github.com/OpenRestfulAPI/intellivoid-spam-protection/tree/master/examples) \ No newline at end of file +All Examples are in [Examples Directory](https://github.com/intellivoid/Python-Spam-Protection-API/tree/master/examples) \ No newline at end of file diff --git a/TODO b/TODO deleted file mode 100644 index f4e7941..0000000 --- a/TODO +++ /dev/null @@ -1,3 +0,0 @@ -# raise a valid error at HostDownError -# Damn Docstrings -# understand why the heck it freazes on wrong user id or username on python3.7 diff --git a/docs.md b/docs.md index 900a28e..248cb71 100644 --- a/docs.md +++ b/docs.md @@ -1,15 +1,15 @@ -# 🎉 Welcome to the unofficial intellivoid-spam-protection wiki! +# 🎉 Welcome to the Python-Spam-Protection-API Documentation! -This library handles All Requests done to https://api.intellivoid.net/spamprotection/v1/lookup. To understand how this is meant to be used, please see read the following Documentation +This library handles All Requests done to https://api.intellivoid.net/spamprotection/v1/lookup. To understand how this is meant to be used, please read the following Documentation ## ✨ Getting Started - Installing the library: `pip install Intellivoid-SPB` -- For those who wants to try out Development Builds: +- Installing via source: - `pip install git+https://github.com/OpenRestfulAPI/intellivoid-spam-protection@dev` + `pip install git+https://github.com/intellivoid/Python-Spam-Protection-API` ## Methods Currently there are 2 methods that can be called from `SPBClient()` @@ -18,11 +18,11 @@ Currently there are 2 methods that can be called from `SPBClient()` - `check_blacklist()` - `user_id`: a `username` or `user_id` - `Returns`: [spamprotection.types.Blacklist](https://github.com/OpenRestfulAPI/intellivoid-spam-protection/blob/fa299feab04ab1a9e11480b6af25279ef395f020/spamprotection/types.py#L13) + `Returns`: [spamprotection.types.Blacklist](https://github.com/intellivoid/Python-Spam-Protection-API/blob/da6c0270ea30f51fc8737da9615bd80a4d6028b7/spamprotection/types.py#L13) _example_: ``` - from spamprotection.sync import SPBClient() + from spamprotection.sync import SPBClient client = SPBClient() status = client.check_blacklist("DeprecatedUser") @@ -36,7 +36,7 @@ Currently there are 2 methods that can be called from `SPBClient()` `Returns`: `[dict()]` - _example__: + _example_: ``` from spamprotection.sync import SPBClient() @@ -49,7 +49,7 @@ Currently there are 2 methods that can be called from `SPBClient()` ## Detailed Examples -All Detailed Examples are listed inside [Examples Directory](https://github.com/OpenRestfulAPI/intellivoid-spam-protection/tree/master/examples) +All Detailed Examples are listed inside [Examples Directory](https://github.com/intellivoid/Python-Spam-Protection-API/tree/master/examples) ## Development @@ -60,10 +60,6 @@ For those who wants to contribute or Develop the wrapper follow the instructions - Installation of `python3.6` or `python3.8` - Installation of `make`: `sudo apt install make` -- clone the github repository and switch to dev branch: `git clone https://github.com/OpenRestfulAPI/intellivoid-spam-protection && cd intellivoid-spam-protection && git checkout dev` +- clone the github repository and switch to dev branch: `git clone https://github.com/intellivoid/Python-Spam-Protection-API && cd Python-Spam-Protection-API` - setup a virtualenv and install requirements: `pip install requirements_dev.txt` -- 🎉 Finally you can test the changes in examples folder :D - - -## Note -This is an Unofficial wrapper made by an individual on Telegram. The person who owns and created this library has nothing to do with Intellivoid Company. +- 🎉 Finally you can test the changes in examples folder :D \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b88034e..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -description-file = README.md diff --git a/setup.py b/setup.py index d334153..f05f1f1 100644 --- a/setup.py +++ b/setup.py @@ -10,15 +10,15 @@ with open("requirements.txt") as f: setuptools.setup( - name="Intellivoid SPB", + name="Intellivoid Spamprotection", version=__version__, - description="Unofficial SPB API Wrapper", + description="Python Spamprotection API Wrapper", long_description=long_description, long_description_content_type="text/markdown", license="GNU Lesser General Public License v3 (LGPLv3)", author="Pokurt", author_email="poki@pokurt.me", - url="https://github.com/OpenRestfulAPI/intellivoid-spam-protection", + url="https://github.com/intellivoid/Python-Spam-Protection-API", packages=setuptools.find_packages(), classifiers=[ "Development Status :: 3 - Alpha", diff --git a/spamprotection/__init__.py b/spamprotection/__init__.py index bbf3f9c..561f776 100644 --- a/spamprotection/__init__.py +++ b/spamprotection/__init__.py @@ -1,4 +1,4 @@ """Initial Directory.""" from .client import SPBClient # noqa: F401 -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/spamprotection/client.py b/spamprotection/client.py index c30b44a..8374d5b 100644 --- a/spamprotection/client.py +++ b/spamprotection/client.py @@ -2,7 +2,7 @@ from json import JSONDecodeError from typing import Union import aiohttp -from .errors import UnknownError +from .errors import UnknownError, HostDownError from .types import Blacklist @@ -77,4 +77,4 @@ class SPBClient: except UnknownError: return False except aiohttp.client_exceptions.ClientConnectorError: - return "Api is down at the moment" + raise HostDownError("Api is down at the moment") diff --git a/spamprotection/sync.py b/spamprotection/sync.py index bf6866d..8a8ee3a 100644 --- a/spamprotection/sync.py +++ b/spamprotection/sync.py @@ -1,6 +1,6 @@ import requests -from .errors import UnknownError +from .errors import UnknownError, HostDownError from .types import Blacklist from json import JSONDecodeError @@ -74,3 +74,5 @@ class SPBClient: return Blacklist(**data) except UnknownError: return False + except requests.exceptions.ConnectionError: + raise HostDownError("Can not reach Endpoint at the moment")