Giter Club home page Giter Club logo

fish_text_ru's Introduction

Fish-text.ru python wrapper

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

Теперь с поддержкой асинхронности!

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

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

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

Установка

Установить стабильную версию с 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>

Как использовать асинхронные методы?

Точно так же как и обычные, только у асинхронных классов есть приставка Async в названии.
И не забывайте использовать await инструкцию перед запуском функций!

fish_text_ru's People

Contributors

deknowny avatar kiriharu avatar lulzlol231 avatar q60 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.