rsgalloway / instapaper Goto Github PK
View Code? Open in Web Editor NEWInstapaper Python API
Instapaper Python API
Hey @rsgalloway,
This is unrelated to the project work present here, but, the latest version available for instapaper in PYPI is 0.2
, which looks older.
It would be great if you publish 0.3
on PYPI -- assuming there have been fixes/improvements since 0.2
.
Consider the following example program:
import instapaper
api = instapaper.Instapaper(oauthkey=OAUTHKEY, oauthsec=OAUTHSEC)
api.login(username=USERNAME, password=PASSWORD)
bookmarks = api.bookmarks(folder='unread')
b = bookmarks[0]
b.text
When run, this prints an AttributeError
to the console:
$ python3 demo.py
Traceback (most recent call last):
File "/private/tmp/ip/lib/python3.5/site-packages/instapaper.py", line 114, in dehtml
text = text.decode('UTF-8')
AttributeError: 'str' object has no attribute 'decode'
It would be better if the module coped with this case more gracefully – I think it would be enough to replace text = text.decode('UTF-8')
with
try:
text = text.decode('UTF-8')
except AttributeError:
pass
but I haven’t tried it properly.
(Also, printing a traceback rather than throwing the exception made this more frustrating to debug.)
Folder name is much more convenient.
There hasn't been a github release since 2016, but a lot of changes have been updated since then. I also noted the discrepancy in releases in github vs PyPi
Wouldn't it be better to set up an automated integration with Jenkins to be able to update the package directly from github?
Hi @rsgalloway -- I appreciate you might not have time/energy for the project, would you perhaps consider transferring the repository to me for maintenance? Or giving me maintainer permissions, whatever you prefer :)
I have a fork with a bunch of (hopefully useful changes) https://github.com/karlicoss/instapaper -- me and some other people are using it for HPI project https://github.com/karlicoss/HPI
I'm happy to setup continuous integration and releases to PyPi as well -- I do it for numerous of other projects #14
Currently I'm just hacking it via setting _API_VERSION_ = "api/1.1"
in my script.
It might require some extra effort, e.g. bookmarks API method is now returning dictionary instead of list, so bookmarks
method will need fixing.
I was using bookmarks_raw
method that I added in #10 , so that's not a problem for me, but leaving it here in case other people are wondering. I'll keep updated if I discover which other methods need to be fixed too.
https://github.com/wndhydrnt/python-oauth2 -- it's been archived, and hasn't had any changes for almost 10 years now. In addition it doesn't work with python3.12 because of distutils
A better modern alternative is probably requests-oauthlib
If I try to install this library from PyPI, there are two annoying problems that are fixed on master:
oauth2
dependency isn’t installed by defaultI can pip install
from the Git repo, but it would be nicer if I could install from a (fixed, stable) version on PyPI instead. Please could you cut a new release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.