Skip to main content

A Python wrapper for the CoolText.com image generation API

Project description

CoolText

A small Python helper for generating images using CoolText's PostChange API. This repository wraps CoolText form options in a simple data model, posts the configuration to CoolText, and returns the rendered image URL.

Example

  • Result with logo id - 4618063429:

  • Result with logo id - 8:

  • Result with logo id - 2975689126:

  • Result with logo id - 829964308:

  • Result with logo id - 732453157:

  • Result with logo id - 1779834160:

...And Many More Are Here...

Features

  • Build payloads using a typed pydantic model.
  • Merge user-provided options with a logo's defaults from logo-id.json.
  • Manage HTTP requests and return the final render URL.

Requirements

  • Python 3.10+
  • See requirements.txt for exact package versions.

Installation

Install dependencies with pip:

python -m pip install -r requirements.txt

If you prefer a virtual environment:

python -m venv .venv
.
\venv\Scripts\activate   # Windows
python -m pip install -r requirements.txt

Quick Start

  1. Ensure logo-id.json is present in the repository root. This file maps LogoID values to their CoolText page links and default form values. The repository includes a generated logo-id.json (see logo-id.py for the scraper used to produce it).
  2. Edit main.py or create your own script using the library.

Example minimal usage (same logic as in main.py):

from modules import CoolText, PostChangeConfigOptions

config = PostChangeConfigOptions(LogoID="732440996", Text="Hello World")
print(CoolText(config).create())

Running the example:

python main.py

The script will print a URL where the rendered image can be downloaded.

Configuration and API details

  • PostChangeConfigOptions (defined in modules.py) exposes the familiar CoolText form fields: LogoID, Text, FontSize, FileFormat, BackgroundColor_color, and many optional color/boolean/integer fields. The model uses sensible defaults from constants.DefaultValues when values are not provided.
  • CoolText.create() workflow:
    • Loads the logo metadata and defaults from logo-id.json.
    • Fetches the CoolText logo page (to satisfy referer/session expectations).
    • Posts the combined payload to CoolText's /PostChange endpoint.
    • Parses and returns the render URL from the JSON response.

If the request fails or a response cannot be parsed, create() returns None and logs a message via the logging module.

How to find a LogoID

Just hop on to https://cool-text-thehritu.vercel.app for list of logos and their ids and other configs.

Development

  • Run the example locally (python main.py).
  • Add or modify PostChangeConfigOptions in modules.py if you need to support additional CoolText parameters.
  • Logging is used for error and debug messages; enable or configure the logging module in your own scripts as needed.

Files

Contributing

Contributions are welcome. Open an issue or submit a pull request with a clear description of the change.

License

This project does not include an explicit license file. Add a LICENSE if you wish to define reuse terms.

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

pycooltext_api-0.1.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycooltext_api-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pycooltext_api-0.1.0.tar.gz.

File metadata

  • Download URL: pycooltext_api-0.1.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for pycooltext_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dec90a7580842ab289a7150cc7295c598d57bcc2e1e968c6b38690fcb635ff30
MD5 be9405aa069e0719748cfe481e49c636
BLAKE2b-256 3b8b74c19d53afc5b8887437e83419b842f8fbd95384914bb0a7eb61f3a5532b

See more details on using hashes here.

File details

Details for the file pycooltext_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pycooltext_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for pycooltext_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc139b7f8cef8198ec65a94c9a6a5f90c8591f07b710104c568400f71eca8c45
MD5 9ecf3638987b6ce610628032a32cc590
BLAKE2b-256 f0e0953a3a6a4ac2af5ece8246989cd317589390e3cc0ec0e2366b95c7de6511

See more details on using hashes here.

Supported by

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