Skip to main content

PyWomboAPI

PyWomboAPI

PyWomboAPI is an unofficial Python library designed to generate images from Wombo's dream.ai. This library aims to make generating images easy and fast.

Please remember that this is a personal project I started to learn new things, so expect bugs!


Features

  • No API keys required: The API can automatically generate authentication tokens.
  • Simple and Intuitive: Easy methods for generating images.
  • Regular Updates: I try to maintain and keep the code working efficiently.

Installation

You can easily install PyWomboAPI via pip:

pip install PyWomboAPI

Usage

Here’s a quick example of how to use PyWomboAPI to make a request to the Wombo AI API:

import asyncio
import logging
from PyWomboAPI import WomboAPI

async def main() -> None:
    api = WomboAPI(log_level=logging.INFO)  # Set log level to INFO to see what's going on
    api.setup()  # Requesting all the necessary data
    image = await api.create_image(140, "flying car")  # Starting image generation
    print(image.url)

if __name__ == '__main__':
    asyncio.run(main())

This will generate an image:

2024-... - PyWomboAPI.init - INFO - API key not set, fetching it automatically...
2024-... - PyWomboAPI.init - INFO - Auth token not provided, generating one...
2024-... - PyWomboAPI.init - INFO - Credentials: Credentials(api_key='AIzaSyDCvp5MTJLUdtBYEKYWXJrlLzu1zuKM6Xw', auth_token='...')
2024-... - PyWomboAPI.generation - INFO - Constructed POST data for start_task request: {'is_premium': False, 'input_spec': {'aspect_ratio': 'old_vertical_ratio', 'prompt': 'flying car', 'style': 140, 'display_freq': 10}}
2024-... - PyWomboAPI.generation - INFO - Received task data: {'id': '87e7cd9d-af3a-4e71-93ce-58b31b072fb9', ...}
2024-... - PyWomboAPI.generation - INFO - Task 87e7cd9d-af3a-4e71-93ce-58b31b072fb9 completed successfully: https://images.wombo.art/generated/.../final.jpg?Expires=...&Signature=...&Key-Pair-Id=...

More examples can be found here.


To-Do List

  • Add Support for Proxies
  • Better Error Handling
  • Improve Documentation
  • Implement Tests

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for PyWomboAPI 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyWomboAPI 0.1.0
File Size Uploaded
pywomboapi-0.1.0.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyWomboAPI 0.1.0
File Interpreter ABI Platform
PyWomboAPI-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / pywomboapi-0.1.0.tar.gz

Download URL pywomboapi-0.1.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
46eb2e7b286173e2a6bfe52f765ee4f0ed6ac5a9a715804415de817ad5e1f998
BLAKE2b-256 checksum
How to use checksums
5bc14b7ca92e1b0da6de580e3717c34497a11114b7bcad3b29a5ac3562b1b66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.7

Release files / PyWomboAPI-0.1.0-py3-none-any.whl

Download URL PyWomboAPI-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87f9269e008970ff5c5b2808e38c9bbe0bddec860da24c1f2a6a8fd28e0a635b
BLAKE2b-256 checksum
How to use checksums
c80b9db3740406fbe0b6c8061eafd41ed6e3b9097ed80c03c0cba8b57a44246b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page