Getting started#

Lorsqu’on fait des statistiques, le language Python est loin d’être aussi complet que R qui a été pensé dans ce but. Il faut lui ajouter plusieurs dizaines de modules. C’est à ce moment qu’on découvrir les subtilités dans les différents systèmes d’exploitations, les compilateurs, les dépendances, la ligne de commande. Ce paragraphe décrit un moyen d’installation Python sur les trois systèmes principaux Windows, OS X, Linux avec les modules nécessaires présentés dans ce cours. Le premier paragraphe explique comment installer rapidement Python, il faudra lire les suivants si vos besoins vont au delà.

Notes#

La grande majorité des exemples et des notebooks proposés sur ce site sont testés une fois par mois. La distribution utilisée varie mais s’appuie sur les dernières versions des modules. Une part moins importante est également testée à chaque modification sur github/sdpython sur Windows, Linux (Ubuntu) et Linux (Debian).

2020-2021#

Les tests sont dorénavant effectués sur Linux Debian 10 et la distribution standard Python 3.9.1. Les traces d’installation ont été conservées dans cet article 2021-01-09 Install Python 3.9 and many packages on Linux Debian 10.

2018-2020#

Pour l’année 2017, les tests sont dorénavant effectués sur Linux Debian 9 et la distribution standard Python 3.7.0. L’installation de cette machine est assez fastidieuse. Les traces de l’installation sont conservées sur cet article de blog : Install Python 3.7 and many packages on Linux Debian 9. Il reste quelques problèmes comme TensorFlow qui n’est pas encore compatible avec Python 3.7 (août 2018) mais cette pull request devrait résoudre le problème.

2017-2018#

Toutes les modules étaient testées sur Windows 10 et une distribtion standard Python 3.6.4 puis Python 3.6.5 64 bits.

En résumé : Anaconda#

En résumé, le conseil le plus fréquent qu’on donne à ceux qui souhaitent installer Python est d’utiliser la distribution Anaconda. C’est l’équivalent de R. Sans autre étape supplémentaire, elle permet de faire du calcul matriciel numpy, de tracer des graphiques avec matplotlib, de manipuler les données pandas et de faire du machine du machine learning scikit-learn. La plupart des exercices proposés sur ce site n’utilisent pas plus que ce qui est proposé dans cette distribution standard. Pour les autres, les instructions mentionnées ci-dessous fonctionnent sous Windows, Linux et Mac.

  • Installation Anaconda (python 64 bit)

  • Mise à jour de la distribution avec conda update --all (en ligne de commande).

Pour installer le module implémenté pour ce cours :

  • pip install ensae_teaching_cs

Windows#

Certains modules nécessitent une compilation C++. Anaconda fournit la plupart d’entre eux. Et Les plus utilisés sont de plus en plus disponibles sur pypi. Pour les autres, la plupart des modules sont disponibles sur PyPi. Sinon il faudra passer par WSL (voir blog post du 7 décembre 2022). Certains modules n’existent pas sous forme précompilée à moins de le faire soi-même. Il faut qu’un compilateur soit installée sur la machine et sans doute d’autres dépendances. Il est possible aussi de suivre les instructions exécutées à chaque changement : appveyor.yml.

Linux en ligne de commande / MacOS#

La page Anaconda Documentation Installation est assez précise quant à la démarche à suivre pour installer Anaconda ou Miniconda. Vous pouvez aussi suivre les instructions utilisées à chaque changement config.yml.

Il existe des différences sur MacOs. Mais vous pouvez suivre les instructions contenus dans ce fichier azure-pipelines.yml.

IDE#

Un IDE est un environnement de développement. Et comme on ne fait pas tout depuis un notebook, il faut en choisir un un.

Editeur de texte#

Si vous êtes dans le train et que vous n’avez pas beaucoup de batterie, il faut revenir à l’essentiel : un éditeur de texte.

Installer un module#

pip, python et ligne de commande#

Le language python s’est doté d’un système de distribution de modules (ou packages) qui est aisément accessible depuis la ligne de commande. Sous Windows, on peut lancer la ligne de commande par la commande cmd. Sous Linux ou OS/X, c’est une fenêtre terminal (Linux, OS/X). Il suffit alors de se déplacer dans le répertoire d’installation de Python

cd c:\Python391_x64\Scripts

Ou encore :

cd c:\Anaconda3\Scripts

Puis d’écrire :

pip install <module>

Sous Linux ou OS/X (Apple), la ligne de commande s’appelle le terminal. Comme Python est déjà installé en version 2.7, je recommande l’installation de la distribution Anaconda en version 3.8 qui facilite la coexistence de plusieurs versions de Python. On procède de la même manière

cd /home/<alias>/anaconda3/bin

Puis

pip install <module>

Pour vous assurer que cela correspond bien à la version de Python souhaitée, il suffit de demander la version installée

pip --version

