skillfed

objectory

A light library for general purpose object factories

objectory v0.3.1 627.0K downloads/30d#5,683 on PyPI0
Permissive license BSD-3-Clause Active released

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 objectory

uv

uv add objectory

poetry

poetry add objectory

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development :: Libraries

Tags

object factory patterndynamic object instantiationregistry-based factoryabstract factory implementationconfiguration-driven object creation
factory-patterndependency-injectionconfiguration-driven

More Libraries packages