Skip to main content

serialize all of python (almost)

Project description

Dill extends python’s ‘pickle’ module for serializing and de-serializing python objects to the majority of the built-in python types. Serialization is the process of converting an object to a byte stream, and the inverse of which is converting a byte stream back to on python object hierarchy.

Dill provides the user the same interface as the ‘pickle’ module, and also includes some additional features. In addition to pickling python objects, dill provides the ability to save the state of an interpreter session in a single command. Hence, it would be feasable to save a interpreter session, close the interpreter, ship the pickled file to another computer, open a new interpreter, unpickle the session and thus continue from the ‘saved’ state of the original interpreter session.

Dill can be used to store python objects to a file, but the primary usage is to send python objects across the network as a byte stream. Dill is quite flexible, and allows arbitrary user defined classes and funcitons to be serialized. Thus dill is not intended to be secure against erroneously or maliciously constructed data. It is left to the user to decide whether the data they unpickle is from a trustworthy source.

Dill is part of pathos, a python framework for heterogeneous computing. Dill is in the early development stages, and any user feedback is highly appreciated. Contact Mike McKerns [mmckerns at caltech dot edu] with comments, suggestions, and any bugs you may find. A list of known issues is maintained at http://trac.mystic.cacr.caltech.edu/project/pathos/query.

Major Features

Dill can pickle the following standard types:

- none, type, bool, int, long, float, complex, str, unicode,
- tuple, list, dict, file, buffer, builtin,
- both old and new style classes,
- instances of old and new style classes,
- set, frozenset, array, functions,

Dill can also pickle more ‘exotic’ types:

- functions with yields, nested functions, lambdas
- cell, method, unboundmethod, module, code, methodwrapper,
- dictproxy, methoddescriptor, getsetdescriptor, memberdescriptor,
- wrapperdescriptor, xrange, slice,
- notimplemented, ellipsis, quit

Dill cannot yet pickle these standard types:

- frame, generator, traceback

Dill also provides the capability to:

- save and load python interpreter sessions
- save and extract the source code from functions and classes
- interactively diagnose pickling errors

Current Release

The latest released version is dill-0.2a1. You can download it here. The latest stable version of dill is always available at:

http://dev.danse.us/trac/pathos

Development Release

You can get the latest development release with all the shiny new features at:

http://dev.danse.us/packages

or even better, fork us on our github mirror of the svn trunk:

https://github.com/uqfoundation

Installation

Dill is packaged to install from source, so you must download the tarball, unzip, and run the installer:

[download]
$ tar -xvzf dill-0.2a1.tgz
$ cd dill-0.2a1
$ python setup py build
$ python setup py install

You will be warned of any missing dependencies and/or settings after you run the “build” step above.

Alternately, dill can be installed with easy_install or pip:

[download]
$ easy_install -f . dill

Requirements

Dill requires:

- python, version >= 2.5  *or*  version >= 3.1

Optional requirements:

- setuptools, version >= 0.6
- objgraph, version >= 1.7.2

Usage Notes

Probably the best way to get started is to look at the tests that are provide within dill. See dill.tests for a set of scripts that test dill’s ability to serialize different python objects. Since dill conforms to the ‘pickle’ interface, the examples and documentation at http://docs.python.org/library/pickle.html also apply to dill if one will import dill as pickle.

License

Dill is distributed under a 3-clause BSD license:

>>> import dill
>>> print (dill.license())

Citation

If you use dill to do research that leads to publication, we ask that you acknowledge use of dill by citing the following in your publication:

M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis,
"Building a framework for predictive science", Proceedings of
the 10th Python in Science Conference, 2011;
http://arxiv.org/pdf/1202.1056

Michael McKerns and Michael Aivazis,
"pathos: a framework for heterogeneous computing", 2010- ;
http://dev.danse.us/trac/pathos

More Information

Please see http://dev.danse.us/trac/pathos or http://arxiv.org/pdf/1202.1056 for further information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

dill-0.2a1.zip (34.7 kB view details)

Uploaded Source

dill-0.2a1.tgz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dill-0.2a1.win32.exe (91.1 kB view details)

Uploaded Source

File details

Details for the file dill-0.2a1.zip.

File metadata

  • Download URL: dill-0.2a1.zip
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dill-0.2a1.zip
Algorithm Hash digest
SHA256 5de92063ceb66683ae1640ff1e114e9d660eeb674a6b025f7a1cf9cfd25ea2f7
MD5 d6a3016f6f0a5b36c059c77c41c3e21f
BLAKE2b-256 b9b949a2b1db0765691940bc67d330a027fe9fd23cef28ea42b8c476f87f1b2f

See more details on using hashes here.

File details

Details for the file dill-0.2a1.tgz.

File metadata

  • Download URL: dill-0.2a1.tgz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dill-0.2a1.tgz
Algorithm Hash digest
SHA256 4a3bf154741c8d7d0a13e9af34421621cf13321b09078a4760a8a6c9cde1c73b
MD5 34d0258df5c7258c0cd781025899c2c4
BLAKE2b-256 7a248ad532f3837a347b16ff173e83b29e264da37eadfbd58ed260a0a4546a4d

See more details on using hashes here.

File details

Details for the file dill-0.2a1.win32.exe.

File metadata

  • Download URL: dill-0.2a1.win32.exe
  • Upload date:
  • Size: 91.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dill-0.2a1.win32.exe
Algorithm Hash digest
SHA256 a6b0d3d16f0a387157d5fd0750b1bbf0f69eed2c66fd17cbbfcc8facc44d89a5
MD5 fc9ad093a26f3262ed8a598722de96ab
BLAKE2b-256 640ba2734c03bff1505f69a0a1ba77c83c20cf6acb6bbd91c1d64f7f370376d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page