Archive
pytumblr with Python 3 support
Problem
I wanted to use the pytumblr library from Python 3 but this library is Python 2 only :( And the repo is quite abandoned. Someone asked Python 3 support more than a year ago and nothing happened.
Solution
As I had a large Python 3 project and I wanted to integrate Tumblr support in it, I decided to modify the library to support Python 3. The result is here: https://github.com/jabbalaci/pytumblr . I only needed to upload photos, so I worked on that part only. But with this version you can upload photos to Tumblr under Python 3.
Upload your first project to PyPI
Today I uploaded my jabbapylib project to PyPI, available here.
For preparing my first public pypi project, I followed this tutorial. For understanding how to package a Python library, read Mark Pilgrim’s corresponding book chapter.
I only want to add the following remarks:
- In
setup.py, I import “fromsetuptoolsimport setup, find_packages“. Noticesetuptoolsinstead ofdistutils.core. - In the prepared package I wanted to include the library
jabbapylib/recursively since all the source codes are there. I could do that with this line: “packages = find_packages(exclude=['demos', 'dist', 'tests'])“, i.e. include all subdirectories with the exception of the ones in the list. What remains in my case is the “jabbapylib” folder. - My library has some dependencies, they are specified here: “
install_requires=['html5lib', 'psutil', 'pytest']“. When jabbapylib is installed with pip, pip will install these packages too. - You can create your own
MANIFEST.infile to specify what to include and what to exclude. However, if you want to add the directory that contains all the sources, do as indicated in step (2). - For checking, packaging and uploading I made some simple scripts.
jabbapylib, a lightweight Python library
Update (20120125): jabbapylib is pushed to PyPI, thus it can be installed via pip: “sudo pip install jabbapylib“. For more info see the README file.
———-
I am proud to announce my first Python library called “jabbapylib” (available here).
In this library I collect functions that I use often in my projects. Instead of repeating them in each project, I’ve decided to group them in a library. Thus, this library falls in the “miscellaneous” category, i.e. it’s not specific to a given problem.
It’s in an early stage, so over time it’ll change a lot, I think. I plan to extend it in the near future.
For installation instructions, see the README file (at the bottom of the page). The source files are documented and at the bottom of each source you can find some examples. Feedbacks are welcome.
Only tested on Linux!
Update (20110907)
I’ve made another project called JabbaPyLib-in-Action. In this I will group smaller projects that use jabbapylib. If you want to see how to use jabbapylib in practice, check out JabbaPyLib-in-Action.
