python-benedict
python-benedict is a dict subclass with keylist/keypath/keyattr support, normalized I/O operations (base64, csv, ini, json, pickle, plist, query-string, toml, xls, xml, yaml) and many utilities... for humans, obviously.
What it is and what it does
python-benedict is a drop-in dict subclass that extends Python dictionaries with three main conveniences: keypath access (using dot notation like `d["a.b.c"]`), attribute-style access (like `d.a.b.c`), and keylist access (using lists of keys). It also normalizes I/O operations across common data formats—JSON, YAML, CSV, XML, TOML, INI, HTML, pickle, plist, base64, and query-strings—allowing you to load and save data from files, URLs, or S3 with a single method call.
Because it's a true dict subclass, you can wrap existing dictionaries without breaking code that expects a dict. The package includes utility methods for common operations like flattening, merging, filtering, and searching nested structures. It's fully backward-compatible and well-tested, with optional Pydantic v2 schema validation available when needed.
Use it for:
- Load configuration from JSON, YAML, or TOML files and access nested values using dot notation instead of chained bracket access.
- Parse CSV or query-string data into a dict-like object and traverse results using keypath syntax with list-index support.
- Transform data between formats (e.g., read XML, manipulate as a dict, export as JSON) using unified I/O methods.
- Build dynamic nested structures using attribute assignment (with keyattr_dynamic=True) without pre-creating intermediate dicts.
- Flatten or unflatten nested dictionaries for database storage or API payloads using built-in utility methods.
- Integrate into Django views to parse request parameters with type coercion (e.g., get_int, get_decimal).
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A dict subclass that adds dot-notation access, keypath queries, and normalized I/O for formats like JSON, YAML, CSV, XML, and others.
Yes. Low install friction, active maintenance, permissive MIT license, no known vulnerabilities, and a well-established codebase (since 2019) with solid adoption. Install it if you work frequently with nested dicts, multi-format data loading, or want cleaner syntax for accessing deeply nested values—the keypath and I/O features alone justify it for data-heavy applications.
Install
python-benedict on PyPI
pip
pip install python-benedictuv
uv add python-benedictpoetry
poetry add python-benedictInstalling python-benedict
Before you install
Low friction install with only two runtime dependencies (python-slugify and typing_extensions). Active maintenance with a recent release 38 days ago and 1609 repository stars.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
from benedict import benedict
# Create from dict or data source
d = benedict({"profile": {"name": "Alice"}})
# Access via keypath (dot notation)
name = d["profile.name"]
# Or via attribute access
name = d.profile.name
Verify before relying
- Whether optional I/O backends (S3, URL, filesystem) require additional system dependencies beyond the listed runtime deps
- Performance characteristics when working with deeply nested structures or large datasets
- Compatibility with non-string dictionary keys and edge cases in keypath parsing
Package facts
| License | MIT License Copyright (c) 2019-present Fabio Caccamo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),… (full text in the JSON record) (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — python-slugify, typing_extensions |
| Maintenance | actively maintained — 38 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,470,710/month — #3,870 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_benedict-0.38.0-py3-none-any.whl
Keywords: python, dictionary, dictionaries, dict, benedict, subclass, extended, keylist, keypath, utility, io, data, file, url, read, write, parse, configparser, config, cfg, pickle, plist, base64, csv, html, ini, json, query-string, toml, xml, yaml, clean, clone, deepclone, deepupdate, dump, filter, flatten, groupby, invert, merge, move, nest, remove, rename, search, standardize, subset, swap, traverse, unflatten, unique
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
jsonasobj2Converts JSON data into Python objects with…
permissive · top 15,000 on PyPI
super-collectionsConverts nested JSON and YAML data into Python…
permissive · top 5,000 on PyPI
paradictParadict serializes and deserializes Python…
permissive · top 15,000 on PyPI
easydictEasyDict wraps Python dictionaries to allow…
copyleft · top 5,000 on PyPI
python-boxBox wraps Python dictionaries to enable…
permissive · top 5,000 on PyPI
odProvides shorthand syntax to create OrderedDict…
permissive · top 15,000 on PyPI
json-specImplements JSON Schema, JSON Pointer, and JSON…
permissive · top 15,000 on PyPI
dataclass-csvReads and writes CSV files using Python…
permissive · top 15,000 on PyPI
untangleConverts XML documents into Python objects with…
permissive · top 15,000 on PyPI