Skip to content

Instantly share code, notes, and snippets.

@neovov
Last active December 20, 2015 02:49
Show Gist options
  • Save neovov/6059471 to your computer and use it in GitHub Desktop.
Save neovov/6059471 to your computer and use it in GitHub Desktop.
Modification du tableau listant les bibliothèques permettant de parser les formats de données (http://www.la-grange.net/2013/07/04/data-formats)
| format | python | php | ruby | javascript |
| -------------------------------------------- |:---------------------------:|:-----------------:|:----:| ----------------:|
| Internet Message Format (email) | email.parser | ? | ? | ? |
| JSON | json | natif (PHP 5.2) | ? | natif (ES5) |
| Base64 | base64 | natif (PHP 4) | ? | natif (?) |
| Multipurpose Internet Mail Extensions (MIME) | quopri | natif (PHP 5.3) | ? | mime (Node.JS) |
| XML | elementtree | libxml (natif) | ? | natif |
| XPath | elementtree (partiel) | libxml (natif) | ? | natif |
| RDF/XML | absent | EasyRDF | ? | rdf (Node.js) |
| RDF/turtle | absent | EasyRDF | ? | rdf (Node.js) |
| ISO date | datetime.strptime (presque) | natif (PHP 4) | ? | natif |
| INI (Win) | ini | natif (PHP 4) | ? | ini (Node.js) |
| CSV | csv | natif (~PHP 5.1) | ? | csv (Node.js) |
| plist (Mac) | plistlib | plist | ? | plist (Node.js) |
| URL | urllib.parse | natif (PHP 4) | ? | natif (Node.js) |
| HTML | html.parser | libxml (natif) | ? | natif |
| robots.txt | urllib.robotparser | robots-txt-parser | ? | robots (Node.js) |
@neovov
Copy link
Author

neovov commented Jul 23, 2013

Pardon, j'aurai dû préciser. Je n'ai pas pris le temps d'ajouter des liens non plus.

J'ai hésité pour Node.js. Le « problème » est qu'on peut se servir de JavaScript côté client et serveur.
Quelques petites précisions :

  • Le base64 est natif dans les navigateurs (fonctions atob et btoa). On peut sûrement trouver des bibliothèques sur NPM dédié pour Node.js
  • J'ai déduis que le support de XML/XPath/HTML était natif sous Node.js mais je ne m'en suis jamais servi. Comme c'est « natif » côté navigateur, je suppose que ça l'est également côté serveur (ça serait dommage pour un langage orienté web sinon)

Dernière remarque : Parfois on peut trouver plusieurs bibliothèques dédié à un format. Certaines ne proposent que du parsing alors que d'autres proposent de l'écriture également.

@karlcow
Copy link

karlcow commented Jul 23, 2013

merci. Je vais pouvoir compléter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment