Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 ✨🚀
- Host: GitHub
- URL: https://github.com/seven7ty/py-carbon
- Owner: seven7ty
- License: mit
- Created: 2021-05-29T20:18:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-08T22:00:33.000Z (over 1 year ago)
- Last Synced: 2024-10-10T00:57:12.517Z (3 months ago)
- Topics: aiohttp, api, async, async-await, asynchronous, asyncio, carbon, http, py-carbon, python, python-package, python3
- Language: Python
- Homepage: https://pypi.org/project/py-carbon
- Size: 157 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 asynciocode = """
defmodule Something do
def anything() do
IO.puts "Hello, World"
end
end
""" # Any kind of code-block in any languageasync 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 formatasyncio.run(main())
```And it'll output something like this:
### 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)