Skip to main content

The task manager for python

Project description

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:

$ pip install fractal_output

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()

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

fractal_output-1.0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

fractal_output-1.0.1-py2.py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 2 Python 3

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