How do you properly python cast json as object? Best practices? or What's the correct way to python c

18 Replies, 876 Views

For a funky approach, try `jsonobject`:

```python
from jsonobject import JsonObject

class Person(JsonObject):
name = StringProperty()
age = IntegerProperty()

data = Person(json.loads('{"name": "Sam", "age": 40}'))
```

It’s a bit niche but great for schema-heavy stuff.

Messages In This Thread



Users browsing this thread: 1 Guest(s)