Skip to main content

Seamless serialization and deserialization of complex Python objects — a more flexible and readable alternative to pickle for data science workflows.

Project description

DataZip

Actions status GitHub Pages Status Ruff

DataZip is a Python library that extends zipfile.ZipFile to provide seamless serialization and deserialization of complex Python objects — a more flexible and readable alternative to pickle for data science workflows.

Why DataZip?

  • Human-inspectable archives: DataZip files are standard .zip files. You can open them with any archive tool and inspect the contents.
  • Broad type support: Works out of the box with pandas DataFrames/Series, NumPy arrays, Polars DataFrames, datetimes, paths, sets, frozensets, complex numbers, and custom classes.
  • Efficient storage: Tabular data is stored as Parquet; arrays as .npy. JSON is used for metadata and simple types.
  • No pickle by default: Most types are serialized without pickle, making files safer and more portable.
  • Custom class integration: Any class that implements __getstate__/__setstate__ (the standard pickle protocol) works automatically. The IOMixin makes it even simpler.

Quick Example

from io import BytesIO
import pandas as pd
from datazip import DataZip

# Write
buffer = BytesIO()
with DataZip(buffer, "w") as z:
    z["df"] = pd.DataFrame({"x": [1, 2, 3], "y": [4, 5, 6]})
    z["config"] = {"threshold": 0.5, "labels": ["a", "b"]}
    z["values"] = {1, 2, frozenset([3, 4])}

# Read
with DataZip(buffer, "r") as z:
    df = z["df"]
    config = z["config"]

Supported Types

Category Types
Primitives str, int, float, bool, None, complex
Collections dict, list, tuple, set, frozenset, deque, defaultdict
Date/Time datetime, pandas.Timestamp
Paths pathlib.Path
NumPy numpy.ndarray
Pandas pandas.DataFrame, pandas.Series
Polars polars.DataFrame, polars.LazyFrame, polars.Series
Custom Any class with __getstate__/__setstate__
Optional Plotly figures

See the Installation page for full details including optional dependencies.

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

datazip-0.2.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

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

datazip-0.2.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file datazip-0.2.0.tar.gz.

File metadata

  • Download URL: datazip-0.2.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for datazip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 964f826feaee2dfc7761b82cb71ee3a3dbb15eefb598db701073e0105417f05a
MD5 7a1386766e11b299af1f0d466591d099
BLAKE2b-256 f42d8fdf06cbc4f6c19850e056ca5d2054be3d09be0a768c635226b499ebf885

See more details on using hashes here.

File details

Details for the file datazip-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: datazip-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for datazip-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ced2d62d75de7e8ce7ae3794939ef7271b40073bdef262ea4798dc8e0f653d2
MD5 840e756d458d965b62a7e75b810143a6
BLAKE2b-256 8c5df91158937b03a6c95c1715766fec070224138a19d997fac8723db6091cd3

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