Skip to main content

Encoder for the Siren hypermedia format

Project description

Pypi Travis

Persefone is an encoder for the Siren hypermedia format that uses ujson to generate Siren-compliant JSON efficiently.

Usually such encoders work with JSON, so you convert your data to JSON and pass it to the encoder.

The idea behind persefone is to provide a perfomant Siren encoder by removing the JSON conversion step: you pass your data as provided by your ORM and persefone deals with that, returning JSON.

Supported orms and data structures

Persefone currently supports only peewee, but I plan to add support for other ORMs and similar tools.res


Install with pip:

pip install persefone


from persefone.peewee import Siren

Siren(data, '/path', model=MyModel).encode() # returns Siren-valid JSON

If you have a list:

Siren([item, ...], '/path', model=MyModel)


Siren([item, ...], '/path', model=MyModel, total_items=100, current_page=2)


Contributions and feedbacks are welcome. You can just open an issue.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for persefone, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size persefone-0.2.0-py3-none-any.whl (5.0 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size persefone-0.2.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page