XD blog

blog page

modules


2015-06-18 Website to find interesting Python modules

2015-04-18 A few modules for Sphinx

Here are a few modules I will probably use when I need them to generate documentation with Sphinx. This is just to avoid searching for them again.

And some others modules to easily build graphs with javascript and python:

2013-12-29 Big or small modules in Python, pyrsslocal

It is not always easy to determine a good size for a module or a set of modules. Should it be kept as a single bloc which comes alone or a set of smaller modules? It is easier to understand a smaller modules. It usually limits itself to a small set of similar functionalities. However, extending a small module is faster than starting a new one, it avoids spending too much time setting up the installation steps, documentation automation, dependencies with others modules. Small modules grow, especially if you work late on them on your free time.

pypi makes it simple to install a module and its dependencies, GitHub helps to fork some existing module which needs to be fixed for a specific usage. That's why I started to split my own toolbox. Does it worth the effort knowing I'm the only one to use it? Probably not but, for my teachings, I think I will not be reluctant anymore to create a new small project for a specific purpose.

I created or updated three modules:

2013-04-06 Installation of module PyMC

Installing a Python module can lead you quite far especially if this one includes some fortran files. That's what happened when I tried to install PyMC. That's what I did for Python 3.3 but it does not mean it is the simplest way.

Then, use Python and try import pymc to see if it worked. After that oue hour I spent gathering all the necessary steps, I forgot why I wanted to do it... Just kidding, Scipy does not exist yet on Python 3.3 and I needed the function normcdf (or cdf).

2013-03-05 Importer des modules directement depuis ce site

Lorsqu'on prépare une séance de travaux pratiques, on prévoit parfois de travailler sur des données non disponibles à l'école. Pour éviter de perdre du temps sur des choses déjà et rébarbatives telles que lire un fichier de données et construire une matrice, je prépare un fichier qui permet de lire ces données directement. Un fichier zip nécessite qu'on décompresse le fichier quelque part, qu'on vérifie que tout marche bien. Finalement, j'ai opté pour le programme que voici : importme.py. Il me permet à l'aide d'une instruction de télécharger les fichiers dont les élèves ont besoin. Il me suffit alors de leur donner quelques unes des lignes suivantes pour qu'ils puissent commencer à travailler.

import importme
use_graphviz = importme.import_module("use_graphviz")
tableformula = importme.import_module("tableformula")
tableformulagraph = importme.import_module("tableformulagraph")
file = importme.import_module("donnes_banque_mondiale.txt")
files = importme.import_module("equipements_sportif_2011.zip")
Si un fichier téléchargé est un fichier zip, il décompresse tous les fichiers au même endroit.


Xavier Dupré