Get Started¶
It is highly recommended to install in a virtual environment to keep your system in order.
Installing with uv (recommended)¶
The following command installs the latest stable version of the library:
uv pip install objectory
To install the latest development version from GitHub:
uv pip install git+https://github.com/durandtibo/objectory.git
To install a specific version:
uv pip install objectory==0.3.0
Installing with pip¶
The following command installs the latest stable version of the library:
pip install objectory
To install the latest development version from GitHub:
pip install git+https://github.com/durandtibo/objectory.git
To install a specific version:
pip install objectory==0.3.0
Verifying Installation¶
After installation, you can verify that objectory is correctly installed by running:
python -c "import objectory; print(objectory.__version__)"
Or try a simple example:
from objectory import factory
# Create a Counter object from the standard library
counter = factory("collections.Counter", [1, 2, 1, 3])
print(counter) # Output: Counter({1: 2, 2: 1, 3: 1})
Installing from source¶
To install objectory from source, you can follow the steps below.
Prerequisites¶
This project uses uv for dependency management. Please refer to
the uv installation documentation for
installation instructions.
Clone the Repository¶
git clone git@github.com:durandtibo/objectory.git
cd objectory
Create a Virtual Environment¶
It is recommended to create a Python 3.10+ virtual environment:
make setup-venv
This command creates a virtual environment using uv and installs all dependencies including
development tools.
Alternatively, you can create a conda virtual environment:
make conda
conda activate objectory
make install
Install Dependencies¶
To install only the core dependencies:
make install
To install all dependencies including documentation tools:
make install-all
Verify Installation¶
You can test the installation with the following command:
make unit-test-cov
This will run the test suite with coverage reporting.
Development Setup¶
If you plan to contribute to objectory, please also install the development tools.
Using uv:
uv pip install -e ".[dev,docs]"
Using pip:
pip install -e ".[dev,docs]"
Then install the pre-commit hooks:
pre-commit install
See CONTRIBUTING.md for more information about contributing.