Socket
Socket
Sign inDemoInstall

asyncforismatic

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    asyncforismatic

A library for getting quotes from the Forismatic API. Supports asynchronous syntax. Библиотека для получения цитат из Forismatic API. Поддерживает асинхронный синтаксис.


Maintainers
1

Readme

Forismatic forismatic_logo

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
  • Возникает когда язык не поддерживается

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc