Skip to main content

Simple fish-text.ru python wrapper

Project description

Fish-text.ru python wrapper

Эта небольшая обёртка позволяет использовать API с сайта Fish-text.ru для генерации так называемого "текста-рыбы" или "рыботекста"

Тестировано на Python 3.8, 3.9.1

Примеры использования

  • В вашем проекте необходимо заполнить базу данных каким-то текстовым контентом
  • Собственно, наверное, это все ¯_(ツ)_/¯

Установка

Установить стабильную версию с PyPi:

python -m pip install fish_text_ru 

Установить с GitHub:

python -m pip install git+https://github.com/kiriharu/fish_text_ru

Использование

Json Wrapper (рекомендуется)

# Импортируем FishTextJson и TextType, нужный нам.
# В методе .get() вернется по итогу объект JsonAPIResponse
from fishtext import FishTextJson
from fishtext.types import TextType, JsonAPIResponse

# Делаем объект
api = FishTextJson(text_type=TextType.Title)
# Используем!
titles = api.get(1)

# Используем JsonAPIResponse
print(titles.status)
print(titles.errorCode)
print(titles.text)

Html wrapper

from fishtext import FishTextHtml
from fishtext.types import TextType

# Делаем объект
api = FishTextHtml(text_type=TextType.Title)
# Используем!
title = api.get(1)

print(title) # <p> какой-то там title </p>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fish_text_ru-2.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

fish_text_ru-2.0.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file fish_text_ru-2.0.2.tar.gz.

File metadata

  • Download URL: fish_text_ru-2.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Windows/10

File hashes

Hashes for fish_text_ru-2.0.2.tar.gz
Algorithm Hash digest
SHA256 a1e27186a4df872262e7e7060df20c13a49d80fc0c6fa5e336423aec89c1a405
MD5 ea4663b8912aad723d3c85f71b255bfe
BLAKE2b-256 ed3f11e0b6d521b31b047085e7928966ef9f9e8f8007899bf1282bef84c451e1

See more details on using hashes here.

File details

Details for the file fish_text_ru-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: fish_text_ru-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Windows/10

File hashes

Hashes for fish_text_ru-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69fac95e9bf6e7239b10fade2543caa7f609d4c3cfe7e9b098ced44ab18fbe75
MD5 8c1d7ba3c1132683404d95be444faa2e
BLAKE2b-256 d1b04bac662e5c84cc5c81945533b898a7cea0cf153a73e4b5d11552d0a19863

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page