
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Convert your JSON data to a valid Python object to allow accessing keys with the member access operator(.)
Allows you to transform JSON data into an object whose members can be queried using the member access operator. Unlike json.dumps
in the standard library that returns a dictionary object, this library returns a JSONObjectMapper object. The attributes of these objects are defined by the contents of the JSON data provided to it
import datetime
from json2obj import JSONObjectMapper
person = JSONObjectMapper("""{
"name" : "trumpowen" ,
"age" : 125
}""")
person.name == "trumpowen" # true
person.age == 125 # true
# replaces and overwrites
person.name = {}
person.name.first_name = "Wilkins"
person.name.last_name = "Owen"
person.name.other_names = ["Trump"]
# add new attribute. If this is not desired, you can initialize the object with readonly set to True. This will prevent the addition of new attributes and changing the values of existing attributes
person.dob = datetime(1900, 12, 6)
json_data = str(person) # returns a string representation
json_as_dict = person.to_dict() # returns a dictionary representation
Use help(obj)
, where obj is an instance of JSONObjectMapper
FAQs
Convert your JSON data to a valid Python object to allow accessing keys with the member access operator(.)
We found that json2obj demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.