chafa
chafa copied to clipboard
Python bindings
This library looks great. I was wondering if there is a python package available that wraps this? Would be great to have picture previews directly in the python terminal!
That would be interesting. I used to call the chafa
binary program from os.system
in some of my python programs.
There are no Python bindings that I know of, but it'd be great to have. If you want get the ball rolling on this, I'll support it any way I can.
The C API is documented here: https://hpjansson.org/chafa/ref/
A first pass wouldn't have to cover everything, just enough to support a canvas and the most important options (like ChafaCanvasMode, ChafaPixelMode and geometry).
Here we go! GuardKenzie/chafa.py
I have been working on this during December and I think it's time for a proper release. You can also check out the homepage on chafapy.mage.black which includes instructions on getting started, some examples and a tutorial.
It is almost up to feature parity with Chafa, it is missing
- Emitting control sequences
- Adding, getting and using built in glyphs with symbol maps.
- Setting getting and emitting terminal sequences
- Using raw color in the canvas
@GuardKenzie Wow, I am completely blown away by this. Thank you so much!
How would you like to proceed -- I'm thinking we can close this issue now and collaborate in your repo/discussions?
Yeah, that sounds amazing!
Closing -- to be continued in https://github.com/GuardKenzie/chafa.py/discussions