Skip to content

hamidnazari/python-ostruct

Repository files navigation

ostruct

Package Status Build Status Coverage

OpenStruct for Python.

from ostruct import OpenStruct

car = OpenStruct()
car.make = 'Ford'
car.model = 'Mustang'
car.owner.name = 'John Doe'
car.owner.age = 30

print(car) # {'owner': {'age': 30, 'name': 'John Doe'}, 'make': 'Ford', 'model': 'Mustang'}

Install

$ pip install ostruct

Note: the latest version to support Python 2.7 is ostruct==3.0.1.