Skip to main content

Python wrapper for the CGHMC API (Frinkiac, Morbotron, Master Of All Science and more!)

Project description

Internet King Popup Banner by BLUEamnesiac

CompuGlobal

https://img.shields.io/pypi/v/compuglobal.svg https://img.shields.io/pypi/pyversions/compuglobal.svg https://img.shields.io/badge/PRs-welcome-brightgreen.svg

Python wrapper for all endpoints of the following undocumented APIs:

Frinkiac, Morbotron, Master Of All Science, Capital Beat Us and Good God Lemon

Note: I’ll be keeping the wrapper up to date as more APIs are released.

CompuGlobal allows for both random and searchable screencaps, images and gifs embedded with default or custom captions for the following shows:

The Simpsons, Futurama, Rick and Morty, West Wing and 30 Rock.

Make sure to acquaint yourself with the API using the documentation.

Installation

To install the library, you can just run the following command:

python3 -m pip install -U compuglobal

Basic Usage

import compuglobal

simpsons = compuglobal.Frinkiac()

# Random
screencap = simpsons.get_random_screencap()

# Search
screencap = simpsons.search_for_screencap('nothing at all')

# Images/Gifs
image = screencap.get_meme_url()
gif = screencap.get_gif_url()

For documented examples, check here.

Async Usage

import asyncio

import compuglobal


async def main():
    simpsons = compuglobal.aio.Frinkiac()

    # Random
    screencap = await simpsons.get_random_screencap()

    # Search
    screencap = await simpsons.search_for_screencap('nothing at all')

    # Images/Gifs
    image = screencap.get_meme_url()
    gif = await screencap.get_gif_url()

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

For documented examples, check here.

What’s New

0.2.7 - Breaking changes

These changes are intended to provide more flexibility in the formatting of captions:

  • Added format_caption() method to CompuGlobalAPI objects. This replaces the formatting logic previously within the encode_caption() method. The encode_caption() method now only takes a caption parameter.

  • Captions will no longer be formatted and shortened before generation of memes, gifs, and mp4 urls if a caption is given. Behaviour remains the same if no caption is given or if format_caption() is used on the caption beforehand.

0.2.1 - Breaking Changes

  • Added Frame object: search(), get_frames() and get_nearby_frames() now all return a list of Frame objects instead of the json response.

Preview

https://frinkiac.com/gif/S11E10/315560/322560.gif?b64lines=IFdFTEwsIElUIEFMTE9XUyBGT1IKIE1BWElNVU0gTU9CSUxJVFkuCiBGRUVMUyBMSUtFIEknTSBXRUFSSU5HCiBOT1RISU5HIEFUIEFMTC4=

Credits

Creators and contributors of Frinkiac, Morbotron, Master of All Science, Good God Lemon and Capital Beat Us:

BLUEamnesiac for the Internet King Popup Banner

Named CompuGlobal as shorthand for CompuGlobalHyperMegaCap, as the family of websites are named.

Project details


Download files

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

Source Distribution

compuglobal-0.2.7.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

compuglobal-0.2.7-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file compuglobal-0.2.7.tar.gz.

File metadata

  • Download URL: compuglobal-0.2.7.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for compuglobal-0.2.7.tar.gz
Algorithm Hash digest
SHA256 734de21e6e9ca0d4926923f01f91dc70688df64f4418c41f8a72f76bf8597f1c
MD5 f50b677cb2c2272f0a7871ef95168784
BLAKE2b-256 93674167efe7a317b0a2d03cfd3aa1d23a1ea9117c8b38d4784f2db598fcc0b5

See more details on using hashes here.

File details

Details for the file compuglobal-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: compuglobal-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for compuglobal-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0c4352d8802a5af9b0396db08fa5b09316efaf56a42a3cb52df8f1a88acbf94d
MD5 aede43e77367e414e72438f9d1aa400c
BLAKE2b-256 c792d534aa9c5f0a40a58d2d287cac26ea1f0d8ad6e3327a983e995ca440c2ad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page