giphy package¶
Submodules¶
giphy.client module¶
- class giphy.client.GiphyClient(*, api_key: str, session: Optional[aiohttp.client.ClientSession] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None)[source]¶
Bases:
object- async connect()[source]¶
Opens the aiohttp.ClientSession(), thus allowing connections to the Giphy API
- async search(query: str, *, limit: Optional[int] = 25, offset: Optional[int] = 0, rating: Optional[giphy.types.AgeRating] = None, language: Optional[str] = None, user_proxy: Optional[str] = None) → giphy.models.GiphyResponse[source]¶
Searches the Giphy API.
- Parameters
query (str) – Search query term or phrase.
limit (Optional[int], optional) – The maximum number of objects to return, defaults to 25
offset (Optional[int], optional) – The maximum number of objects to return, defaults to 0
rating (Optional[AgeRating], optional) – Filters results by specified rating, defaults to None
language (Optional[str], optional) – Specify default language for regional content, defaults to None
user_proxy (Optional[str], optional) – An ID/proxy for a specific user, defaults to None
- Returns
A GiphyResponse object. Holds properties such as .media and .meta.
- Return type
- async trending(*, limit: Optional[int] = 25, offset: Optional[int] = 0, rating: Optional[giphy.types.AgeRating] = None, language: Optional[str] = None, user_proxy: Optional[str] = None) → giphy.models.GiphyResponse[source]¶
Fetches the trending GIF’s from Giphy.
- Parameters
limit (Optional[int], optional) – The maximum number of objects to return, defaults to 25
offset (Optional[int], optional) – The maximum number of objects to return, defaults to 0
rating (Optional[AgeRating], optional) – Filters results by specified rating, defaults to None
language (Optional[str], optional) – Specify default language for regional content, defaults to None
user_proxy (Optional[str], optional) – An ID/proxy for a specific user, defaults to None
- Returns
A GiphyResponse object. Holds properties such as .media and .meta.
- Return type
giphy.http module¶
- class giphy.http.HTTPClient(*, api_key: Optional[str] = None, session: Optional[aiohttp.client.ClientSession] = None)[source]¶
Bases:
object- async request(route: giphy.http.Route) → dict[source]¶
- class giphy.http.Route(endpoint: str, params: dict, method: str = 'GET', **kwargs)[source]¶
Bases:
object- BASE = 'https://api.giphy.com/v1'¶
giphy.models module¶
- class giphy.models.GiphyResponse(*, raw_payload: dict)[source]¶
Bases:
object
- class giphy.models.Media(*, data: dict)[source]¶
Bases:
object- property bitly_gif_url: str¶
Returns the bitly_gif_url property of the Media Object returned.
- Return type
str
- property bitly_url: str¶
Returns the bitly_url of the Media Object returned.
- Return type
str
- property embed_url: str¶
properties.
- Return type
str
- Type
Returns the embed_url. This url has embed og
- property id: str¶
SyBtFOwyGO4JW
- Return type
str
- Type
Returns the id of the Media Object. Example
- property rating: str¶
Returns the age rating of the Media Object.
- Return type
str
- property slug: str¶
Returns the slug of a Giphy URL. This is usually the suffix of a Giphy view page.
- Return type
str
- property title: str¶
Returns the title of the Media Object. Usually the name of the object.
- Return type
str
- property type: str¶
GIF (gif).
- Return type
str
- Type
Returns the type of Media. Example
- property url: str¶
Returns the URL of the Media Object.
- Return type
str
- class giphy.models.Meta(*, payload: dict)[source]¶
Bases:
object- property message: str¶
Returns the message linked to the status of the request.
- Return type
str
- property msg: str¶
Alias for message.
- Return type
str
- property response_id: str¶
Returns the response_id of the request.
- Return type
str
- property status: int¶
Returns the status code of the request.
- Return type
int
giphy.types module¶
- class giphy.types.AgeRating[source]¶
Bases:
objectView all the age ratings at: https://developers.giphy.com/docs/optional-settings/#rating