The task manager for python
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for fractal_output-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79539c902672a1a64c0a51e9e88cb1a9488ff2e69a72a2726ad8b09a3704171c |
|
MD5 | 8f178ba509b91f38fc7da9a84df06ebf |
|
BLAKE2b-256 | bafe2b26418ebd1441500dcccea5ee2eef826dd6523ded27aedbee418b4854c9 |