Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Api wrapper for

Project description

Api-wrapper for

.. image::
:alt: Build Status

.. image::
:alt: Coverage Status

.. image::
:alt: pypi version

.. image::
:alt: Codestyle: Black

Key Features
- response are fully-annotated with pydantic_
- test work on snapshots from real http-answers (can easy inspect responses)
- own OAuth2-server

.. _pydantic:

Getting started
Initiate Api client
.. code-block:: python

from coub_api import CoubApi

api = CoubApi()
access_token = "<your access token>"
api.authenticate(access_token) # required for some authenticated requests

Get coub details
.. code-block:: python

coub = api.coubs.get_coub("1jf5v1")
print(, coub.channel_id)

Create Coub
.. code-block:: python

api.coubs.init_upload()) # {"permalink":"1jik0b","id":93927327}
api.coubs.upload_video(93927327, "video.mp4")
api.coubs.upload_audio(93927327, "audio.mp3"))
api.coubs.finalize_upload(93927327, title="Awesome CAT", tags=["cat", "animal"]))
api.coubs.get_upload_status(93927327)) # {"done": False, "percent_done": 0}
# wait a minute
api.coubs.get_upload_status(93927327)) # {"done": True, "percent_done": 100}

Get weekly hot coubs
.. code-block:: python

from coub_api.schemas.constants import Period, order_by="likes_count")

Get 5 page of random section with cars
.. code-block:: python

from coub_api.schemas.constants import Section, Category

current_page = 1
max_page = 5
while current_page <= max_page:
response = api.timeline.section(section=Section.RANDOM, category=Category.CARS, page=current_page)
print(f"processing {current_page} of {max_page}")
for coub in response.coubs:
current_page += 1
max_page = min(max_page, response.total_pages)

How to use:
- Create Your Own_ application
- Run server
.. code-block:: RST


- Enter Your Application Id and Secret and grant access the Coub server.
- Copy access token and start use it!
.. _Own:

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
coub_api-0.1.2-py3-none-any.whl (53.3 kB) Copy SHA256 hash SHA256 Wheel py3
coub_api-0.1.2.tar.gz (14.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page