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:

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: 14

  1. Олег Горбунов

    Опечатка: "in piece" - "in peace" :)

    Назвать: python-fluent-openid ?

  2. Ivan Sagalaev

    Опечатка: "in piece" - "in peace" :)

    О, спасибо!

    python-fluent-openid ?

    Не, длинно…

  3. Олег Горбунов

    openpie! На слух как )

  4. Adamos

    Тогда уж open_ok - это пойдет в массы! ;)

  5. Алексей Матюшкин
  6. tibalt

    тогда уж Open PieD - можно читать как опен пайди и как опен пайд (как глагол)

  7. Денис Откидач

    ksiva — во всех толкованиях подходит по смыслу.

    Кстати, сейчас отправка комментария с OpenID, как минимум от, не работает.

  8. Alexey Ten

    opythonid :)

  9. Ivan Sagalaev


    Hm… This one is interesting!

  10. olegmlsn


  11. olegmlsn


    yet another python open id

  12. 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.

  13. glader

    You should create your own project at :)

  14. Ivan Sagalaev

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

Add comment