Quick links:
- source repo: https://github.com/wjs018/pieforhead
- docs: https://wjs018.github.io/pieforhead
Recently, I have been working on a client meant to consume the PieFed API in addition to the work I have done on the PieFed codebase itself. To this end, I have made a python library to interact with the PieFed API.
In addition to the name, much of the big-picture organization of the code is inspired by the excellent pythorhead library that I have extensively used in the past to interact with the Lemmy API. So, hopefully using pieforhead won’t be a huge lift for python developers out there and they should be able to hit the ground running.
Some notable differences (other than base PieFed vs. Lemmy differences):
pieforheaduseshttpxto do network requests under the hood, specifically anhttpx.Client. This means that you benefit from some optimizations like connection pooling, but it means that the client should be closed when you are done with it. See the relevant docs page for more info/examples.asyncis fully supported thanks tohttpx. Instead of instantiating aPieFedobject, use aPieFedAsyncobject, and all the same functions are now async. See how this can be used on the examples page of the docs.
Feel free to let me know if you run into any issues!
wjs018@piefed.wjs018.xyz