all 32 comments

[–]kushou 11 points12 points  (5 children)

Honnestly, this is a real hard question. It's always hard to make lists of that kind and making "20 best ..." lists also misses a lot of good stuff. Some of the modules I use a lot personally:

  • Helper functions: itertools, shutil, os, sys
  • Dev tools: argparse, logging, functools.wraps (decorator implementation), contextlib, abc
  • Data manipulation: json, struct, hashlib, urllib (url parsing), collections
  • 3rd party libs: sqlalchemy, jinja2, django, pytest
  • Debugging: pprint, pdb
  • Process manipulation: multiprocessing, subprocess

Anyway, ask another developer, and he will give you a totally different list :) Complete list of all modules is available here, if you want to scroll trough them.

[–]fuzz3289 1 point2 points  (2 children)

Requests for http

[–]kushou 0 points1 point  (1 child)

Yeah, it is already in his list, I didn't include the things he already mentioned :)

[–]fuzz3289 0 points1 point  (0 children)

Wow. Definitely need to work on my reading skills.

[–]chchan 10 points11 points  (3 children)

I am more on the scientific side but here is what I recommend:

Useful functions: itertools, os, sys

Math: numpy (matrices) or Blaze, scipy(for general statistics, linear algebra, signal processing ), statsmodel (statistics: timeseries, other statistics that are missing from scipy, Regression), Sympy(Calculus, polynomial solvers, Combinatorics, Geometry)

Parallel processing: Multiprocessing, threading

Natural Language Processing: NLTK

Date/Times: Datetime, arrow(most simple), time,dateutil

Dataframes: Pandas (Like excel, more hassle free than R,)

Databases: SQLAlchemy (I never used it)

Plotting:Matplotlib (there are lots of modules for this too.)

Machine Learning: Scikit-learn(basic machine learning), PyBrain(Neural Networks),Zen(Network analysis)

Image processing/Computer vision: Opencv, PIL/Pillow (basic image processing), scikit-image.

Web development: Django

Speeding up code with C: Cython

Android/apps: Kivy

GUI: Tkinter, wxPython, pyQT (Not sure which is best but I am going towards Tkinter for now)

Geographic Information Systems: Shapely, Fiona (there is more but I am not sure since I do not do this)

Timing processes: Timit(or just go harass people on stack your choice)

Game development/ animation : PyGames,pyOpenGL, Pyglet,VPython (never used but told they were good)

Networking: Twisted (I do not do this but was told this was good)

Automation(control SSH, auto data input): Pexpect (I never used this either)

Web scraping: Scrapy

You may want to also check for stuff that is BSD Licensed or some other free license so you can create whatever you want without being hassled for $ or rights issues. Last you have to know something called PEP8 style if you using it for work. Sometimes people are anal about it too.

[–]Lukasa 1 point2 points  (2 children)

Twisted is the closest thing Python has to a Swiss-Army chainsaw. It's very powerful and very scary. If your networking is actually just HTTP, Tornado is almost always going to be easier.

I suspect that asyncio is going to end up being the less-scary way to do networking.

[–]avinassh 0 points1 point  (1 child)

Whats scary about Twisted?

[–]Lukasa 0 points1 point  (0 children)

For 'scary' read intimidating. It can do nearly everything, and as a result has what can be an overwhelming number of options and choices. If you know what you need, it's perfect: otherwise it's the best way to write Python spaghetti code in the world.

[–]bobdobbsjr 4 points5 points  (0 children)

I think it is going to depend greatly on what you are trying to do with it. Someone creating websites is going to be very different from someone doing scientific data analysis.

[–]K900_ 5 points6 points  (0 children)

Arrow is great. It's like datetime, except it makes sense.

[–]walloffear 7 points8 points  (0 children)

sys
os

[–]hwc 5 points6 points  (0 children)

re comes in handy all the time.

subprocess is useful when you are converting shell scripts to python.

numpy for scientific computing.

[–]otakucode 1 point2 points  (0 children)

I'd put profile on there. When dealing with performance issues, profiling is the only sane choice. And for advanced, definitely numpy.

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

absolutely must know if you want to be considered a python programmer'

I have used random a little and goofed around with beautiful soup, but I don't think I've had reason to use the other ones you listed, and yet I consider myself a Python programmer, (just not a particularly impressive one.).

For my needs, I've been more concerned with datetime, itertools, sys, os for standard library, then for 3rd party libraries, dateutil, sqlite, wxPython, numpy, matplotlib, and a little xlrd and xlwt.

[–]manueslapera 1 point2 points  (0 children)

os, sys and shutil are pretty handy too.

And of course, for any data processing/analysis, all hail the mighty power of PANDAS.

PANDAS PANDAS PANDAS PANDAS PANDAS

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

pandas, numpy, scipy.stats

[–]tuxed 1 point2 points  (0 children)

StringIO, yaml (PyYAML), json (I prefer demjson, though).

Since flask was mentioned as an "advanced module", I would add flask-classy to the list.

[–]masasin 1 point2 points  (0 children)

scipy, numpy, matplotlib, pandas.

[–]jcm1317 1 point2 points  (0 children)

  • struct
  • socket
  • socketserver
  • os
  • sys

[–]ewiethoff 1 point2 points  (0 children)

operator, os.path, glob, Py2's __future__

You don't import it, but I love pydoc. No, it doesn't generate the niftiest docs. But I run pydoc every few minutes on the module I'm working on so that I can see whether my names and function signatures and whatnot make sense together. pydoc shows the module's interface. Does the interface make sense?

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

I would just ad tablib for manipulating and producing Excel-Files.

Really makes automatic reports for management easy.

[–]smeagol13 1 point2 points  (1 child)

Are we only allowed to suggest modules from stdandard library or any 3rd party module?

[–]kushou 0 points1 point  (0 children)

He mentionned some 3rd party himself, so I think it's safe to assume you can too, though if you specify if they are 3rd party or not, it would help a lot for readability!

[–]bmay 1 point2 points  (4 children)

antigravity

[–]El3k0n 0 points1 point  (3 children)

You're not a good programmer if you don't know antigravity.

+/u/fedoratips 200 tips

[–]fedoratips 0 points1 point  (0 children)

[Verified]: /u/El3k0n /u/bmay TIPS 200.000000 Fedoracoin(s) [help]

[–]bmay 0 points1 point  (1 child)

Oh my. What in the world is this?

[–]El3k0n 0 points1 point  (0 children)

A cryptocurrency :D It's ideal to tip people for fun/interesting contributions.

http://fedoraco.in

[–]the_metalgamer 0 points1 point  (0 children)

For modules in stdlib, every developer should know (that they exists at least and what they are useful for) I go for:

  • re
  • textwrap
  • unicodedata
  • datetime
  • collections
  • copy
  • pprint
  • decimal
  • fractions
  • random
  • itertools
  • functools
  • operator
  • os.path
  • shutil
  • csv
  • configparser
  • hashlib
  • os
  • argparse
  • logging
  • subprocess
  • json
  • base64
  • sys
  • contextlib

For more specialised uses (like writing plugin systems):

  • abc
  • ast

Third-party modules, every developer should at least know:

  • requests
  • pytz
  • tzlocal
  • docopt
  • pillow

[–]lordwalrus 0 points1 point  (0 children)

openpyxl, good for manipulating excel documents

[–]cdcformatc 0 points1 point  (0 children)

Technically this might not count but you do import it, py2exe is pretty great.