Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fire17/expando

xo + xo.redis : Dynamic Dictionary Object Wrapper with superpowers
https://github.com/fire17/expando

Last synced: 2 days ago
JSON representation

xo + xo.redis : Dynamic Dictionary Object Wrapper with superpowers

Awesome Lists containing this project

README

        

# expando
Dynamic Dictionary Object Wrapper

## Installation/Update

```python
python3 -m pip install --upgrade expando xo.redis
```

## import

```python
from xo import xo, Expando
# or
from xo import *
```

## Usage
```python

# Use xo as your root object
xo.foo.bar(17).baz.plus.something = lambda *a, **kv : (f"Hello Expando! {xo.foo.bar.value}" , a, kv)
print(xo.foo.bar.baz.plus.something())

# Create a new Expando object
myStore = Expando()
```

## to reupload to pip after edits (internal use only)
```
# install twine
python3 -m pip install twine
# Skip if you have it already

export VERSION=0.5.5.1
# for xo.redis: export VERSION=0.2.5.5
# Copy/edit setup.py
# update setup.py version
python3 setup.py sdist bdist_wheel
twine upload dist/*

# to install locally (before twine upload)
python3 -m pip install --force-reinstall --no-deps .
```

```
```
# make sure you'd like to commit all changes
git add .
git tag -a $VERSION -m "Release $VERSION"
git commit -m "Release $VERSION"
git push origin --tags
git push
```