objectory
A light library for general purpose object factories
What it is and what it does
objectory is a lightweight Python library that implements factory patterns for dynamic object instantiation. It provides three main approaches: a general-purpose factory function that can instantiate any Python class by name, an abstract factory metaclass for inheritance-based registration, and a standalone registry for explicit class registration. The library is designed to decouple object creation from usage, allowing objects to be instantiated from configuration dictionaries without hardcoding class references.
The package has no runtime dependencies and installs cleanly on modern Python versions (3.10 through 3.14). It is actively maintained but remains in beta, meaning the API may change between releases. It is suitable for scenarios where you need flexible, configuration-driven object instantiation—particularly useful in machine learning pipelines, plugin systems, or any architecture where object types are determined at runtime rather than compile time.
Use it for:
- Building plugin systems where user-provided or configuration-specified classes are instantiated dynamically without modifying core code.
- Machine learning experiment frameworks where model, optimizer, and loss function classes are selected and instantiated from configuration files.
- Dependency injection containers where object graphs are built from declarative configuration rather than imperative setup.
- Testing frameworks that need to instantiate mock or fixture objects by class name from test specifications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides dynamic object factory implementations using abstract factory and registry patterns, allowing objects to be instantiated from configuration without modifying factory code.
Yes, if you need dynamic object instantiation and can tolerate beta-stage API changes. The low install friction, active maintenance, permissive license, and absence of dependencies make it a reasonable choice for configuration-driven architectures. However, pin your version carefully and review release notes before upgrading, since API stability is explicitly not guaranteed.
Install
objectory on PyPI
pip
pip install objectoryuv
uv add objectorypoetry
poetry add objectoryInstalling objectory
Before you install
Low friction installation with no runtime dependencies. Actively maintained with recent releases; however, the package is in beta stage and explicitly warns that API stability is not guaranteed between releases.
License in practice
BSD-3-Clause is permissive and imposes minimal restrictions on use, modification, and distribution in both open-source and proprietary contexts.
Quickstart
pip install objectory
from objectory import factory
obj = factory("builtins.list", [4, 2])
print(obj) # [4, 2]
Requires Python >=3.10; API stability not guaranteed between releases during beta development.
Verify before relying
- Whether the package's registry and abstract factory approaches scale well with large numbers of registered classes.
- Performance characteristics when instantiating objects with complex nested configurations.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 238 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 626,964/month — #5,683 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: objectory-0.3.1-py3-none-any.whl
Keywords: abstract factory, factory, registry
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
phx-class-registryImplements the Registry and Factory patterns to…
permissive · top 15,000 on PyPI
factory-boyfactory_boy replaces static test fixtures with…
permissive · top 1,000 on PyPI
class-resolverDynamically lookup and instantiate classes by…
permissive · top 15,000 on PyPI
pyjon.utilsProvides utility classes for Python…
permissive · top 15,000 on PyPI
pytest-factoryboyIntegrates factory_boy with pytest to register…
permissive · top 5,000 on PyPI
lance-namespaceProvides an abstract interface and plugin…
permissive · top 5,000 on PyPI
makefunDynamically creates Python functions at runtime…
permissive · top 5,000 on PyPI
methoddispatchAdds single-dispatch method support to Python…
permissive · top 15,000 on PyPI
objsizeMeasures the complete memory footprint of…
permissive · top 5,000 on PyPI
py-automapperAutomatically maps object fields from one class…
permissive · top 15,000 on PyPI