Skip to main content

dfb-cat-async

Удобная и быстрая асинхронная библиотека для автоматического получения ссылок и загрузки изображений котиков. Создана специально для асинхронных фреймворков (aiogram, FastAPI, discord.py).

Установка

Вы можете установить библиотеку напрямую из PyPI:

pip install dfb-cat-async

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

Для работы библиотеки необходимо передавать активный объект aiohttp.ClientSession в функции и методы.

Пример работы в асинхронном скрипте:

import asyncio
import cv2 as cv
import aiohttp
import dfb_cat_async

async def main():
    # Создаем одну сессию для всех сетевых запросов
    async with aiohttp.ClientSession() as session:
        # Получаем объекты котиков (например, 3 штуки)
        urls_list = await dfb_cat_async.get_cat_url(session, count=3)

        if urls_list:
            for cat_number, cat_object in enumerate(urls_list):
                # Скачиваем изображение асинхронно
                if await cat_object.download(session):
                    # Отображаем графическое окно OpenCV
                    cv.imshow(f"Cat_#{cat_number + 1}", cat_object.image)

            print("Нажмите любую клавишу в окне изображения для выхода...")
            cv.waitKey(0)
            cv.destroyAllWindows()
        else:
            print("Не удалось получить котиков. Проверьте сеть.")

if __name__ == "__main__":
    asyncio.run(main())

Metadata

Release files for dfb-cat-async 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 dfb-cat-async 0.1.0
File Size Uploaded Provenance Actions
dfb_cat_async-0.1.0.tar.gz 2.3 kB Without provenance Details for dfb_cat_async-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dfb-cat-async 0.1.0
File Interpreter ABI Platform Actions
dfb_cat_async-0.1.0-py3-none-any.whl Python 3 none any Details for dfb_cat_async-0.1.0-py3-none-any.whl

Total release size: 4.1 kB

Release files / dfb_cat_async-0.1.0.tar.gz

Download URL dfb_cat_async-0.1.0.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
110ec0ec3c77b3b6a79a90f9b4982afdd2a087ca03a1e51b07fe0a7bc9a79fe9
BLAKE2b-256 checksum
How to use checksums
09cb7ef28c9fcb0d0861b71c4ffdb76d7a4875448c2c7ea79dc20f7ba2ea82be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / dfb_cat_async-0.1.0-py3-none-any.whl

Download URL dfb_cat_async-0.1.0-py3-none-any.whl
Size 1.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecec488af9eda4d476c4d593f8ac191bea2c8ae89c5bab3a1a45d734a237cf38
BLAKE2b-256 checksum
How to use checksums
dfbad464f5336ac878b83534c826bef373e9cf747d3fc09611affb5c3ffe5761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for dfb-cat-async 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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