Skip to main content

Serialization for common Python objects.

Project description

Serialization for common Python objects.

Created to be used in a project, this package is published to github for ease of management and installation across different modules.

Installation

Install from PyPi

pip install serializor

Install from github

pip install git+https://github.com/AresJef/Serializor.git

Compatibility

Supports Python 3.10 and above.

Features

This package is designed to serialize Python object, and deserializes it back to the original (or compatiable) Python object.

Supported data types:

  • string: str -> deserialize to str
  • float: float & numpy.float_ -> deserialize to float
  • integer: int & numpy.int & numpy.uint -> deserialize to int
  • boolean: bool & numpy.bool_ -> deserialize to bool
  • None: None & numpy.nan -> deserialize to None
  • datetime: datetime.datetime, pandas.Timestamp & time.struct_time -> deserialize to datetime.datetime
  • datetime64: numpy.datetime64 -> deserialize to numpy.datetime64
  • date: datetime.date -> deserialize to datetime.date
  • time: datetime.time -> deserialize to datetime.time
  • timedelta: datetime.timedelta & pandas.Timedelta -> deserialize to datetime.timedelta
  • timedelta64: numpy.timedelta64 -> deserialize to numpy.timedelta64
  • decimal: decimal.Decimal -> deserialize to decimal.Decimal
  • complex: complex & numpy.complex_ -> deserialize to complex
  • bytes: bytes, bytearray & numpy.bytes_ -> deserialize to bytes
  • list: list of above supported data types -> deserialize to list
  • tuple: tuple of above supported data types -> deserialize to tuple
  • set: set & frozenset of above supported data types -> deserialize to set
  • dict: dict of above supported data types -> deserialize to dict
  • numpy.ndarray: numpy.ndarray of above supported data types -> deserialize to np.ndarray
  • pandas.Series: pandas.Series of above supported data types -> deserialize to pandas.Series
  • pandas.DataFrame: pandas.DataFrame of above supported data types -> deserialize to pandas.DataFrame

Usage (Serialization & Deserialization)

from pandas import Series
from serializor import serialize, deserialize

obj = Series([1, 2, 3, 4, 5], name="test")
en = serialize(obj)
de = deserialize(en)
print(de)
0    1
1    2
2    3
3    4
4    5
Name: test, dtype: int64

Acknowledgements

serializor is based on several open-source repositories.

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

serializor-1.0.3.tar.gz (464.9 kB view hashes)

Uploaded Source

Built Distributions

serializor-1.0.3-cp312-cp312-win_amd64.whl (688.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

serializor-1.0.3-cp312-cp312-win32.whl (670.9 kB view hashes)

Uploaded CPython 3.12 Windows x86

serializor-1.0.3-cp312-cp312-musllinux_1_1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

serializor-1.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

serializor-1.0.3-cp312-cp312-macosx_10_9_x86_64.whl (735.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

serializor-1.0.3-cp312-cp312-macosx_10_9_universal2.whl (968.5 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

serializor-1.0.3-cp311-cp311-win_amd64.whl (689.2 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

serializor-1.0.3-cp311-cp311-win32.whl (670.4 kB view hashes)

Uploaded CPython 3.11 Windows x86

serializor-1.0.3-cp311-cp311-musllinux_1_1_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

serializor-1.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

serializor-1.0.3-cp311-cp311-macosx_10_9_x86_64.whl (735.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

serializor-1.0.3-cp311-cp311-macosx_10_9_universal2.whl (967.0 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

serializor-1.0.3-cp310-cp310-win_amd64.whl (691.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

serializor-1.0.3-cp310-cp310-win32.whl (673.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

serializor-1.0.3-cp310-cp310-musllinux_1_1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

serializor-1.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

serializor-1.0.3-cp310-cp310-macosx_10_9_x86_64.whl (735.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

serializor-1.0.3-cp310-cp310-macosx_10_9_universal2.whl (967.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page