Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Value Objects in Python

(GitHub has a rendered version of this readme:

This library makes it easy to implement value objects in Python. The library's rationale and usage instructions can be found in this blog post: Value Objects in Java & Python.

Alternative library

Vladimir Keleshev has an alternative Python library for value objects that makes some different design decisions. My library is a combination of techniques I've used before and Vladimir's technique of using __init__ to indicate field name, order, and default values.

Installation via Pip

The easiest way to install this library is to use Pip:

pip install value_objects

Installation via copying files

Alternatively you can just copy the library code directory into your own codebase.

Running Tox tests in Vagrant

Vagrant (with VirtualBox is a great way to run sandboxed experiments on your dev machine. I use Vagrant plus Tox to run this library's tests in Python 2.x and 3.x without affecting my dev machine. The three scripts I use are included in this project. After going through the quick Vagrant tutorial you'll be ready to try them out:

  1. Setup the VM on your dev machine:
  2. Provision and test inside the VM:
  3. The provision script:

Other blog posts

In addition to this project's blog post (Value Objects in Java & Python), you may also be interested in these posts of mine:


No releases published


No packages published