Skip to main content

conversations-about-important-api

Неофициальное API "разговоров о важном", на деле простой парсер.

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

  1. Устанавливаем библиотеку:
pip install conversations-about-important-api
  1. Запустите код ниже:
"""Пример взаимодествия с библиотекой."""  # noqa: RUF002

import datetime as dt

from conversations_about_important_api import CAIParser


def get_next_date() -> str:
    """Получаем ссылку для парсинга."""
    # Получаем текущую дату
    now = dt.datetime.now()  # noqa: DTZ005

    # Меняем дату на следующий понедельник
    now += dt.timedelta(days=7 - now.weekday())

    # Переводим дату в строку и возвращаем её
    return now.strftime("%d-%m-%Y")


if __name__ == "__main__":
    parser = CAIParser()
    data = parser.get_info(get_next_date())
    print(data)

Выдаёт такой ответ:

{
    "title": "Массовый спорт в России",
    "str_date": "10 марта 2025",
    "image_url": "https://разговорыоважном.рф/img/2025/10-03-2025.jpg",
    "plakat_url": "https://разговорыоважном.рф/10-03-2025/plakat.jpg",
    "videos_urls": [
        "https://разговорыоважном.рф/10-03-2025/1.mp4",
        "https://разговорыоважном.рф/10-03-2025/2.mp4",
        "https://разговорыоважном.рф/10-03-2025/3.mp4",
        "https://разговорыоважном.рф/10-03-2025/4.mp4",
        "https://разговорыоважном.рф/10-03-2025/5.mp4"
    ]
}

Подробнее

  1. Создаём и активируем виртуальное окружение (venv):

Использование виртуального окружения (venv) является лучшей практикой.

python3 -m venv venv
. venv/bin/activate

ВАЖНО!

Вторая команда для Windows выглядит так:

venv\Scripts\activate.bat
  1. Устанавливаем библиотеку:
pip install conversations-about-important-api
  1. Далее используйте код из "Быстрого старта" 🤗

Made with ❤️ by iamlostshe.

Metadata

Release files for conversations-about-important-api 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conversations-about-important-api 0.1.0
File Size Uploaded
conversations_about_important_api-0.1.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for conversations-about-important-api 0.1.0
File Interpreter ABI Platform
conversations_about_important_api-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 11.1 kB

Release files / conversations_about_important_api-0.1.0.tar.gz

Download URL conversations_about_important_api-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6581fc836f4a6f10bad755a443a3784a33e913857ddd99efa6af1ef769684f03
BLAKE2b-256 checksum
How to use checksums
579138975a94266c865c429bffc9986e0b32967a4a5296a7037e85629f7fe41e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.2

Release files / conversations_about_important_api-0.1.0-py2.py3-none-any.whl

Download URL conversations_about_important_api-0.1.0-py2.py3-none-any.whl
Size 5.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a3b597ee697c25c3043b5bb1953fed845e6d5276cad6652faf7e45f716d2a8d8
BLAKE2b-256 checksum
How to use checksums
be89ef04ebbd62b4da9e966904f9aa6d885950aee83179693f18d613c799bf40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page