Skip to main content

A Python wrapper for the CoolText.com image generation API

Project description

pycooltext-api

A Python wrapper for the CoolText.com image generation API. Build typed payloads, post to CoolText's /PostChange endpoint, and get back a rendered image URL — all in a few lines of code.

Installation

pip install pycooltext-api

Quick Start

from cooltext import CoolText, PostChangeConfigOptions

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

print(result)           # prints the image URL
result.download()       # saves the image locally

Browse Available Logos

Visit https://thehritu.github.io/CoolText/ to browse all available logo styles and their IDs.

Configuration

PostChangeConfigOptions accepts these fields:

Field Type Default Description
LogoID str required ID of the CoolText logo style
Text str "Cool Text" Text to render
FontSize str "70" Font size
FileFormat str "PNG" Output format
BackgroundColor_color str "FFFFFF" Background colour (hex)
Color1_color str None Primary text colour
Color2_color str None Secondary colour
Boolean1Boolean3 str None Logo-specific toggles
Integer1Integer14_color str None Logo-specific numeric options

CoolTextResult

CoolText.create() returns a CoolTextResult object:

result = CoolText(config).create()

str(result)                               # the image URL as a string
bool(result)                              # False if the request failed
result.download()                         # save to current directory
result.download("out.png")                # save to a specific path
result.download("out.png", stream=False)  # disable streaming

Finding a Logo ID

Go to https://thehritu.github.io/CoolText/ — every logo is listed with its ID and default configuration values.

Links

License

MIT © TheHritu

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.1.tar.gz (12.2 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.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycooltext_api-0.1.1.tar.gz
  • Upload date:
  • Size: 12.2 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.1.tar.gz
Algorithm Hash digest
SHA256 a2310308c13d80b7ed8c966ce63a3e26f3b9ca2be42fbdafea52bbdfc6a3f74a
MD5 4d9d82bb37e3069f3ba1ffb72b05e09f
BLAKE2b-256 80f31731bfa19367e2c019e34686c2eae5613312e863255fc57a119216872196

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycooltext_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52165270670859751fa930e05e94f761c55ec7a2ae354335e4071980a8431c45
MD5 7ff4c1cd526ff38ab3a8194a0ec50da2
BLAKE2b-256 04173ea16beda2714e85156b27f5ec2f8d197134f63ea2aff4151bcd5a23c609

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