Registry / serialization / zope-dottedname

zope-dottedname

JSON →
library7.1pypypi✓ verified 84d ago

zope.dottedname is a Python library that provides a single `resolve()` function for converting strings containing Python dotted names (e.g., 'os.path.join') into the corresponding Python object (module, class, function, etc.). It is currently at version 7.1 and is actively maintained by the Zope Foundation, with several releases per year to add new Python version support and address maintenance.

pip install zope.dottedname
INSTALL
IMPORT
SIG · ZOPE-DOTTEDNAME
Z
zope-dottedname
serializationpythonv7.1
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

resolve
from zope.dottedname import resolve
The primary and typically only function needed from this library.

The `resolve` function is the core of `zope.dottedname`. It takes a dotted name string and returns the corresponding Python object. It can handle both absolute and relative dotted names, with relative names requiring an additional `relative_to` argument.

from zope.dottedname import resolve # Resolve an absolute dotted name to a module math_module = resolve('math') print(f"Resolved 'math' to: {math_module}") # Resolve an absolute dotted name to a function within a module join_function = resolve('os.path.join') print(f"Resolved 'os.path.join' to: {join_function}") # Resolve a relative dotted name (e.g., '.split' relative to 'os.path') split_function = resolve('.split', relative_to='os.path') print(f"Resolved '.split' relative to 'os.path' to: {split_function}") # Resolve a relative dotted name across package boundaries ('..system' relative to 'os.path') system_function = resolve('..system', relative_to='os.path') print(f"Resolved '..system' relative to 'os.path' to: {system_function}")
Debug
Known issues
breakingVersion 7.0 (2025-09-12) replaced the `pkg_resources` namespace with PEP 420 native namespace. Projects relying on older `pkg_resources` based namespace package discovery might experience issues.
fix
Ensure your project fully supports PEP 420 namespace packages and update any custom tooling that might still depend on `pkg_resources` for namespace resolution.
affects: >=7.0
breakingZope libraries, including `zope.dottedname`, frequently drop support for older Python versions with new major releases. For example, v7.1 dropped Python 3.9, v6.1 dropped Python 3.7 and 3.8, and v6.0 dropped Python 3.6.
fix
Always check the `requires_python` metadata on PyPI or the project's documentation when upgrading `zope.dottedname` to ensure compatibility with your Python environment. Update to a supported Python version if necessary.
affects: >=5.0
gotchaWhen resolving relative dotted names, the `relative_to` argument must be provided. Failing to do so for a relative name will result in a `ValueError`.
fix
For relative dotted names (e.g., starting with a dot), always supply the `relative_to` argument, which should be the dotted name of the module or package from which the relative import is intended.
affects: All versions
Errors
Common errors & fixes
ImportError: No module named 'some_nonexistent_module' (or similar for top-level imports)
The `resolve()` function could not find the specified module at the root of the Python path.
fix
Double-check the spelling of the module name. Ensure the module is installed and accessible in your Python environment. If it's a sub-module, verify the full dotted path (e.g., 'package.submodule').
AttributeError: module 'some_module' has no attribute 'nonexistent_attribute'
The module specified in the dotted name was found, but the subsequent attribute (class, function, variable) does not exist within that module.
fix
Verify the spelling of the attribute. Confirm that the attribute is indeed exposed by the module and that you are using the correct full dotted path to it.
ValueError: relative name '..some_name' requires a 'relative_to' argument
You attempted to resolve a relative dotted name (e.g., `'.some_name'` or `'..some_name'`) without providing the necessary `relative_to` argument.
fix
When resolving relative dotted names, always specify the `relative_to` argument with the full dotted name of the module or package against which the relative path should be resolved. For example: `resolve('.some_function', relative_to='my_package.my_module')`.
Upgrade
Version history
7.1latest on PyPI · released Mar 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
40 hits · last 30 days
node
32
OpenAI (training)
1
Resources
zope-dottedname — pip install zope-dottedname · libregistry