Sous Windows, pour l’ajout d’un module ponctuel, si l’instruction pip install <module> ne fonctionne pas, c’est vraisemblablement parce que ce module contient une partie en C++. S’il ne l’est pas, l’installation du module est réservée aux experts qui ne fuit pas les messages d’erreur d’un compilation C++.

conda ou pip#

Anaconda maintient des versions de librairies Python. Pour tous les modules de cette liste, Anaconda Package List, il faut utiliser conda install <module>. Pour les autres, pip install <module>. Cela ne fonctionne qu’avec la distribution Anaconda.

L’instruction pip install ne fonctionne pas sous Windows lorsque le module est implémenté en Python et C++. C’est pourquoi il est préférable d’installer une version précompilée.

Dépendances#

Par défaut, l’installation d’un module implique celle de ses dépendances ce qu’il est possible d’éviter :

pip install <module> --no-deps

Désinstallation des modules implémentés pour ce cours#

Il est possible de désinstaller simplement les modules installés pour ces enseignements :

    pip uninstall -y _check_python_install
    pip uninstall -y actuariat_python
    pip uninstall -y code_beatrix
    pip uninstall -y cpyquickhelper
    pip uninstall -y deeponnxcustom
    pip uninstall -y ensae_projects
    pip uninstall -y ensae_teaching_cs
    pip uninstall -y ensae_teaching_dl
    pip uninstall -y jupytalk
    pip uninstall -y jyquickhelper
    pip uninstall -y lecture_citation
    pip uninstall -y manydataapi
    pip uninstall -y mlinsights
    pip uninstall -y mloptonnx
    pip uninstall -y mlprodict
    pip uninstall -y mlstatpy
    pip uninstall -y myblog
    pip uninstall -y onnxcustom
    pip uninstall -y onnxortext
    pip uninstall -y pandas_streaming
    pip uninstall -y papierstat
    pip uninstall -y pyenbc
    pip uninstall -y pyensae
    pip uninstall -y pymlbenchmark
    pip uninstall -y pymmails
    pip uninstall -y pymyinstall
    pip uninstall -y pyquickhelper
    pip uninstall -y pyrsslocal
    pip uninstall -y python3_module_template
    pip uninstall -y sparkouille
    pip uninstall -y teachpyx
    pip uninstall -y tkinterquickhelper
    pip uninstall -y wrapclib

Configuration pour ces cours#

Certains notebooks requièrent des outils supplémentaires :

Compiler un module#

Distributions#

  • Anaconda (Windows, Linux, Mac). Sous Linux ou OS/X, la distribution n’interfère pas avec la distribution existante souvent différente. C’est un point très appréciable. Les modules de la distribution ne sont pas tous à jour. Il faut penser à mettre à jour avec la commande conda install <module> depuis le répertoire Anaconda3/Scripts (conda install cvxopt par exemple). Il existe une version différente : miniconda. La liste des packages manquant sera probablement différente. Il suffit d’écrire sur la ligne de commande conda update --all pour mettre à jour tous les modules.

  • WinPython (Windows). Sous Windows, elle inclut parfois R ou Julia (ces version ne sont pas aussi à jour que la version principale). On passe alors facilement de python à R ou Julia depuis le même notebooks. Uniquement disponible sous Windows, cette installation a l’avantage de ne pas nécessiter les droits administrateur pour être installée. Elle ne modifie pas les registres et on peut la recopier telle quelle sur une clé USB pour la recopier sur un autre ordinateur. On peut également préparer sa propre version How To Make WinPython.

  • Distribution officielle de Python, il faut ensuite installer de nombreux modules (voir Liste exhaustive de modules Python) pour obtenir une distribution équivalente aux deux précédentes.

  • miniconda est une version light de Anaconda sans tous ces packages. Elle peut être installée depuis une ligne de commande, via une connexion SSH. Voir Install Anaconda through SSH connection.

La liste des packages de WinPython ou Anaconda sont d’excellents moyens de découvrir de nouveaux modules intéressants.

Modules incournables pour un data scientist#

Les modules indispensables sont intégrés à la distribution Anaconda, WinPython.

Les indispensables

  • dask : dataframe distribué et capables de gérer des gros volumes de données (> 5Go)

  • Jupyter : gestion des notebooks (des pages blanches mélangeant code, équations, graphiques)

  • matplotlib : graphes scientifiques

  • numpy : calcul matriciel

  • pandas : gestion de DataFrame

  • Scipy : calcul scientifique

  • scikit-learn : machine learning, statistique descriptive

  • statsmodels : séries temporelles

Visualisation

Voir 10 plotting libraries at PyData 06/14/2016 in Paris ou Visualisation.

Jeux

  • pygame + thorpy

  • kivy : pour faire des jeux ou des applications pour tablettes, téléphones

Pour les TD et projets à l’ENSAE

Pour faire du machine learning sans programmer

Outils, ressources pour développer#

