Forismatic 
An unoficall library for getting quotes from the Forismatic API. Supports asynchronous syntax.
Неофицальная библиотека для получения цитат из Forismatic API. Поддерживает асинхронный синтаксис.
Installing || Установка
pip3 install asyncforismatic
Requires aiohttp and requests
Examples || Примеры
import asyncforismatic
import asyncio
# getting sync quote on russian as dict
# синхронное получение цитаты на русском в виде словаря
print(asyncforismatic.quote(lang='ru', as_dict=True))
# getting async quote with default params (english language and formated quote)
# асинхронное получение цитаты со стандартными параметрами (английский язык и отформатированная цитата)
async def example():
return await asyncforismatic.asyncforismatic()
print(asyncio.run(example()))
Methods || Методы
Getting a quote (async) || Получение цитаты (асинхронно)
corotinue asyncforismatic(lang='en', *, as_dict=False)
- Returns an quote from Forismatic API
- Возвращает цитату из Forismatic API
Parameters || Параметры
as_dict: bool
- If True, quote returns as JSON-like object (dict)
- Если True, возвращает результат в JSON'о подобном формате (dict, словарь)
Raises exceptions || Поднимает исключения
TypeError
- The language is not passed as 'str'
- Язык передан не как 'str'
LangIsNotSupported
- The language is not supported
- Язык не поддерживается
Returns Union[str, dict]
ВозвращаетUnion[str, dict]
Getting a quote || Получение цитаты
def quote(lang='en', *, as_dict=False)
- Returns an quote from Forismatic API
- Возвращает цитату из Forismatic API
Parameters || Параметры
as_dict: bool
- If True, quote returns as JSON-like object (dict)
- Если True, возвращает результат в JSON'о подобном формате (dict, словарь)
Raises exceptions || Поднимает исключения
TypeError
- The language is not passed as 'str'
- Язык передан не как 'str'
LangIsNotSupported
- The language is not supported
- Язык не поддерживается
Returns Union[str, dict]
Возвращает Union[str, dict]
Exceptions || Исключения
LangIsNotSupported
- Raises when the language is not supported
- Возникает когда язык не поддерживается
Metadata
Release files for asyncforismatic 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asyncforismatic-0.0.1.tar.gz | 3.8 kB | Details |
Release files / asyncforismatic-0.0.1.tar.gz
| Download URL | asyncforismatic-0.0.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c3e5811b3855d2c7ece120eb09c61ee42fee384a22ae4f2adecb7535cdf5235
|
|
BLAKE2b-256 checksum How to use checksums |
02f4e29f4a38aadd8f0cc31724c6a160b66a605a6301aca3b1e1ce7b358bbaa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
|