Skip to main content

Python-оболочка для API Anixart

Project description

AnixartPy

Python-оболочка для работы с API Anixart (версия 9.0+)

PyPI License: MIT

[!WARNING]
Проект разработан в ознакомительных целях.
Аутентификационные роуты скрыты - работа возможна только с пользовательским токеном.

🔥 Возможности

  • Создание, удаление, оценивание и редактирование статей
  • Управление своими каналами и их участниками

📦 Установка

pip install anixartpy

🚀 Быстрый старт

from anixartpy import AnixartAPI, ArticleBuilder, Style, enums

# Инициализируйте API с помощью своего токена (None, чтобы получать данные в качестве гостя)
api = AnixartAPI(token="your_token_here")

# Создайте конструктор статей
builder = ArticleBuilder(channel_id=123)\
    .add_header("Заголовок статьи")\
    .add_paragraph(f"Это {Style.underline('подчёркнутый')} текст.")\
    .add_quote("Это цитата", caption="Автор", alignment=enums.QuoteAlignment.CENTER)\
    .add_delimiter()\
    .add_list(["Элемент списка 1", "Элемент списка 2", "Элемент списка 3"], ordered=True)\
    .add_media(["path/to/image.jpg", "https://example.com/image.png", open("path/to/image.jpg", "rb").read()])\
    .add_embed("https://example.com")

# Создайте статью
article = api.create_article(channel_id=123, article_data=article_data)

# Получите комментарии к этой записи
for comment in api.get_article(19735).get_comments(enums.Sorting.NEW, page=None):
    # page: None - все страницы с нуля, range(0, 5) - с 0 до 4 страницы включительно, 0 - только 1 страницу
    print(comment.profile.login, comment.message, sep=' - ')

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

anixartpy-0.3.4.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anixartpy-0.3.4-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file anixartpy-0.3.4.tar.gz.

File metadata

  • Download URL: anixartpy-0.3.4.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for anixartpy-0.3.4.tar.gz
Algorithm Hash digest
SHA256 9795c54ce8d4e246c95d0e124b7d160cb4716dfa312b7815f845f849c6bc31c8
MD5 cbe6ff510a747f0e63be16e957dfef4c
BLAKE2b-256 f64fdc184ad3fadc7c073be593ec23cc7aee59c18c7394691e9e550d1f466efe

See more details on using hashes here.

File details

Details for the file anixartpy-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: anixartpy-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.6

File hashes

Hashes for anixartpy-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f294a235ebde4b309efd0ff6f98fd534f99affd7ac4f9fb8502b359161ec4bad
MD5 29ae35438f39e239282bedbd923c7702
BLAKE2b-256 c28747ad630fb5d681030ab1d76af4720edf4f471bfb7e4723f0476781da230b

See more details on using hashes here.

Supported by

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