/okaeri-sdk-python

Okaeri Services SDK for Python

Primary LanguagePythonMIT LicenseMIT

Okaeri SDK for Python (3.7+)

License Total lines Repo size pypi Contributors Discord

Currently supported services:

Full documentation available on wiki.okaeri.eu in:

Installation

pip install okaeri-sdk==1.*

Example usage

OK! AI.Censor

See full docs in: Polish, English

from okaeri_sdk import AiCensor
from okaeri_sdk.client import OkaeriError
from okaeri_sdk.aicensor import AiCensorError

try:
    aicensor = AiCensor("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
    prediction = aicensor.get_prediction("o cie k u r//w@!")
    swear = prediction.general.swear
    print(f"swear: {swear}")
except (OkaeriError, AiCensorError) as e:
    print(f"Error: {str(e)}")

OK! No.Proxy

See full docs in: Polish, English

from okaeri_sdk import NoProxy
from okaeri_sdk.client import OkaeriError
from okaeri_sdk.noproxy import NoProxyError

try:
    noproxy = NoProxy("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
    info = noproxy.get_info("1.1.1.1")
    proxy = info.risks.proxy
    verify = info.suggestions.verify
    block = info.suggestions.block
    print(f"proxy: {proxy}, verify: {verify}, block: {block}")
except (OkaeriError, NoProxyError) as e:
    print(f"Error: {str(e)}")