Python bindings to libpurple.
This is Flare's attempt at reviving python-purple. The library was forked from fahhem/python-purple, which was a short-lived fork of Anderson Briglia's original work.
Notable changes since then include:
- Moving to Python 3
- Adding tests
- (ongoing) Refactoring the API
- Type annotations for use with mypy.
- High-level PurpleClient for an easier-to-use API.
No API stability promises are made at this time. However, whatever is tested (see purple/tests) can be considered somewhat stable.
See simpleclient.py for usage examples.
python-purple tests use libpurple's null protocol. Your distro probably does not ship it by default. For guidance on how to build it yourself, take a look at .travis.yml.
test
: Run all tests.format
: Format the source code with black.run-simpleclient
: Run simpleclient from the virtualenv.
Here are some notes that may help you while working on python-purple. I found that some of these things are not entirely obvious so it may help to read them before getting started.
- Cast
char*
tobytes
safely usingcdef bytes py_variable = c_variable or None
- Use kwargs for all callbacks.
- Strings should be used instead of bytes wherever it makes sense.
- Good test coverage.
See CHANGELOG.md.