https://github.com/hapytex/python-pickle
Reading and writing Pickle files in Haskell.
https://github.com/hapytex/python-pickle
Last synced: 8 months ago
JSON representation
Reading and writing Pickle files in Haskell.
- Host: GitHub
- URL: https://github.com/hapytex/python-pickle
- Owner: hapytex
- License: other
- Created: 2023-03-01T11:18:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-31T16:51:59.000Z (over 2 years ago)
- Last Synced: 2025-02-07T10:14:27.515Z (over 1 year ago)
- Language: Haskell
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# python-pickle
Reading and writing Python pickle files, or at least a best effort to do that.
## Introduction
## Python's pickle protocol
Python's pickle protocol consists out of opcodes and optionally parameters that guide the system through loading a file. The machine has a stack and a dictionary to process data. The protocol has not really a fixed prefix as file, but it normally starts with `0x80` as first opcode to set the protocol version, and then `0x05` or `0x04`, the most common protocol numbers. The last opcode is normally a `0x2e`, or a dot, that stops the parser from reading.
For parsing, the protocol has only some influence with regarding to loading the correct modules.