Fully asynchronous Python library for carbon.now.sh
$ pip install py-carbon
In this example we'll create a carbon image and save it to disk.
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:
This package is opensource so anyone with adequate python experience can contribute to this project!
If you find any error/bug/mistake with the package or in the code feel free to create an issue and report it here.
If you want to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!
If you want to contact me:
Mail - paul@przybyszew.ski
Discord - wulf