--- id: banal version: "1.1.2" license: MIT license_treatment: permissive maintenance: active --- # banal — Commons of banal micro-functions for Python. License: permissive · Maintenance: active · Downloads: 470.6K/mo ## 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 above — verify before relying. Provides type-checking and data-cleaning utility functions for Python, focused on handling type uncertainties like checking if something is list-like or dict-like, and cleaning null values from nested structures. 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 pip install banal uv add banal poetry add banal ## Installing banal 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. 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}}) Requires Python 3.10 or later. 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_current - Install friction: low - Maintenance: active - Downloads: 470.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags type checking utilities python, list dict type guards, python type uncertainty helpers, clean null values dict, ensure list conversion, hash data structures, type-checking, utilities [View on SkillFed](https://skillfed.io/packages/banal) · [View on PyPI](https://pypi.org/project/banal/)