banal
Commons of banal micro-functions for Python.
Decision gist · record as of 2026-08-14
Yes. banal is a low-friction, zero-dependency utility library with active maintenance, no known vulnerabilities, and permissive MIT licensing. Install it if your project needs these specific type-checking or data-cleaning helpers and wants to avoid writing them yourself. The small scope and lack of external dependencies make it a safe, lightweight addition.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with no runtime dependencies beyond the standard library.
- Repository is active with recent commits.
License · maintenance · safety
MIT (permissive) — MIT license permits use in commercial and private projects with minimal restrictions; you must include the license text in distributions.
last release 2026-04-14 (122 days) · last repo commit 2026-07-25 · 21 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 470,604 downloads/mo, #6,483 on PyPI
Alternatives
Verify before relying
pip install banal
from banal import ensure_list, is_listish, clean_dict
result = ensure_list('item')
if is_listish(result):
cleaned = clean_dict({'key': None, 'nested': {'val': 1, 'null': None}})- Whether the type-checking functions handle all edge cases developers encounter in practice
- Performance characteristics when cleaning deeply nested dictionaries
- Adoption rate or usage patterns among projects that depend on it
What it is and what it does
banal is a lightweight utility library that exports a handful of type-checking and data-manipulation functions designed to reduce boilerplate when working with uncertain types in Python. It solves the common problem of needing to check whether a value is list-like or dict-like, ensure a value is wrapped in a list, recursively remove null values from nested dictionaries, and generate SHA1 hashes from structured data. The library has no external dependencies—it uses only the Python standard library—and is fully type-annotated to pass mypy. It's intended as a shared commons module that projects can import to avoid duplicating these small but frequently needed utilities.
The package is actively maintained, supports Python 3.10 through 3.13, and carries no known security vulnerabilities. It is small and focused, with no complex dependency tree, making it a low-risk addition to any project that needs these specific helper functions.
Use it for
- Normalize function arguments that might be a single item or a list using ensure_list to standardize handling
- Validate or guard against type mismatches in data processing by checking is_listish or is_mapping
- Clean API responses or configuration dictionaries by recursively removing null values with clean_dict
- Generate consistent hashes of structured data for caching or deduplication using hash_data
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
banal is a low-friction, zero-dependency utility library with active maintenance, no known vulnerabilities, and permissive MIT licensing. Install it if your project needs these specific type-checking or data-cleaning helpers and wants to avoid writing them yourself. The small scope and lack of external dependencies make it a safe, lightweight addition.
Install
banal on PyPI
Before you install
Low install friction with no runtime dependencies beyond the standard library. Repository is active with recent commits. Supports Python 3.10, 3.11, 3.12, 3.13.
Requires Python 3.10 or later.
License in practice
MIT license permits use in commercial and private projects with minimal restrictions; you must include the license text in distributions.
Quickstart
pip install banal
from banal import ensure_list, is_listish, clean_dict
result = ensure_list('item')
if is_listish(result):
cleaned = clean_dict({'key': None, 'nested': {'val': 1, 'null': None}})
Verify before relying
- Whether the type-checking functions handle all edge cases developers encounter in practice
- Performance characteristics when cleaning deeply nested dictionaries
- Adoption rate or usage patterns among projects that depend on it
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 122 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 470,604 / month, #6,483 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: banal-1.1.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “type checking utilities python”
- banalProvides type-checking and data-cleaning utility functions for…
- typing-utilsProvides utilities to inspect and validate Python type annotations,…
- typing-inspectProvides runtime inspection utilities for Python's typing module,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also python-utils · vonage-utils · dm-tree · wimpy · SQLAlchemy-Utils · pyjanitor · commoncode · kitchen · lamin_utils · result