Skip to main content
Fractal Output
======================================

|Build Status| |Version| |Pyversions|

Provides a presentation and transformation layer for complex data output, the like found in RESTful APIs, and works really well with JSON. Think of this as a view layer for your JSON/YAML/etc. Based on https://fractal.thephpleague.com/

Documentation
~~~~~~~~~~~~~

Usage
^^^^^

Install:
''''''''

.. code:: bash

$ pip install fractal_output

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

.. code:: python

from fractal_output import Manager, Transformer, Item

class UserTransformer(Transformer):
def transform(self, user):
return {
'id': user.id,
'firstName': user.first_name
}

user = YourUserClass()
transformer = UserTransformer()
item = Item(user, transformer)

manager = Manager()
manager.create_data(item).to_json()

''''

.. |Build Status| image:: https://travis-ci.org/jefersondaniel/fractal-output.svg
:target: https://travis-ci.org/jefersondaniel/fractal-output

.. |Version| image:: https://badge.fury.io/py/fractal_output.svg
:target: https://pypi.python.org/pypi/fractal_output

.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/fractal_output.svg
:target: https://pypi.python.org/pypi/fractal_output

Download files

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

Source Distribution

fractal_output-2.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

fractal_output-2.0.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file fractal_output-2.0.0.tar.gz.

File metadata

  • Download URL: fractal_output-2.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fractal_output-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1fde48799be3662567d7293794341b0960c765e868c3ee69f457a6662707ca8c
MD5 1b7fbe1fc5cbb32a9f45d61c683cae22
BLAKE2b-256 07a5f7c0ab1dbdaa34c99a7e892a5e294370f0a1f47d76535490187dc95abcac

See more details on using hashes here.

File details

Details for the file fractal_output-2.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fractal_output-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 82922892b076bbed089a0b7353ada2c7ddf4edef3e38566d783d1f27977ec008
MD5 6f2c53b17d583f970a23d10185522730
BLAKE2b-256 0696ccbdae7c630c337d315b97b2bc7005e33d2738b349d66139e0a4d0842223

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page