Skip to main content

A simpler wrapper around qoi (https://github.com/phoboslab/qoi)

Project description

QOI

A simple Python wrapper around qoi, the "Quite OK Image" format.

Install

pip install qoi

Developing

Clone

git clone --recursive https://github.com/kodonnell/qoi/

Dev

USE_CYTHON=1 pip install -e .[dev]
# Make your changes, and ensure you re-run the above if it's to the cython files ...

Test

pytest .

Build and publish

We're using setuptools_scm for versioning which basically means, once you're happy with your code and it's passing tests:

git commit -a -m "..., ready for release!"
git tag "vX.X.X"
rm -rf ./dist
USE_CYTHON=1 python -m build --sdist
python -m twine upload  repository testpypi dist/*

NB: in future we'll have this automated as part of a Github Action etc.

TODO:

  • Add build/publish pipeline (inc. running tests) and wheels via cibuildwheel.
  • Create a qoi CLI
  • Add some benchmarks and compare with qoi
  • Add example usage to README
  • More tests!
  • Allow Path as argument for filename.
  • Why does write fail without a .qoi extension? If that's valid, raise a proper exception in Python so users know what's goin on.
  • Return the colorspace in read/decode.

Discussion

Wrap or rewrite?

For now, this is just a simple wrapper. We'll leave the original project to do all the hard work on performance etc., and also maintaining (or not) compatibility or adding new features etc. We make no claims to do any more than that - we're basically just porting that C functionality to (C)Python.

On the name

For now, let's rock with qoi because

  • We're already in python, and the py in pyqoi seems redundant. For what it's worth, 3 < 5.
  • pyqoi seems like a good name for a python-only version of QOI (useful for pypy etc.), which this isn't.
  • qoi is generally new so let's not overthink it for now. We can always rename later if needed.

What's up with ./src?!

See here. I didn't read all of it, but yeh, import qoi is annoying when there's also a folder called qoi.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qoi-0.0.2.tar.gz (64.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page