skip to navigation
skip to content

Not Logged In

jsobject 0.10.1

Jsobject is simple implementation JavaScript-Style Objects in Python.

jsobject: Objects for Humans

jsobject is simple implementation JavaScript-Style Objects in Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

Homepage and documentation: https://mavier.github.io/jsobject

Example: “Hello World” with jsobject

from jsobject import Object
data = {
  "boolean": True,
  "null": None,
  "number": 123,
  "objectA": {'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}}
  }

jso = Object(data)

print(jso.boolean)       # True
print(jso.null)          # None
print(jso.number)        # 123
print(jso.objectA)       # {'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}}
print(jso.objectA.a)     # b
print(jso.objectA.c.d)   # e
print(jso.objectA.c.f.g) # h

Download and Install

Install the latest stable release with pip install jsobject, easy_install -U jsobject or download jsobject.py (unstable) into your project directory. There are no hard dependencies other than the Python standard library. Jsobject runs with Python 2.6+ and 3.x.

Testing

To run the tests use the nosetest.

 
File Type Py Version Uploaded on Size
jsobject-0.10.1.tar.gz (md5) Source 2015-03-29 4KB
  • Downloads (All Versions):
  • 41 downloads in the last day
  • 305 downloads in the last week
  • 1239 downloads in the last month