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.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for fractal_output-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dfb7e7f2668290f2678e7226780c3a24c1e074063b43b92485631c3f82cae73 |
|
MD5 | 5e24cafa6ba9c5ed66892a607deb1da9 |
|
BLAKE2b-256 | d2dee2c486755ef90deb3dc2de5ea2f8c9ca3282379836275551297d20a2b399 |