Metadata-Version: 2.1
Name: chaingang
Version: 0.0.1
Summary: Python class decorator that adds selection chaining
Home-page: https://github.com/eddiethedean/chaingang
Author: Odos Matthews
Author-email: odosmatthews@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown

-----------------

# ChainGang: python class decorator that adds selection chaining
[![PyPI Latest Release](https://img.shields.io/pypi/v/chaingang.svg)](https://pypi.org/project/chaingang/)

## What is it?

**ChainGang** is a Python package that provides a class decorator function that adds selection chaining to classes with nested items.

## Where to get it
The source code is currently hosted on GitHub at:
https://github.com/eddiethedean/chaingang

```sh
# PyPI
pip install chaingang
```

## Example
```sh
from chaingang import selection_chaining

# decorate a class with nested items
@selection_chaining
class ChainList(list):
    ...

cl = ChainList([[1, 2, 3], [4, 5, 6]])

# select inner item with comma separated indexes
cl[1, 2] -> 6
# same as bracket chaining
cl[1][2] -> 6

# set inner item value
cl[1, 2] = 100
cl -> [[1, 2, 3], [4, 5, 100]]

# delete inner item
del cl[1, 1]
cl -> [[1, 2, 3], [4, 100]]
```
