An unofficial Python library for generating images using Wombo.ai
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywomboapi-0.1.0.tar.gz.
File metadata
- Download URL: pywomboapi-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46eb2e7b286173e2a6bfe52f765ee4f0ed6ac5a9a715804415de817ad5e1f998
|
|
| MD5 |
ba3652026fe235c760dd36ff49a4e8d5
|
|
| BLAKE2b-256 |
5bc14b7ca92e1b0da6de580e3717c34497a11114b7bcad3b29a5ac3562b1b66e
|
File details
Details for the file PyWomboAPI-0.1.0-py3-none-any.whl.
File metadata
- Download URL: PyWomboAPI-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87f9269e008970ff5c5b2808e38c9bbe0bddec860da24c1f2a6a8fd28e0a635b
|
|
| MD5 |
078fe78addeaabd0b3a896298d41ba7a
|
|
| BLAKE2b-256 |
c80b9db3740406fbe0b6c8061eafd41ed6e3b9097ed80c03c0cba8b57a44246b
|