Développer un programme informatique prend du temps et il est important d’être à l’aise. Une grande difficulté lorsqu’on programme c’est de travailler à plusieurs sur le même projet. Il faut se sychroniser. Fort heureusement, le problème est connu depuis longtemps et il existe beaucoup d’outils open source dont on aurait tort de se passer ou des services gratuits sous certains conditions qui facilitent l’archivage.

En vrac#

Suivi de sources distant

Git

git est un logiciel de suivi de source. Il a supplanté tous les autres et il est indispensable aujourd’hui de le connaître. On ne retient pas toujours les commandes mais un moteur de recherche fournit rapidement la réponse. Voir aussi Cheat Sheet.

Archivage distant

Ce ne sont pas les seuls, vous trouverez d’autres options ici : cloud-gratuit. Toutefois, il est recommandé de faire attention avec les données personnelles sensibles. Il n’est pas toujours possible de choisir le lieu de stockage et chaque pays a une législation différente. Même si vos données sont protégées par un mot de passe et ne sont pas publiques, il arrive que certains mots de passe soient interceptés.

Comparaison de fichiers

Partager des notes, des idées

Editeur de texte

  • Visual Studio Code : il marche partout, il est gratuit, léger et il a été adopté pas beaucoup de monde

  • SciTE : le plus simple, pas d’explorateur de fichier, pas d’installeur, autocomplétion perturbante

  • TextWrangler (seulement sur iOS - Apple)

  • SublimeText : configuration nécessaire avant d’exécuter un script python

  • Notepad++ : configuration nécessaire avant d’exécuter un script python

IDE

Python et Domotique

Navigateur

Les navigateur sont importants pour l’utilisation des notebooks. Je recommande soit Firefox, soit Chrome. Ces deux navigateurs sont indispensables si vous insérez du javascript dans nos notebooks. Le débuggeur de Chrome est le plus pratique à utiliser quand il s’agit d’aller fouiller dans les feuilles de styles ou de voir l’exécution du javascript.

Documentation

La documentation et les tests unitaires les modules classés dans les catégories SPHINX, TEACH (voir table ci-dessous). Certaines séances pratiques utilisent des données depuis ce site. Elles sont facilement téléchargeables avec ces deux modules :

  • pyquickhelper : ce module compile ce cours

  • pyensae : outils variés pour les élèves de l’ENSAE

Pour être compilée, la documentation requiert également :

Continuous build

Compression

  • 7zip : pour compresser, décompresser tous les formats

Ressources

Générer une documentation comme ce cours#

Lire List of tools needed to build the documentation.

Maintenir sa distribution Python à jour#

Manipuler les données est différent de savoir programmer. Si le second est nécessaire au premier, il est impensable aujourd’hui de ne pas tenir compte ce que d’autres programmeurs ont mis à disposition de tous en libre accès. Tous les modules proposés dans la suite sont utilisées par beaucoup, et sont très adaptés à la manipulation des données. Ils bénéficient de ce fait d’un développement rapide et d’une robustesse qu’il faut environ un an à un bon programmeur pour obtenir avec un de ses outils sur le même éventail de fonctionnalités (en y consacrant 10 à 20% de son temps).

J’ai cherché à regrouper les outils qui permettent à un ingénieur, statisticiens, data scientist de manipuler aisément des données, qui peuvent aller de quelques kilo-octets à quelques giga octets. En tant que data scientist, je pioche très régulièrement des éléments des sept premiers chapitres. Les sept suivants ne sont utiles que de temps en temps, surtout si les données sont de taille supérieure à 250 Mo.

L’essentiel n’est pas de tout faire en Python, l’essentiel est d’être agile, de passer le moins de temps sur l’implémentation et le plus de temps possible sur les données.

Personnellement, j’ai acheté des livres de Python, le premier pour apprendre le langage, il m’a servi pour préparer mes premiers cours il y a 5 ou 6 ans, les autres pour voir ce qu’on pouvait écrire sur le sujet mais ils ne m’ont jamais vraiment servi. Le machine learning va si vite aujourd’hui que la plupart des livres d’informatique sont obsolètes en peu de temps. Pour apprendre, un livre ou un prof fera l’affaire. Ensuite, des livres de mathématiques, des articles…

Listes de modules

Quelques articles

Liens, blogs à suivre

Articles Livres, Vidéos

Liste exhaustive de modules Python#

Les modules suivant font partie du setup proposé aux étudiants (voir plus bas).

  • usage : classification, la plus importante DATA/ML regroupe les modules les plus importantes pour faire du machine learning

  • name : nom du module

  • kind : façon d’installer le module sous Windows, si c’est wheel, cela signifie que le module inclut une partie C++ qu’il est préférable de récupérer déjà compilée,

  • version : la version à installer car d’autres peuvent provoquer des conflits

  • license : license du module, toutes ne permettent pas un usage commercial, voir choose a license, licences commentées

  • purpose : description plus détaillée

