Skip to main content

Data structure for complexe enumeration.

Project description

# Python Catalog

Data structure for storing complex enumeration

```python
class Color(Catalog):
_attrs = 'value', 'label', 'other'
red = 1, 'Red', 'stuff'
blue = 2, 'Blue', 'things'
```

Access values as Attributes

```python
>> Color.red.value
<< 1
>> Color.red.label
<< 'Red'
```

Call to look up members by attribute value

```python
>> Color('Blue', 'label')
<< Color.blue
```

Calling without attribute specified assumes first attribute defined in `_attrs`

```python
>> Color(1)
<< Color.red
```

`_attrs` defaults to `['value']`.

Member class can be replaced by extending `CatalogMember` and defining on Catalog with
the `_member_class` attribute

Project details


Release history Release notifications

History Node

1.2.0

History Node

1.1.1

This version
History Node

1.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pycatalog-1.1.0.tar.gz (2.7 kB) Copy SHA256 hash SHA256 Source None Nov 23, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page