Skip to main content

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.

Metadata

Release files for vardict 1.0.5.post0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vardict 1.0.5.post0
File Size Uploaded
vardict-1.0.5.post0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vardict 1.0.5.post0
File Interpreter ABI Platform
vardict-1.0.5.post0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / vardict-1.0.5.post0.tar.gz

Download URL vardict-1.0.5.post0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d6a32ed5cf89938726cf2d3e6412eea2de09bf97be51a435d436f691f474547d
BLAKE2b-256 checksum
How to use checksums
1fa05c63c4dddad58bba8f18d0386b1174c39ff0b7bc73ba53026c6ff6382c4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / vardict-1.0.5.post0-py3-none-any.whl

Download URL vardict-1.0.5.post0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57c1156aa794aa0315a82931d3a6c1c53eda4d70b5515a23b3dd19e2c5122402
BLAKE2b-256 checksum
How to use checksums
c4a79f7948eae1c75aaada0ee1f0daec73b2da847a9731ec8101a71c7cc92af2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.0.5.post0 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page