Skip to main content

Post Perception's RecordIO facsimile.

Project description

PostPerception's facsimile of Google's RecordIO library (no direct relation other than name). This is a binary format for storing sequences of arbitrary binary data, usually protocol buffers. It tolerates corruption of the underlying data and uses a CRC32 checksum to detect data corruptions. Supports Linux x86, Linux aarch64, Darwin x86, and Apple Silicon (Darwin amd64).

The core implementation is done in golang and exposed to python by wrapping
using `cgo`.

Example Usage:

```python
# Import the module.
from pp_recordio import pp_recordio as rio

FILENAME = "test.pp_recordio"
w = rio.RecordWriter(FILENAME)
w.write(b'This is a binary blob!')
w.write(b'Individual messages can be quite big.!')
w.write(b'Protocol buffers are good to store here!')

r = rio.RecordReader(FILENAME)
for item in r.read():
  print(item)
```

## Technical Details

The frame is composed of a header followed by the actual data. The total frame
size is variable, depending on the size of the data being stored.

#### Frame Header Description

- Magic Number: 4 bytes; constant value: 0xDEADBEEF. Used to identify the start
  of a frame.
- Length: 8 bytes; stores the total length of the frame (header + data).
- CRC32: 8 bytes; stores the CRC32 checksum of the data for integrity checking.
- Flags: 4 bytes; used to indicate various frame properties (e.g., compression).
- Reserved: 16 bytes; currently unused, reserved for future use.

4 + 8 + 8 + 4 + 16 = 40 bytes total overhead per stored datum.

## Release Notes

### Version 0.1.5

First working version.

Issues I'd like to address / fix:

- Does not tolerate corruption to the frames themselves.
- Does not support sharded paths and requires suffix to be `.pp_recordio`.
- Not thread safe.
- The underlying go library generates a ton of noisy logs. I should clean those up / remove them.
- The underlying go library has a gzip compression feature that should either be removed or exposed to the python interface.

Project details


Download files

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

Source Distribution

pp_recordio-0.1.6.tar.gz (5.0 MB view details)

Uploaded Source

Built Distribution

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

pp_recordio-0.1.6-cp310-cp310-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file pp_recordio-0.1.6.tar.gz.

File metadata

  • Download URL: pp_recordio-0.1.6.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for pp_recordio-0.1.6.tar.gz
Algorithm Hash digest
SHA256 84fd28c3474d64b16cddb83bad7a4f78de9ea206d1a0ce259c1159b7e7bd1980
MD5 1197398454c577705f113af299d5363c
BLAKE2b-256 597c5fb56e4044706c4ad0ba8aa234e6300d4b155bbd20689e50208a5336a8b0

See more details on using hashes here.

File details

Details for the file pp_recordio-0.1.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pp_recordio-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04034434be8f850db4c0ee6557b5cc4f4b4660dde9e398ce5290a773fb249559
MD5 91b39edfb5ed44faf6c3930cd8081b52
BLAKE2b-256 dfd3b943b81a3318dba0618418833e4c03d90a66d66829fc7e23ab89a3dff3dc

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