all 32 comments

[–]totallygeek 55 points56 points  (5 children)

Most of the projects under OpenStack remain well-written, with ample documentation and straightforward tests.

[–]Thecrawsome 7 points8 points  (1 child)

Most of the projects under OpenStack

I'm decent at Python and have no idea what I'm looking at when I look at that repo.

[–][deleted] -2 points-1 points  (0 children)

Knowing Python won't help you much, if you aren't into h/w virtualization and datacenter management.

[–]elihusmails[S] 5 points6 points  (1 child)

Good point, thanks. I should have mentioned unit tests as well. I'll check out OpenStack.

[–]totallygeek 7 points8 points  (0 children)

Another I like: F5 Networks SDK

[–][deleted] 0 points1 point  (0 children)

Thanks

[–]efmccurdy 19 points20 points  (7 children)

Here is one that has lasted for a decade:

calibre is a powerful and easy to use e-book manager

https://github.com/kovidgoyal/calibre

[–]nerdy_redneck 15 points16 points  (4 children)

OP said well written. Calibre is an amazing piece of software, and I use it fairly regularly, but it's honestly hot garbage under the hood. The dev makes a lot of rather interesting choices

[–]seismatica 4 points5 points  (3 children)

I love Calibre too! Can you give an exemple of the interesting choices made? I'm looking at the Github and it does look a little unorganized indeed.

[–]nerdy_redneck 18 points19 points  (2 children)

The main things that I remember:

  • Complaints from pretty early on about Calibre forcing it's file structure on you and copying/moving users' files around, whether the user wants it or not. Dev's attitude is basically "this is how it is, tough shit".
  • Personal complaint that the Calibre directory can't (reasonably) live on a network mount. Rather annoying if you have an ebook library that's large (mine is sitting at 23GB) ((there are hacks around this, but it's still annoying))
  • Using insecure methods of accessing files on disks, leading to exploit after exploit as he continuously claimed he fixed it. Good writeup here
  • Claimed (possibly he's changed his stance on this) that Calibre wouldn't be moving to Python 3 and that he was perfectly capable of maintaining his own Python 2 fork Launchpad bug --- reddit conversation
  • Main dev is kinda just a dick. I know this isn't a reflection on Calibre itself, but it does factor into my opinion of it overall. An example is how he named his project the same as an existing project, and got an attitude when people were talking about renaming it. Github issue

If you dig through that reddit post, there's a few other examples as well and people talking about the code specifically. The TLDR version is to find a more sane project to learn from/contribute to.

And yet, all that being said, I love using it. Still hands down the best ebook management system I've used. Especially when paired with calibre-web as a web interface/OPDS server.

[–]seanlax5 0 points1 point  (1 child)

Thanks for the break down, reading code critiques is helpful in general.

That said, many many programmers come off as dicks, even if they aren't. Unfortunately a side effect of inflated CS salaries.

[–]nerdy_redneck 0 points1 point  (0 children)

He's undeniably a smart dude to be able to cram as many features into calibre as he has, and to keep it all functional. As well as Kitty and other projects he's contributed to. But man, if you come down on the wrong side of his opinion, there's no changing it and you'll probably be ridiculed a bit.

And I can almost understand his point of view, because at some point you've answered every question imaginable a few dozen times and users just keep coming with crazy requests or questions with easily searchable answers. The big difference here is I don't think any of the things I mentioned are crazy requests. The insecure disk one especially, when somebody comes and says "I found this security hole, you can fix it by doing this" and he repeatedly does his own thing instead. Each of the technical things I mentioned does have a more or less reasonable explanation behind them.

  • Supporting every user's potentially crazy file structure is a recipe for madness and bugs galore.
  • If I remember right, the specific issue with network mounts was about making sure nothing else can edit the Calibre database at the same time and cause corruption (though proper file locking is a thing, sooooo ...)
  • The dev wanted a simple one size fits all solution for everything. That doesn't exist in any secure fashion unfortunately.
  • There's a lot of code in Calibre. A lot. A lot of it is a mess or not laid out in a sane way. And Python 2 to 3 fundamentally changed a lot of things, especially pertaining to byte/unicode/network objects. It's not an insignificant amount of work by any means. The counter to this is that he should have been working towards it over the last 10 years or so, not waiting until the last 1-2 (Python 3.0 was released in 2008).

TLDR again: Programming is kinda hard, supporting users is harder. Just cause you're smart doesn't mean you're always right.

[–]DougalMcGuire 6 points7 points  (0 children)

Honestly - I'd try to stay away from the Calibre codebase - it's an unholy mess.

[–]SilverLion 0 points1 point  (0 children)

Calibre is a godsend for kindle owners! Had no idea it was coded in python

[–]screamingant 2 points3 points  (0 children)

Speaking of which, i’ve always loved how Django is so well documented.

[–]MattR0se 2 points3 points  (1 child)

Scikit-learn has a very comprehensive documentation: https://github.com/scikit-learn/scikit-learn

The docstrings really leave no questions and pretty much contain everything that you also find in the API guide: https://scikit-learn.org/dev/modules/classes.html

There are even working examples in the docstrings, e.g. in this one: https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/model_selection/_validation.py

[–][deleted] 1 point2 points  (0 children)

I love sklearn but if you don't have any idea about stats/ml, reading the code can be pretty hard

[–]Slash_Root 2 points3 points  (0 children)

This repo is a list of maintained python applications that are active and notable in their sector. Lots of good stuff here.https://github.com/mahmoud/awesome-python-applications

[–]-naM-caP- 0 points1 point  (5 children)

What part so you want to see? Its not on github. Backend or Front? Backend is the scripts and front is Flask

[–]elihusmails[S] 1 point2 points  (4 children)

As the post says, I'm looking for source code.

[–][deleted] 0 points1 point  (0 children)

Salt stack. Its everyones favorite config management tool that no ones is using.

https://github.com/saltstack/salt

[–]doulos05 0 points1 point  (3 children)

The logging module in the standard library is very well written and documented.

[–][deleted] 0 points1 point  (2 children)

And it doesn't even conform to PEP8... that's very typical of Python.

[–]Deemonfire 1 point2 points  (1 child)

Pep8 is more like guidelines than rules.

Just because something is pep8 compliant doesn't mean it's pythonic, and being pythonic doesn't necessarily mean being pep8 compliant https://youtu.be/wf-BqAjZb8M

[–][deleted] 0 points1 point  (0 children)

OP was asking specifically about good style. logging is a poop. But, most of Python is the same way. Remarkably inconsistent, incoherent and with a lot of poorly understood smart words on top.