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.2.tar.gz (7.1 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.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jserpy-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 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.2.tar.gz
Algorithm Hash digest
SHA256 de31fbf86d562d0ecf2a3d3280704de89b70bf1299405ae8974248c279a04f23
MD5 85bd7f5ba17b349ba8084cdd584eaf34
BLAKE2b-256 ca5f4828955fde3d402e4b0f324cc7a1d0ef148aa40cd40aacd46fb52b5bd624

See more details on using hashes here.

Provenance

The following attestation bundles were made for jserpy-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: jserpy-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8dce788d4960846003efcae1400485af47fb1e8ce021c5fbd1f18e328136f52e
MD5 fe9fabac3b5943e35ee418f3e7d5bc7d
BLAKE2b-256 3cf9627810ae752350d5801a7cb70189ec3c1355563b89daa45afe30219034d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for jserpy-0.1.2-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