Skip to main content

dictf

An extended Python dict implementation that supports multiple key selection with a pretty syntax.

How to use it

First you install the package with pip

pip install dictf

Then you can use it like this:

from dictf import dictf


example_dictf = dictf(name="Led Zepellin", singer="Robert Plant", guitarist="Jimmy Page")

print(example_dictf["name"])
>>> 'Led Zepellin'

print(example_dictf[["name"]])
>>> {'name': 'Led Zepellin'}

# The pandas inspired syntax makes it easy to understand how the lib works
print(example_dictf[["name", "singer"]])
>>> {'name': 'Led Zepellin', 'singer': 'Robert Plant'}

# The return type is a dictf whenever you use a list, tuple or set as key
print(type(example_dictf[["name", "singer"]]))
>>> dictf

# If one key doesn't exist, a KeyError is raised
print(example_dictf[["name", "singer", "drummer"]])
>>> KeyError

Currently you can not make multiple assignments at the same time, and I'm not sure we need to add this functionality. I'm open to suggestions, though!

Contributing

Contributions are welcome and appreciated. Make sure to read our guide for contributing and don't forget to check out our code of conduct.

Also, please do check out our other libs as well such as https://github.com/Eric-Mendes/unexpected-isaves.

Metadata

Release files for dictf 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 dictf 1.0.0
File Size Uploaded
dictf-1.0.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dictf 1.0.0
File Interpreter ABI Platform
dictf-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / dictf-1.0.0.tar.gz

Download URL dictf-1.0.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bb79f7fbc31292058c889f005c250a675dd9339005449c7e025c486372b97cbd
BLAKE2b-256 checksum
How to use checksums
c5a0b63b37021568ec0d0a1e86c7e6c26e961f8ff1661fb58a6dfe64bc3e52d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / dictf-1.0.0-py3-none-any.whl

Download URL dictf-1.0.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c872c61ebc22d8bd7e17d948a17b83eb784178f7cc0dd382c8432f2fe7441007
BLAKE2b-256 checksum
How to use checksums
cb4e2dd8e1727ba2532ec2607134517e552d398a651a7083386d0ea2f0cb6f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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