Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which parts of the python standard library are guaranteed to be available? [closed]

I'm interested to know which parts of the python standard library are absolutely guaranteed to be available, and which parts might not be installed, dependent on distribution.

I've seen this question but it doesn't quite provide the answer I'm looking for.

I'm aware that these modules aren't always available and that the math module always is. How about other modules? Are there any modules besides math that are guaranteed to be available?

Edit: the sys module is also always available.

like image 894
Paul Etherton Avatar asked Nov 11 '12 19:11

Paul Etherton


People also ask

What does the Python standard library contain?

The Python Standard Library contains the exact syntax, semantics, and tokens of Python. It contains built-in modules that provide access to basic system functionality like I/O and some other core modules. Most of the Python Libraries are written in the C programming language.

How many standard libraries does Python have?

With more than 137,000 libraries, Python can be used to create applications and models in a variety of fields, for instance, machine learning, data science, data visualization, image and data manipulation, and many more.

Is pandas part of Python standard library?

Pandas is built on top of two core Python libraries—matplotlib for data visualization and NumPy for mathematical operations. Pandas acts as a wrapper over these libraries, allowing you to access many of matplotlib's and NumPy's methods with less code.


1 Answers

If you are talking about the standard Python implementation (CPython), then the http://docs.python.org/3/library/index.html page lists the modules it provides (you can choose the Python version on the top of the page).

These are the standard modules included in the Python implementation, but some of them are operating-system specific or may depend on some other platform component. This is usually noted in the documentation of a module with such dependency. E.g.: http://docs.python.org/3/library/posix.html – there is „Platform: POSIX” annotation at the top.

Other dependencies may not be that explicit – http://docs.python.org/3/library/sqlite3.html doesn't say that this module is built only if the sqlite3 was available during Python build, but it is something one can expect.

Anyway, the Python Standard Library reference is always the best place to start. If a module documentation there doesn't say anything about platform and nothing suggests it depends on any external library or platform specific mechanism, then you may assume it is safe to use. But us other had said – anyone is free to remove anything from his Python build.

Anything not from the Standard Library must be considered optional in any Python installation, but the 'pure python' modules from http://pypi.python.org/pypi may be more available for the target audience that some binary modules from the Standard Library.

like image 197
Jacek Konieczny Avatar answered Nov 12 '22 08:11

Jacek Konieczny