Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

kyleconroy/fieldmarshal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Field Marshal

Easy marshaling, based on Golang structs

Example

These resources are based on resources from the Docker REST API.

import fieldmarshal


class NetworkSettings(fieldmarshal.Struct):
    ip_address    = str
    ip_prefix_len = int
    gateway       = str
    bridge        = str


class Container(fieldmarshal.Struct):
    network_settings = NetworkSettings
    id               = str
    image            = str


container = Container(id="foo")

print container.id
# "foo"

print container.image
# ""

print fieldmarshal.dumps(Container)
# {
#   "network_settings": {
#      "ip_address": "",
#      "ip_prefix_len": 0,
#      "gateway": "",
#      "bridge": ""
#   },
#   "id": "foo",
#   "image": ""
# }

About

Easy marshaling, based on Golang structs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages