Skip to main content

jobject

pypi version MIT License

JObject: A dictionary replacement that gives additional access to data using C struct notation, just like JavaScript Objects

Installation

pip install jobject

Import

from jobject import JObject

my_dict = JObject({'one': 1, 'two': 2, 'three': 3})

print(my_dict.three) # prints '3'

Inheritance

Because JObject extends dict it can be dropped into any code that requires dict notation or iteration. Because of this, JObject makes sure any dictionary instances that are passed to it are also converted into JObjects

from jobject import JObject

my_dict = JObject({
	'one': {
		'two': {
			'three': 123
		}
	}
})

print(my_dict.one.two.three) # prints '123'

It will even follow lists to make sure everything under it is converted to a JObject

from jobject import JObject

my_dict = JObject({
	'array': [
		{'one': 1},
		{'two': 2},
		{'three': 3}
	]
})

print(my_dict[2].three) # prints '3'

This even includes data set after the fact

from jobject import JObject

my_dict = JObject()

my_dict.test = {
	'one': [
		{'two': 2}
	]
}

print(my_dict.test.one[0].two) # prints '2'
print(my_dict['test']['one'][0]['two']) # prints '2'

Metadata

Release files for jobject 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jobject 1.0.0
File Size Uploaded
jobject-1.0.0.tar.gz 4.0 kB Details

Release files / jobject-1.0.0.tar.gz

Download URL jobject-1.0.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
01cadc1e207332b30b422f308ac75bf938c6a5beced2b6dfcde6e0df52354c38
BLAKE2b-256 checksum
How to use checksums
7213e48026879b53f74c30ab8359c1a2fa2948448646971c598d899e4fa90217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 colorama/0.4.5 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.1 rfc3986/1.5.0 tqdm/4.64.0 urllib3/1.26.9 CPython/3.10.6

Release history Release notifications | RSS feed

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page