<<<

from ensae_teaching_cs.automation import rst_table_modules
print(rst_table_modules())

>>>

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API

warnings.warn(« pkg_resources is deprecated as an API », DeprecationWarning)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google.logging”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2349: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(parent)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“metapensiero”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“mpl_toolkits”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“google”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

somewhere/workspace/ensae_teaching_cs/ensae_teaching_cs_UT_39_std/_venv/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace(“sphinxcontrib”). Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

declare_namespace(pkg)

index

usage

name

kind

version

license

purpose

0

aenum

pip

Advanced Enumerations (compatible with Python’s stdlib Enum), NamedTuples, and NamedConstants

1

SPHINX

alabaster

pip

BSD

A configurable sidebar-enabled Sphinx theme

2

ansi2html

pip

GPLv3+

Convert text with ANSI color codes to HTML

3

ansiconv

pip

MIT

A Python module for converting ANSI coded text and converts it to either plain text or HTML.

4

appdirs

pip

MIT

A small Python module for determining appropriate platform-specific dirs

5

astroid

pip

LGPL-2.1-or-later

A abstract syntax tree for Python with inference support.

6

attrs

pip

MIT

Attributes without boilerplate.

7

STYLE

autopep8

pip

Expat License

apply pep8 on a script

8

SPHINX

babel

pip

BSD

Internationalization utilities, version 2.0 has bugs

9

JUPYTER

backcall

pip

Specifications for callback functions passed in to an API (IPython, Jupyter)

10

backports.functools_lru_cache

pip

MIT

backports.functools_lru_cache

11

JUPYTER

backports.shutil-get-terminal-size

pip

needed for Jupyter

12

JUPYTER

backports_abc

pip

Python Software Foundation License

A backport of recent additions to the “collections.abc” module

13

beautifulsoup4

pip

MIT

Beautiful Soup sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.

14

VIZ

bkcharts

pip

High level chart types built on top of Bokeh

15

WEB

bleach

pip

Apache Software License

An easy whitelist-based HTML-sanitizing tool.

16

blockdiag

pip

Apache License 2.0

blockdiag generates block-diagram image from text

17

VIZ

bokeh

pip

Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors

interactive graphs, zoomable, javascript

18

DATA/ML

bottleneck

wheel

pandas depenencies, faster arrays

19

VIZ

bqplot

pip

Apache

interactive graphs, zoomable, d3.js for notebooks

20

brewer2mpl

pip

MIT

Connect colorbrewer2.org color maps to Python and matplotlib

21

VIZ

Cartopy

wheel

LGPLv3

Cartopy is a Python package designed to make drawing maps for data analysis and visualisation as easy as possible (issue on Linux and Anaconda)

22

certifi

pip

MPL-2.0

Certifi is a carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts.

23

cftime

wheel

Time-handling functionality from netcdf4-python.

24

WEB

chardet

pip

LGPL

Universal encoding detector.

25

click

pip

BSD-3-Clause

A simple wrapper around optparse for powerful command line utilities.

26

codecov

pip

Apache 2.0

submit coverage report to codecov

27

SPHINX

colorama

pip

BSD

Cross-platform colored terminal text.

28

coverage

pip

Apache-2.0

measure the coverage of unit tests

29

VIZ

cycler

pip

BSD

dependency for matplotlib

30

Cython

wheel

Apache

pseudo C++ in python

31

DATA/ML

cytoolz

wheel

BSD

Cython implementation of Toolz: High performance functional utilities

32

DataProperty

pip

Python library for extract property from data.

33

dbf

pip

access DBase format

34

dbfread

pip

MIT

access DBase format

35

decorator

pip

new BSD License

Better living through Python with decorators

36

defusedxml

pip

PSFL

XML bomb protection for Python stdlib modules

37

distlib

pip

Python license

Low-level components of distutils2/packaging, augmented with higher-level APIs for making packaging easier.

38

STYLE

docformatter

pip

Formats docstrings to follow PEP 257.

39

SPHINX

docutils

pip

public domain, Python, 2-Clause BSD, GPL 3 (see COPYING.txt)

interpret RST format

40

dominate

pip

LGPLv3

Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API.

41

elasticsearch

pip

Apache License 2.0

Python client for Elasticsearch

42

JUPYTER

entrypoints

pip

MIT

Discover and load entry points from installed packages.

43

envoy

pip

~MIT

Simple API for running external processes.

44

et_xmlfile

pip

MIT

et_xmlfile is a low memory library for creating large XML files (for openpyxl).

45

VIZ

ete3

pip

GPLv3

tree visualisation, ete3 does not work with PyQt4 (2017-11).

46

NETWORK

falcon

pip

Apache 2.0

Falcon is a very fast, very minimal Python web framework for building microservices, app backends, and higher-level frameworks.

47

NETWORK

falcon-auth

pip

A falcon middleware + authentication backends that adds authentication layer to you app/api service.

