Skip to main content

A Python library for serializing and deserializing complex objects to and from JSON

Project description

JSerPy

JSerPy is a Python library for serializing and deserializing complex objects to and from JSON. It provides robust support for handling various Python types including dataclasses, enums, numpy arrays, and custom objects.

Installation

You can install the package directly from GitHub:

pip install git+https://github.com/ronpik/jserpy.git

Usage

Here's a simple example of how to use JSerPy:

from dataclasses import dataclass
from jserpy import serialize_json, deserialize_json

@dataclass
class Person:
    name: str
    age: int

# Create an instance
person = Person(name="John", age=30)

# Serialize to JSON
json_str = serialize_json(person)

# Deserialize back to object
restored_person = deserialize_json(json_str, Person)

assert person == restored_person

Features

  • Supports serialization of complex Python objects
  • Handles dataclasses, enums, numpy arrays, and custom objects
  • Type-safe deserialization
  • Customizable serialization behavior

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

jserpy-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

jserpy-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file jserpy-0.1.0.tar.gz.

File metadata

  • Download URL: jserpy-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jserpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a034e63a06e91511bc75507ccbf164303210dbb3964b912f55b54ae1b66136e5
MD5 0d5457b9dbd0cd1bb8ec3ee84d56df86
BLAKE2b-256 ea7107644e486f50fa9481e274d3b3efa921857205af025d29b5f27cd40144d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for jserpy-0.1.0.tar.gz:

Publisher: python-publish.yml on ronpik/jserpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jserpy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jserpy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for jserpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bce62b7a27c92b551f8c88e7990b01eed5b68d414cc6d2a7f7099db2f60a5d6e
MD5 2a6235a8a894d55fbccec732fddab9c4
BLAKE2b-256 e70d6b419fcfbb079913cad1fb69d35a0895f52164adcaf6b04ff10f3e4362b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for jserpy-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on ronpik/jserpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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