Apparently, there is no obvious choice for an OpenID library in Python 3. In Python 2 there's python-openid which — despite being an ugly over-engineered mess of a code — works and conforms to the spec. Unfortunately, the same can't be said about its independent port to Python3 python3-openid, which doesn't.

I am now in the process of converting this site to Python 3 and OpenID is one of the technologies that I depend on. So for the past few days I was considering two alternatives: either 1) drop OpenID and replace the whole comment system with something else or 2) fix python3-openid.

In fact, neither choice was leaving me completely in peace with my inner demons, so after all I decided to take it a step further. I'm going to not simply fix the library but to fork it and to rewrite it into something much leaner, maintainable, idiomatic and with an API designed for humans.

Because, seriously, if what you have to start with is this:

from openid.consumer.consumer import Consumer

… something is definitely wrong! Python deserves better.

Why not try to write a new library from scratch? Because aside of Python 3 related bugs the code is a rigorously tested and correct implementation of the spec and if I don't screw up my refactoring too much I'll have a working implementation pretty early in the process. Besides, I just love refactoring more than writing new code. Yeah, weird, I know :-)

Here's the (as yet empty) fork: https://github.com/isagalaev/python3-openid

I'll try my best to document the process on this blog, both for educational purposes and for getting early feedback. First question: a nice name for the library, not reminding of "python-openid" as it won't be compatible. Any ideas?

Comments: 8

  1. Алексей Матюшкин
    
    python-closeid
    
  2. Alexey Ten

    opythonid :)

  3. Ivan Sagalaev

    opythonid

    Hm… This one is interesting!

  4. olegmlsn

    pythonoid

  5. olegmlsn

    yapythonoid

    yet another python open id

  6. This is the first installment of my diaries on refactoring python3-openid. The post is turning out pretty big so may be I should try doing them more often.

  7. glader

    You should create your own project at travis-ci.org :)

  8. Ivan Sagalaev

    Yeah, I'll get to it when it starts to take shape. All metadata needs updating, of course.

Add comment