48

feedparser

pip

BSD-2-Clause

parse RSS streams

49

GEO

Fiona

wheel

BSD

Fiona is OGR’s neat, nimble, no-nonsense API for Python programmers.

50

fire

pip

Apache Software License

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.

51

STYLE

flake8

pip

MIT

verify pep8 on a script

52

NETWORK

flask

pip

BSD-3-Clause

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. And before you ask: It’s BSD licensed!

53

Flask-Cors

pip

A Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.

54

NETWORK

Flask-Login

pip

MIT

55

NETWORK

flask-sqlalchemy

pip

56

funcparserlib

pip

MIT

Recursive descent parsing library based on functional combinators

57

future

pip

MIT

Clean single-source support for Python 3 and 2

58

GDAL

wheel

MIT

GDAL is a translator library for raster and vector geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation.

59

ggplot

pip

ggplot graphics style

60

JUPYTER

ghost.py

pip

ghost.py is a webkit web client written in python

61

VIZ

graphviz

pip

MIT

wrapper for graphviz (most famous tool to draw graphs

62

greenlet

wheel

MIT License

Greenlet allows lightweight in-process concurrent programming.

63

html5lib

pip

MIT License

pure-python library for parsing HTML

64

httpie

pip

BSD

HTTPie - a CLI, cURL-like tool for humans

65

WEB

idna

pip

Internationalized Domain Names in Applications (IDNA)

66

ijson

pip

BSD

Iterative JSON parser with a standard Python iterator interface

67

SPHINX

imagesize

pip

MIT

Getting image size from png/jpeg/jpeg2000/gif file

68

JUPYTER

importlib-metadata

pip

library to access the metadata for a Python package. It is intended to be ported to Python 3.8.

69

ipaddress

pip

Python Software Foundation License

IPv4/IPv6 manipulation library

70

JUPYTER

ipydatawidgets

pip

BSD

A set of widgets to help facilitate reuse of large datasets across widgets

71

JUPYTER

ipykernel

pip

# Licensing terms

IPython, Jupyter, kernels

72

JUPYTER

ipympl

pip

Matplotlib Jupyter Extension

73

JUPYTER

ipyparallel

pip

BSD

Interactive Parallel Computing with IPython

74

JUPYTER

ipyscales

pip

A widget library for scales

75

JUPYTER

ipython

pip

BSD-3-Clause

IPython, Jupyter

76

JUPYTER

ipython_genutils

pip

BSD

IPython utils (nbformat)

77

JUPYTER

ipywidgets

pip

BSD

IPython, Jupyter, widgets

78

isodate

pip

An ISO 8601 date/time/duration parser and formatter

79

isort

pip

MIT

A Python utility / library to sort Python imports.

80

itsdangerous

pip

BSD-3-Clause

Various helpers to pass trusted data to untrusted environments and back.

81

jdcal

pip

BSD

Julian dates from proleptic Gregorian and Julian calendars.

82

jedi

pip

MIT

An autocompletion tool for Python that can be used for text editors.

83

jinja2

pip

BSD-3-Clause

templating

84

joblib

pip

BSD

distribute jobs, parallelization

85

jsonschema

pip

MIT

An implementation of JSON Schema validation for Python

86

JUPYTER

jupyter

pip

BSD

Jupyter

87

JUPYTER

jupyter-console

pip

BSD 3-Clause License

Jupyter console, new in Jupyter 4.0

88

JUPYTER

jupyter-pip

pip

Allows Jupyter notebook extension writers to make their extension pip installable!

89

JUPYTER

jupyter_client

pip

BSD

Jupyter client

90

JUPYTER

jupyter_contrib_nbextensions

github

This repository contains a collection of extensions that add functionality to the Jupyter notebook.

91

JUPYTER

jupyter_core

pip

BSD

Jupyter Core

92

JUPYTER

jupyter_sphinx

pip

BSD

Jupyter Sphinx Extensions

93

JUPYTER

jupyterlab

pip

Jupyter Lab

94

JUPYTER

jupyterlab-launcher

pip

Jupyter Lab Launcher

95

JUPYTER

jupyterlab-server

pip

Copyright (c) 2015-2017, Project Jupyter Contributors

Jupyter Lab Server

96

JUPYTER

jupyterlab_pygments

pip

Jupyterlab

97

kiwisolver

wheel

Kiwi is an efficient C++ implementation of the Cassowary constraint solving algorithm.

98

lazy-object-proxy

pip

BSD-2-Clause

A fast and thorough lazy object proxy

99

Logbook

wheel

A logging replacement for Python

100

lxml

wheel

BSD-3-Clause

xml parsers (C++)

101

Mako

pip

MIT

templating

102

markdown

pip

BSD License

markdown parser (for bokeh)

103

markupsafe

pip

BSD-3-Clause

parses mardown

104

VIZ

matplotlib

wheel

PSF

most used plotting library

105

mbstrdecoder

pip

MIT

multi-byte character string decoder

106

STYLE

mccabe

pip

Expat license

This module provides a plugin for flake8, the Python code checker.

107

JUPYTER

metakernel

pip

BSD

more magic commands for Jupyter

108

JUPYTER/LINUX

micropython-fcntl

pip

dependency for ptyprocess, Functions to compute fnctl.ioctl’s opt argument

109

JUPYTER/LINUX

micropython-ffilib

pip

dependency for ptyprocess, MicroPython FFI helper module

110

JUPYTER/LINUX

micropython-libc

pip

dependency for ptyprocess, MicroPython FFI helper module

111

mistune

pip

BSD 3-Clause License

The fastest markdown parser in pure Python with renderer features, inspired by marked.

112

DATA/ML

mkl_service

wheel

This package exposes a few functions which are declared in mkl_service.h. The main purpose of the package is to allow the user to change the number of CPU’s MKL is using at runtime.

113

mock

pip

BSD

mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used.

114

VIZ

mpl_finance

github

This module consists of code extracted from the deprecated matplotlib.finance module along with a few examples of usage.

115

msgfy

pip

msgfy is a Python library for convert Exception instance to a human-readable error message.

116

multi-key-dict

pip

License :: OSI Approved :: MIT License (http://opensource.org/licenses/MIT)

Multi key dictionary implementation

117

multimethods

pip

MIT

A multimethod implementation, loosely based on Guido’s initial ‘Five-minute Multimethods in Python.

118

multipledispatch

pip

BSD

A relatively sane approach to multiple dispatch in Python.

119

natsort

pip

Sort lists naturally

120

JUPYTER

nbbrowserpdf

pip

LaTeX-free PDF generation from Jupyter Notebooks

121

JUPYTER

nbconvert

pip

# Licensing terms

IPython, notebooks conversion, new in Jupyter 4.0

122

JUPYTER

nbformat

pip

# Licensing terms

IPython, notebooks conversion, new in Jupyter 4.0

123

JUPYTER

nbpresent

pip

Next generation slides from Jupyter Notebooks

124

JUPYTER

nbsphinx

pip

MIT

nbsphinx is a Sphinx extension that provides a source parser for *.ipynb files.

125

netCDF4

wheel

xarray uses this module to save and read data (netCDF=Unidata network Common Data Form)

126

VIZ

networkx

pip

graph libraries, basic drawing

127

nodeenv

pip

BSD

Node.js virtual environment builder

128

nose

pip

run unit tests

129

JUPYTER

notebook

pip

BSD

Jupyter notebooks, new in Jupyter 4.0

130

JUPYTER

notedown

pip

Convert markdown to IPython notebook.

131

DATA/ML

numpy

wheel

BSD

matrix computation

132

olefile

pip

Python package to parse, read and write Microsoft OLE2 files (Structured Storage or Compound Document, Microsoft Office) - Improved version of the OleFileIO module from PIL, the Python Image Library.

133

openpyxl

pip

MIT

reads/writes Excel files, version is 1.8.6 due to pandas which does not work with more recent verrsions yet

134

packaging

pip

Core utilities for Python packages

135

DATA/ML

pandas

wheel

BSD-3-Clause

manipulate table as SQL in memory

136

DATA/ML

pandas-datareader

pip

Up to date remote data access for pandas, works for multiple versions of pandas.

137

pandoc-attributes

pip

An Attribute class to be used with pandocfilters

138

pandocfilters

pip

BSD-3-Clause

Utilities for writing pandoc filters in python

139

parso

pip

MIT

Parso is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python versions). Parso is also able to list multiple syntax errors in your python file.

140

JUPYTER

path.py

pip

MIT

IPython, dependency

141

pathlib2

pip

for ggplot, Object-oriented filesystem paths

142

pathvalidate

pip

MIT

A python library to validate/sanitize a string such as filenames/variable-names/excel-sheet-names.

143

DATA/ML

patsy

pip

2-clause BSD

A Python package for describing statistical models and for building design matrices.

144

pbr

pip

Apache Software License

PBR is a library that injects some useful and sensible default behaviors into your setuptools run.

145

pep8

pip

Expat license

official guidelines on Python style

146

JUPYTER

pexpect

pip

ISC license

needed by ipykernel on Linux, Pexpect makes Python a better tool for controlling other applications (needed by metakernel).

147

JUPYTER

pickleshare

pip

MIT

IPython, dependency

148

Pillow

wheel

HPND

read/create images

149

pipdeptree

pip

MIT

displays module dependencies as a tree

150

pkginfo

pip

Query metadatdata from sdists / bdists / installed packages.

151

plotnine

pip

MIT

A grammar of graphics for Python

152

JUPYTER

portalocker

pip

Portalocker is a library to provide an easy API to file locking.

153

JUPYTER

prometheus_client

pip

The official Python 2 and 3 client for Prometheus.

154

JUPYTER

prompt_toolkit

pip

Library for building powerful interactive command lines in Python

155

psutil

wheel

BSD

cross-platform library for retrieving information onrunning processes and system utilization (CPU, memory, disks, network)in Python.

156

JUPYTER/LINUX

ptyprocess

pip

ISC

dependency for the terminado, Run a subprocess in a pseudo terminal

157

STYLE

pycodestyle

pip

Expat license

Python style guide checker

158

pycparser

pip

BSD

pycparser is a complete parser of the C language, written in pure Python using the PLY parsing library. It parses C code into an AST and can serve as a front-end for C compilers or analysis tools.

159

STYLE

pyflakes

pip

MIT

verify pep8 on a script

160

pygments

pip

BSD-2-Clause

syntax highlighting package written in Python

161

pylint

pip

GPL-2.0-or-later

statistics on Python script style

162

pyparsing

pip

alternative approach to creating and executing simple grammars

163

PDF

PyPDF2

pip

BSD-3-Clause

PDF toolkit

164

pypiserver

pip

BSD

run a local pypi server

165

VIZ

pyproj

wheel

MIT

python interface to PROJ4 library for cartographic transformations https://jswhit.github.io/pyproj, needed by cartopy

166

GUI

PyQt5

pip

167

GUI

PyQt5-sip

pip

168

TEACH

pyquicksetup

pip

MIT

helpers for setup

169

pyreadline

pip

python implementation of GNU readline functionality

170

pyrsistent

pip

MIT

Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are immutable.

171

GUI

PySide2

pip

The Qt for Python project aims to provide a complete port of the PySide module to Qt 5.

172

pystache

pip

MIT

Mustache for Python (for bokeh)

173

pytablereader

pip

MIT

A python library to load structured table data from files/URL with various data format: CSV/Excel/HTML/JSON/LTSV/Markdown/TSV.

174

pytablewriter

pip

convert a dataframe into many formats

175

python-dateutil

pip

Dual License

helpers to manipulate dates

176

python-jenkins

pip

BSD

interact with Jenkins

177

python-mimeparse

pip

MIT

A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges. (falcon)

178

pythonqwt

pip

MIT

Qt plotting widgets (Spyder)

179

pytz

pip

MIT

World timezone definitions, modern and historical

180

pywinpty

wheel

Python bindings for the winpty pseudo terminal library. It allows to create and communicate with Windows processes that print outputs and recieve inputs via console input and output pipes.

181

PyYAML

wheel

MIT

YAML parser and emitter for Python

182

NETWORK

pyzmq

wheel

LGPL+BSD

python librairies for Omz (pipy distributes the binaries)

183

VIZ

qgrid

pip

Apache-2.0

A Pandas DataFrame viewer for IPython Notebook.

184

JUPYTER

qtconsole

pip

BSD

IPython, notebooks, qtconsole

185

GUI

qtpy

pip

MIT

single interface for QtPy4, 5, PySide

186

queuelib

pip

BSD

Collection of persistent (disk-based) queues

187

requests

pip

Apache 2.0

human interface for http

188

requests-cache

pip

Persistent cache for requests library

189

requests-file

pip

File transport adapter for Requests

190

requests-ftp

pip

FTP Transport Adapter for Requests

191

rope_py3k

pip

GPL=OpenBSD

refactoring library

192

DATA/ML

scikit-learn

wheel

new BSD

machine learning

193

VIZ

scikit-plot

pip

nicer graphs than matplotlib for datascientist

194

DATA/ML

scipy

wheel

Copyright (c) 2001-2002 Enthought, Inc. 2003-2022, SciPy Developers.

scientific computation, eigen values, linear algebra

195

VIZ

seaborn

pip

nicer graphs than matplotlib for statistical purposes

196

semantic_version

pip

BSD

A library implementing the “SemVer” scheme.

197

Send2Trash

pip

BSD License

Send file to trash natively under Mac OS X, Windows and Linux.

198

Shapely

wheel

BSD 3-Clause

Manipulation and analysis of geometric objects in the Cartesian plane.

199

shiboken2

pip

for PySide

200

JUPYTER

simplegeneric

pip

IPython, dependency

201

simplejson

wheel

MIT License

Simple, fast, extensible JSON encoder/decoder for Python

202

SimpleSQLite

pip

MIT

SimpleSQLite is a Python library to simplify the table creation and data insertion into SQLite database.

203

GUI

SIP

pip

GPL v2 or GPL v3 or BSD

For PyQt5

204

six

pip

MIT

helpers for python 2/3 conversion

205

snowballstemmer

pip

BSD-3-Clause

This package provides 16 stemmer algorithms (15 + Porter English stemmer) generated from Snowball algorithms, needed by sphinx-rtd-theme.

206

NETWORK

sockjs-tornado

pip

SockJS-tornado is a Python server side counterpart of SockJS-client browser library running on top of Tornado framework.

207

soupsieve

pip

Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4.

208

SPHINX

sphinx

pip

documentation generation based on RST

209

SPHINX

sphinx-rtd-theme

pip

MIT

sphinx theme

210

SPHINX

sphinxcontrib-applehelp

pip

BSD

extension for Sphinx

211

sphinxcontrib-blockdiag

pip

BSD

Sphinx “blockdiag” extension

212

SPHINX

sphinxcontrib-devhelp

pip

BSD

extension for Sphinx

213

SPHINX

sphinxcontrib-htmlhelp

pip

BSD

extension for Sphinx

214

SPHINX

sphinxcontrib-jsmath

pip

BSD

extension for Sphinx

215

SPHINX

sphinxcontrib-qthelp

pip

BSD

extension for Sphinx

216

SPHINX

sphinxcontrib-serializinghtml

pip

BSD

extension for Sphinx

217

SPHINX

sphinxcontrib-websupport

pip

extension for Sphinx

218

spyder

pip

scientific IDE

219

spyder-kernels

pip

Jupyter Kernels for the Spyder console

220

SQL

SQLAlchemy

wheel

MIT

model SQL queries as objects

221

sqlite_bro

pip

MIT

GUI for SQLite

222

sqliteschema

pip

sqliteschema is a Python library to dump table schema of a SQLite database file.

223

SQL

sqlparse

pip

Non-validating SQL parser

224

DATA/ML

statsmodels

wheel

BSD License

statistical modelling, depends on scipy

225

tabledata

pip

A Python library to represent tabular data for pytablewriter/pytablereader/SimpleSQLite.

226

tabulate

pip

MIT

Pretty-print tabular data

227

JUPYTER/LINUX

terminado

pip

BSD

dependency for the notebooks, Terminals served to term.js using Tornado websockets

228

testpath

pip

MIT

Test utilities for code working with files and commands

229

threadpoolctl

pip

BSD-3-Clause

Python helpers to limit the number of threads used in the threadpool-backed of common native libraries used for scientific computing and data science (e.g. BLAS and OpenMP).

230

toml

pip

MIT

Python Library for Tom’s Obvious, Minimal Language

231

DATA/ML

toolz

pip

BSD

Toolz provides a set of utility functions for iterators, functions, and dictionaries.

232

NETWORK

tornado

wheel

http://www.apache.org/licenses/LICENSE-2.0

python server, IPython relies on it

233

JUPYTER

tqdm

pip

MPLv2.0, MIT Licences

A Simple Python Progress Meter

234

JUPYTER

traitlets

pip

# Licensing terms

IPython, dependency

235

traittypes

pip

BSD

Custom trait types for scientific computing.

236

typecheck-decorator

pip

verifies decorators at running time

237

typed_ast

pip

typed_ast is a Python 3 package that provides a Python 2.7 and Python 3 parser similar to the standard ast library.

238

typepy

pip

MIT

A python library for variable type checker/validator/converter at run time.

239

ujson

wheel

Ultra fast JSON encoder and decoder for Python

240

unidecode

pip

GPLv2+

ASCII transliterations of Unicode text

241

STYLE

unify

pip

Expat License

Modifies strings to all use the same (single/double) quote where possible.

242

STYLE

untokenize

pip

Expat License

Transforms tokens into original source code (while preserving whitespace).

243

urllib3

pip

MIT

urllib2 extension

244

uvloop

pip

Fast implementation of asyncio event loop on top of libuv

245

version-information

pip

Version information

246

virtualenv

pip

creatre virtual environments

247

NETWORK

waitress

pip

Waitress WSGI server

248

JUPYTER

wcwidth

pip

MIT

Measures number of Terminal column cells of wide-character codes

249

webcolors

pip

BSD 3-Clause

A library for working with color names and color value formats defined by the HTML and CSS specifications for use in documents on the Web.

250

webencodings

pip

BSD

Character encoding aliases for legacy web content

251

werkzeug

pip

BSD-3-Clause

The Swiss Army knife of Python web development

252

wget

pip

none

pure python download utility

253

wheel

pip

handle wheels

254

JUPYTER

widgetsnbextension

pip

BSD

Interactive HTML widgets for Jupyter notebooks.

255

win_unicode_console

pip

MIT

256

wrapt

wheel

BSD

A Python module for decorators, wrappers and monkey patching.

257

wurlitzer

pip

for spyder

258

DATA/ML

xarray

pip

Apache-2.0

pandas like library for cubes (N-dimensional data)

259

xlrd

pip

BSD

reads Excel files

260

XlsxWriter

pip

BSD-2-Clause

writes Excel files

261

xlwt

pip

BSD

writes Excel files

262

xmltodict

pip

Makes working with XML feel like you are working with JSON

263

yapf

pip

Code formatter

264

zipp

pip

A pathlib-compatible Zipfile object wrapper.

Footnotes