extras
Useful extra bits for Python - things that shold be in the standard library
Decision gist · record as of 2026-08-14
Yes, if you need safe optional-import handling or attribute checking without side effects. The package is stable, has no dependencies, and carries permissive licensing. However, the last release was 2016-05-18 and the codebase is aging; verify that its behavior aligns with your Python version and use case before adopting it in new projects.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure-Python wheel.
- Maintenance is aging: last release was 2016-05-18 and repository has not been updated since 2026-02-03, though it remains unarchived.
License · maintenance · safety
UNKNOWN (permissive) — Distributed under the MIT license, which is permissive and carries no restrictions on commercial or private use.
last release 2016-05-18 (3740 days) · last repo commit 2026-02-03 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 599,330 downloads/mo, #5,829 on PyPI
Alternatives
Verify before relying
pip install extras
import extras
mod = extras.try_import('some_optional_module')
has_attr = extras.safe_hasattr(obj, 'attribute_name')- Whether try_import and try_imports handle exceptions beyond ImportError
- Whether safe_hasattr differs meaningfully from getattr with a default in modern Python
- Current compatibility with Python 3 versions beyond what the fact sheet specifies
What it is and what it does
extras is a small standard-library extension module originally factored out from testtools. It provides three utility functions for safer and more flexible attribute and import handling: try_import attempts to import a module and returns None on failure, try_imports tries a sequence of imports and returns the first successful one, and safe_hasattr checks for attribute existence without triggering property side effects.
The package has no runtime dependencies and installs as a pure-Python wheel with low friction. It is intended for developers who want cleaner code when dealing with optional dependencies or when they need to check for attributes in ways that avoid unintended side effects from property getters.
Use it for
- Gracefully handle optional dependencies in a library without try-except boilerplate
- Attempt imports from multiple sources and use the first available one
- Check for attribute existence on objects with properties that have side effects
- Reduce defensive import patterns in helper modules
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need safe optional-import handling or attribute checking without side effects.
The package is stable, has no dependencies, and carries permissive licensing. However, the last release was 2016-05-18 and the codebase is aging; verify that its behavior aligns with your Python version and use case before adopting it in new projects.
Install
extras on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging: last release was 2016-05-18 and repository has not been updated since 2026-02-03, though it remains unarchived.
License in practice
Distributed under the MIT license, which is permissive and carries no restrictions on commercial or private use.
Quickstart
pip install extras
import extras
mod = extras.try_import('some_optional_module')
has_attr = extras.safe_hasattr(obj, 'attribute_name')
Verify before relying
- Whether try_import and try_imports handle exceptions beyond ImportError
- Whether safe_hasattr differs meaningfully from getattr with a default in modern Python
- Current compatibility with Python 3 versions beyond what the fact sheet specifies
Package facts
| License | UNKNOWN permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 3,740 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 599,330 / month, #5,829 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 LicenseProgramming Language :: PythonProgramming Language :: Python :: 3 |
Evidence: extras-1.0.0-py2.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 › “optional import handling”
- extrasProvides three utility functions—try_import, try_imports, and…
- lazy-importsDefers loading of module attributes and their dependencies until…
- lazy-loaderLazy-loader defers the import of subpackages and external libraries…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also lazy-imports · mock · testtools · none · streamlit-extras · urllib3-secure-extra · types-mock · emport · SQLAlchemy-Utils · pyflakes