Metadata-Version: 2.4
Name: vardict
Version: 1.0.5
Summary: vardict - dict with variables
Author-email: Ruud van der Ham <rt.van.der.ham@gmail.com>
Project-URL: Homepage, https://github.com/salabim/vardict
Project-URL: Repository, https://github.com/salabim/vardict
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: executing>=2.2.0

 <img src="https://www.salabim.org/vardict/vardict_logo.png">

### Changelog

For the changelog, see www.salabim.org/vardict/changelog .

### Introduction

With vardict, it is possible to build up a dictionary based on variable names and their value.
For instance,

```
first_name = "John"
last_name = "Smith"
name = vardict(first_name, last_name)
```
Now, `name` will be `dict(first_name='John', last_name='Smith')`.

In the same call, additional keywords can be added:

```
name = vardict(first_name, last_name, age=21, nationality="FR")
```
Now, `name` will be `dict(first_name='John', last_name='Smith', age=21, nationality='FR')`.

This functionality is handy for calling functions with (many) keyword arguments, e.g. with salabim:
```
for x in range(1001,100):
    for y in range(701, 100):
        text = f'{x}-{y}'
        sim.Animatext(**vardict(x, y, text, angle=45)) # instead of sim.Animatext(**vardict(x=x, y=y, text=text, angle=45))
```
Note that only variables are allowed, so no literals or expressions.


### Usage
Importing can be done with
```
import vardict
```
or
```
from vardict import vardict
```

### Installation
Just install with `pip install vardict`.
