Skip to main content

ValueObject is a dict-like object that exposes keys as attributes.

Project description

b"ValueObject |Build Status|\n==========================\n\nLicense: ISC - See LICENSE file\n\n``ValueObject`` is a ``dict``-like object that exposes keys as\nattributes. You can use it like a regular dictionary (in fact, it is a\nsubclass and does not override its ``__init__``). You can use attribute\nor item access to get or set values.\n\n::\n\n >>> from valueobject import ValueObject\n >>> vo = ValueObject(key=1)\n >>> vo['key']\n 1\n >>> vo.key\n 1\n >>> vo['key'] += 1\n >>> vo.key += 1\n >>> vo['key']\n 3\n >>> vo.key\n 3\n\nUsability notes:\n----------------\n\n- If you need to access a key that is not a valid Python identifier\n (for example, it includes spaces), use regular dict access.\n- All regular ``object``, ``dict`` and ``ValueObject`` methods will be\n returned on attribute access. A key such as ``copy`` needs to be\n accessed via item access syntax (e.g. ``valueobject['copy']``).\n\n.. |Build Status| image:: https://travis-ci.org/rbu/valueobject.svg?branch=master\n :target: https://travis-ci.org/rbu/valueobject\n"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valueobject-1.0.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page