Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seven7ty/py-carbon

Fully asynchronous Python library for carbon.now.sh ✨🚀
https://github.com/seven7ty/py-carbon

aiohttp api async async-await asynchronous asyncio carbon http py-carbon python python-package python3

Last synced: 3 months ago
JSON representation

Fully asynchronous Python library for carbon.now.sh ✨🚀

Awesome Lists containing this project

README

        

# py-carbon [![Badge](https://img.shields.io/pypi/v/py-carbon?color=3776AB&logo=python&style=for-the-badge)](https://pypi.org/project/py-carbon/) [![Badge 2](https://img.shields.io/pypi/dm/py-carbon?color=3776AB&logo=python&style=for-the-badge)](https://pypi.org/project/py-carbon/)
Fully asynchronous Python library for [carbon.now.sh](https://carbon.now.sh)

## Installation
```
$ pip install py-carbon
```

## A quick example
In this example we'll create a carbon image and save it to disk.
```py
import carbon
import asyncio

code = """
defmodule Something do
def anything() do
IO.puts "Hello, World"
end
end
""" # Any kind of code-block in any language

async def main():
cb = carbon.Carbon() # Create a Carbon instance
opts = carbon.CarbonOptions(code=code) # Set the options for the image
image = await cb.generate(opts) # Generate the image
await image.save('hello') # Save the image in png format

asyncio.run(main())
```

And it'll output something like this:

Carbon Image

### Contributing
This package is opensource so anyone with adequate python experience can contribute to this project!

### Reporting Issues
If you find any error/bug/mistake with the package or in the code feel free to create an issue and report
it [here.](https://github.com/itsmewulf/py-carbon/issues)

### Fixing/Editing Content
If you want to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!

### Contact
If you want to contact me:
**Mail -** ```[email protected]```
**Discord -** [wulf](https://dsc.bio/wulf)