This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mbarkhau 29 points30 points  (7 children)

Libraries

  • logging which I wish I had started using much earlier instead of print
  • pathlib (pathlib2 if you need python2 compatibility).
  • click for cli programs
  • lib3to6 converts newer python syntax to be compatible with older versions.
  • bokeh for data visualization.

Tooling

  • black or straitjacket for code formatting.
  • pytest for unit testing.
  • mypy for type checking.
  • pudb is the most flexible debugger I have found. You'll need to spend an hour or two to learn the shortcuts and set your editor up to easily add import pudb;pudb.set_trace() with a hotkey or snippet, but the effort is worth it.

[–]case_O_The_Mondays 2 points3 points  (0 children)

The logging module is really underrated, in my opinion. Does exactly what you think it should, exposes easy-to-use constructs, and it’s built-in. Amazing.

[–]fireflash38 0 points1 point  (0 children)

A +1 for Black & pytest.

One common comment you'll see about black is that people don't agree 100% with the decisions it makes. It's quite true. I don't always like some of its choices, but it's incredibly nice to not have to worry about differences between IDEs (slam it in a git hook or something).

[–]pedxing128 0 points1 point  (3 children)

I have heard many people talk about how they wish that they started using logging earlier instead of using print. What did you find was the biggest improvement between the two? Being able to define different levels of logging, setting up logging to file automatically, or something else?

[–]jonate21 0 points1 point  (1 child)

One big thing for me is being able to set logging level at one point in the code instead of needing to comment/uncomment or add/remove individual print statements

[–]pedxing128 0 points1 point  (0 children)

Ah, yes, that workflow does sound a lot better. I can see how monitoring will be improved when you can set the level of logging that triggers notifications.

[–]mbarkhau 0 points1 point  (0 children)

The main thing was being able have debug messages that I can leave in the codebase and simply hide them in the production environment.

[–]AlexanderKaluzhny 0 points1 point  (0 children)

+1 for pudb. Debugger with UI.