python - Advantages and disadvantages of the pickle, JSON and CSV methods for saving a dictionary -


i've researched multiple methods saving dictionary, such pickle, json , csv, don't see anywhere benefits or restrictions of each of these methods.

pickle:

on plus side, can handle arbitrary objects (with varying levels of work). on minus side flat format not human-readable, , shouldn't used untrusted input. there versioning issues, too; there various different protocols defined.

json:

it's easy move , forth between container (dict, list) , value (string , number) objects , json. it's human-readable (subject "pretty" formatting), used , well-supported (all?) languages. can't handle arbitrary objects pickling can, though.

csv:

arguably simplest format, won't handle nesting while remaining readable , easy parse (it's best suited persisting simple table). there's more work convert , forth json or pickle, too.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -