Skip to main content

Python Dict with classlike access to its contents (dot.notation,creates missing keys on the fly,...)

Project description

Clict

Python Dict with classlike access to its contents (dot.notation,creates missing keys on the fly,...)

Dict VS Clict:

Creation & Initialisation:

Dict only one step:

x={'y': 'z'}

or

x=dict(y=z)

Clict you need to call the class first:

a=Clict()

Then these work:

a.b='c' 				
	# or
a['b']= 'c'
# you can call the class and populate when doing so,
Clict(a=1, b=2) 

note: this works recursively if the key doesnt exist for that Clict , its created as a new Clict so this works for initializing deeply nested 'dicts' :

a=Clict()
a.b.c.d.e.f.g.h.i.j=''

Usage:

you can both assign and recall values by the dot notation as with the conventional dict square brackets, and they can be mixed in a single lookup, However where you can create a dict with

a={}

Clict unfortunatly cannot be a drop in replacement for dicts as the only way to create one is by calling the Class on it. Then you can assign values to keys in it.

a=Clict(
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clict-0.5.4.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Clict-0.5.4-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file clict-0.5.4.tar.gz.

File metadata

  • Download URL: clict-0.5.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for clict-0.5.4.tar.gz
Algorithm Hash digest
SHA256 5798d79e49ac288551a559c3e4eb99909c90c8da887da11518525dbdb9620600
MD5 c076427b88da63015c91823dd2341c96
BLAKE2b-256 c0cd82cefeaddc54bd2ff11de77ee11242da13841d73e9d60a99f74f33bf82be

See more details on using hashes here.

File details

Details for the file Clict-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: Clict-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for Clict-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bdfc8ebff2ad48b94e1f3ce942faf55c9643df89e17723725be7745ea5107d30
MD5 08bcf3e13bf323f5371b0b97fb820715
BLAKE2b-256 774d2a982f9224a9b134c27ff92d36031130dac44ec7319699e6bc5c01d08815

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page