Unofficial Ptyhon Bindings for Computerender#

PyPI Status Python Version License

Read the documentation at https://computerender.readthedocs.io/ Tests Codecov

pre-commit Black

Features#

  • TODO

Requirements#

  • TODO

Installation#

You can install Computerender via pip from PyPI:

$ pip install computerender

Usage#

It is recommended to set the COMPUTERENDER_KEY environmental variable to your API key.

Otherwise, you can pass it to the Computerender class as api_key.

Basic usage of asynchronous client.

import asyncio

from computerender import Computerender


async def main():

    async with Computerender() as api:
        data: bytes = api.generate("A cowboy wearing a pink hat", width=512, height=512, guidance=7.5, seed=8675309)

    with open("a-cowboy-wearing-a-pink-hat.jpg", "wb") as f:
        f.write(data)


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

There is a synchronous client which is a thin wrapper around the async client using asyncio.run.

from computerender.sync import generate_sync as generate


def main():
    data: bytes = generate("A cowboy wearing a pink hat", width=512, height=512, guidance=7.5, seed=8675309)

    with open("a-cowboy-wearing-a-pink-hat.jpg", "wb") as f:
        f.write(data)


if __name__ == "__main__":
    main()

Contributing#

Contributions are very welcome. To learn more, see the Contributor Guide.

License#

Distributed under the terms of the MIT license, this python binding for Computerender is free and open source software.

Issues#

If you encounter any problems, please file an issue along with a detailed description.

Credits#

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.