Live data from Hacker News

Ask HN: Good Python codebases to read?

news.ycombinator.com

51–60 of 153 posts

Re: Ask HN: Good Python codebases to read?

#51
post #6
post #4

Requests - https://github.com/kennethreitz/requests . How to make a usable api. The decisions that went into each method call were fantastic. Great test coverage as well. I use package in most python development.

Thanks, I've been hearing a lot about this package, I think it's one I will check out. Cheers!

This presentation by the author explains the thinking behind it: https://speakerdeck.com/kennethreitz/python-for-humans

Re: Ask HN: Good Python codebases to read?

#52

Jumping on the Kenneth Reitz train, you might check out The Hitchhiker's Guide to Python: http://docs.python-guide.org/en/latest/ He recommends the following Python projects for reading: * Howdoi ( https://github.com/gleitz/howdoi ) * Flask ( https://github.com/mitsuhiko/flask ) * Werkzeug ( https://github.com/mitsuhiko/werkzeug ) * Requests ( https://github.com/kennethreitz/requests ) * Tablib ( https://github.com/k…

+1 to anything written by Kenneth Reitz, he's also a fantastic OSS maintainer and extremely welcoming of newbies and their PR's if you want to put some of your learning into practice

Re: Ask HN: Good Python codebases to read?

#54
Peter Norvig's examples. They are quite short and include much explanation in addition to code. They also include tests and benchmarking code.

http://norvig.com/lispy.html http://norvig.com/lispy2.html (Lisp interpreter)

http://www.norvig.com/spell-correct.html (Spelling corrector)

http://norvig.com/sudoku.html (Sudoku solver)

Also his online course Design of Computer programs includes many short, well-explained Python examples:

https://www.udacity.com/wiki/cs212

Re: Ask HN: Good Python codebases to read?

#58

The django project is a good example of a large opensource project which has aged well. http://github.com/django/django

I don't know what would be of my life right now without Django and I can't praise it enough... but "good example of readable python-code", it is not.

Re: Ask HN: Good Python codebases to read?

#59
I recommend PyToolz, "set of utility functions for iterators, functions, and dictionaries": https://github.com/pytoolz/toolz

The functions in PyToolz are short, well tested and idiomatic Python (thought the functional programming paradigm they support is not quite so idiomatic). I recommend starting with the excellent documentation: http://toolz.readthedocs.org/en/latest/

In particular, the API docs have links to the source code for each function: http://toolz.readthedocs.org/en/latest/api.html

Re: Ask HN: Good Python codebases to read?

#60
I see nobody has recommended CherryPy: http://www.cherrypy.org/

It is a minimal web framework like Sinatra or Flask. The beautiful thing about CherryPy is you write code for it the same way you would write general Python code. I enjoy using it for small projects from time to time.

edit:

Bickbucket Repository: https://bitbucket.org/cherrypy/cherrypy/overview

Post reply on HN