An async wrapper for Gfycat API
Project description
Async Gfycat
An async Python wrapper for the Gfycat API.
based on py-gfycat a sync wrapper (api endpoints of py-gfycat are outdated as of 0.2.2)
Installation
pip install -U async-gfycat
Gfycat API Key
Go to https://developers.gfycat.com/signup/#/apiform and sign up for an API key if you don't already have one.
You need the Client ID and Client Secret to use for initializing the Python client.
Getting Started
from async_gfycat.client import GfycatClient
client = GfycatClient(clientid, secret)
# Example request
await client.upload_from_file('willsmith.gif', title='willsmith slap')
you can also use username and password authentication with
client = GfycatClient(clientid, secret, username, password)
Error Handling
- GfycatClientError - General error handler, access message and status code and the response dict with
from gfycat.error import GfycatClientError
from pprint import pprint
try
...
except GfycatClientError as e
print(e.error_message)
print(e.status_code)
pprint(e.response_data)
GfycatClient Class Methods
Uploads
upload_from_url(url)upload_from_file(filepath)
Warning: using
check_upload()immediately after uploading a file may result in a NotFoundo response, in that case waiting a moment will fix the issue, this is an api issue not a client one
Query a GFY for URLs and more information
query_gfy(gfyname)
Check if an upload has been converted
check_upload(link)
all methods return coros and need to be awaited
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file async-gfycat-1.0.2.tar.gz.
File metadata
- Download URL: async-gfycat-1.0.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d09cfb8d03d3d9426a3ba058e4acf9386b557bb000f3c2f11f516aff9bed22f1
|
|
| MD5 |
6b6de2a007b2f46ebb4cbf46808f99f8
|
|
| BLAKE2b-256 |
8fbf28856e120f9c37c6b350481c23199e231d07029144a49fc2efe44ded3164
|
File details
Details for the file async_gfycat-1.0.2-py3-none-any.whl.
File metadata
- Download URL: async_gfycat-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e60aba2f1a14ba5c9525525ac49634497f7ed6d9f5019d925c6332016cfbc2
|
|
| MD5 |
6b977a00436ef528a6860bd38a0d11f2
|
|
| BLAKE2b-256 |
22e0547bf37d376ef4ff7c4892cdb54d01708041cb1d1a5e09ec7f694d0a1f32
|