RubyMarshal’s documentation


Read and write Ruby-marshalled data. Only basics Ruby data types can be read and written:

  • float,
  • bool,
  • int,
  • str (mapped to unicode in Python 2),
  • nil (mapped to None in Python),
  • array (mapped to list),
  • hash (mapped to dict),
  • symbols and other classes are mapped to specific Python classes.
from rubymarshal.reader import loads, load
from rubymarshal.writer import writes, write
with open('my_file', 'rb') as fd:
    content = load(fd)
with open('my_file', 'wb') as fd:
    write(fd, my_object)


pip install rubymarshal
API Documentation
The complete API documentation, organized by modules

Indices and tables