File types
pyntree currently supports a plethora of file types:
Pickle (default)
Pickled data is python data saved directly to a file as bytes. This way, you can save objects (ex: datetime) without losing any data or causing any problems while trying to reload the file.
Filetype parameter: pyn
Supported file extensions:
- .pyn
- .pyndb
- .pkl
Compressed (and pickled)
Compressed data can be saved in a variety of formats, thanks to the compress_pickle
module. For a full list of supported file extensions and types, see here.
JSON
JSON data can be saved and loaded with pyndb.
Filetype parameter: json
Supported file extensions:
- .json
Plain text
Saving python objects to a plaintext file will likely cause loading issues since pyntree will use eval() to load the data. This means that if it tries to create an object from a class it hasn't imported, the loading will fail.
You can also save the data as a string representation of the dictionary.
Filetype parameter: txt
Supported file extensions:
- .txt