--- id: constantly version: "23.10.4" license: MIT license_treatment: permissive maintenance: active --- # constantly — Symbolic constants in Python License: permissive · Maintenance: active · Downloads: 14.2M/mo ## What it is and what it does Constantly provides a way to define and work with symbolic constants in Python—a more structured alternative to plain module-level variables or enums. It originated from the Twisted project's internal constant system and offers support for text values, numeric values, and bit flags organized into named collections. The library is pure Python with no external dependencies, making it lightweight and easy to integrate. Developers use it when they need a clean, type-safe way to represent a fixed set of named values—such as status codes, configuration options, or protocol flags—without the overhead of a full enum class. It's particularly useful in projects that already depend on Twisted or in codebases where enum semantics don't quite fit the use case. Use it for: - Define status codes or state constants that need to be grouped and referenced by name. - Create bit flag constants for protocol or permission systems where multiple flags combine. - Build configuration option sets that are safer than raw strings or integers. - Organize numeric constants (e.g., error codes) into named collections for clarity. - Replace ad-hoc constant definitions in Twisted-based projects with a standard library. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides symbolic constant support in Python, including collections and constants with text, numeric, and bit flag values. Yes, if you need a lightweight, dependency-free way to define symbolic constants. The library is actively maintained, has no security vulnerabilities, and works across modern Python versions. It's worth installing for projects that benefit from structured constant definitions—particularly those already using Twisted or preferring this API over Python's built-in enum module. ## Install pip install constantly uv add constantly poetry add constantly ## Installing constantly Before you install: Low install friction; pure Python wheel with no runtime dependencies. Active maintenance with recent commits; last release 1021 days ago but repository remains current. License in practice: MIT license (permissive); you can use this freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install constantly from constantly import ValueConstant, Names class Colors(Names): RED = ValueConstant() GREEN = ValueConstant() BLUE = ValueConstant() Requires Python 3.8 or later. Verify before relying: - Whether the package's constant syntax and API remain stable for long-term use in large codebases. - Performance characteristics when working with very large constant collections. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 14.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags symbolic constants python, enum-like constants, constant collections, bit flag constants, typed constants library, constant definitions, python constants module, constants, enum-alternative, twisted [View on SkillFed](https://skillfed.io/packages/constantly) · [View on PyPI](https://pypi.org/project/constantly/)