Skip to main content

Catalog-based data storage system with pluggable serializers

Project description

DataCat - Data Storage System

PyPI version GitHub tag

A data storage system with catalog storage and pluggable serializers.

Features

  • CatalogStorage: Manages DuckDB catalog with hashed file paths
  • Serializer Interface: Pluggable serialization system
  • SparseMatrixSerializer: Handles scipy sparse matrices and numpy arrays
  • NumpyArraySerializer: Pure numpy arrays without pickle dependency

Installation

pip install -r requirements.txt

Usage

With Sparse Matrices

from datacat import CatalogStorage, SparseMatrixSerializer
import numpy as np
import scipy.sparse as sp

# Initialize with sparse matrix support
serializer = SparseMatrixSerializer()
storage = CatalogStorage(
    catalog_columns=['dim1', 'dim2', 'date'],
    serializer=serializer
)

# Save mixed data
data = {
    'returns': sp.csr_matrix([[1, 2, 0], [0, 0, 3]]),
    'stock_names': np.array(['AAPL', 'MSFT']),
    'weights': np.array([0.5, 0.5])
}
storage.save(data, dim1="v1", dim2="v2", date="2024-01-01")

With Pure NumPy Arrays

from datacat import CatalogStorage, NumpyArraySerializer
import numpy as np

# Initialize with numpy-only support (no pickle)
serializer = NumpyArraySerializer()
storage = CatalogStorage(
    catalog_columns=['experiment', 'model', 'date'],
    serializer=serializer
)

# Save pure numpy data
data = {
    'features': np.random.rand(100, 10).astype(np.float32),
    'labels': np.array(['class_A', 'class_B'] * 50),
    'timestamps': np.array(['2024-01-01', '2024-01-02'], dtype='datetime64[D]')
}
storage.save(data, experiment="classification", model="cnn", date="2024-01-01")

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

datacatalog_storage-1.0.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

datacatalog_storage-1.0.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file datacatalog_storage-1.0.0.tar.gz.

File metadata

  • Download URL: datacatalog_storage-1.0.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for datacatalog_storage-1.0.0.tar.gz
Algorithm Hash digest
SHA256 107d422ce36c2cdcbba09ddc71a6dc3c35b45829a59eb550bd559161c2da2503
MD5 8d51034fa755cde05a1f512c14f3395d
BLAKE2b-256 eff14081dd62e7e33aa853ef212e62e9f6c9ce788bc6f047fd5a6cd15f6dd95e

See more details on using hashes here.

File details

Details for the file datacatalog_storage-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for datacatalog_storage-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43add7cb627d3654b97650e14ed564b07948901136b1ad1eb0d172970ab620be
MD5 4c619699b32bd5c7fa23482c071bc3a5
BLAKE2b-256 e7682ae169e4d086b1af47d332bfeb07eb5c96ae33b940bed75dbc4e5aee4f80

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