Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

pyval

Show the value of a python object via command line.

Examples:

$ pyval sys.platform
linux

This is meant to provide a more convenient alternative to:

python -c "import sys; print(sys.platform)"

More complex expressions are possible too:

$ pyval math.pi**2
9.869604401089358

$ pyval 'math.sin(math.pi/4)'
0.7071067811865475

The output can be influenced using one of the following command line arguments:

-r, --repr

Print repr(obj)

-j, --json

Print json.dumps(obj)

-p, --pprint

Print pprint(obj)

-f SPEC, --format SPEC

Print format(obj, SPEC)

Installation

The utility can be installed as follows:

pip install --user eval

It is also possible to simply download val.py and symlink or move under the name of your choice into your PATH, e.g.:

wget https://raw.githubusercontent.com/coldfix/pyval/master/val.py \
    -O ~/.local/bin/pyval

Once either of these is done, it can be used within any python enviroment on your system, as long as it is accessible in PATH.

By default it uses the currently activated environment. In order to use it with unactivated python interpreter, you currently have to call the interpreter manually as follows:

/path/to/python ~/.local/bin/pyval 'math.sin(math.sin/3)'

This module is kept deliberately simple and avoids any dependencies not in the standard library. This allows running the script in any python environment once it is installed on the system, without having to install it in each environment individually.

Changelog

0.0.5

Date: 06.07.2019

  • fix SyntaxError due to unicode symbol on py2

0.0.4

Date: 13.06.2019

  • learn --format SPEC argument

  • learn --json argument

0.0.3

Date: 13.06.2019

  • shorter stack traces in case of error

0.0.2

Date: 12.06.2019

  • add --pprint argument to pretty-print

0.0.1

Date: 12.06.2019

Initial release

  • simple script to print a python object from command line

  • automatically resolves imports as necessary

  • supports --repr option to show repr instead

Metadata

Release files for eval 0.0.5

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

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for eval 0.0.5
File Size Uploaded
eval-0.0.5.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eval 0.0.5
File Interpreter ABI Platform
eval-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.4 kB

Release files / eval-0.0.5.tar.gz

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL eval-0.0.5.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e13bf4181cdf06cadb9d507bcb40aef426849b2949f82e92dfc9926c8600b78e
BLAKE2b-256 checksum
How to use checksums
330c03fd95212dbc0446a2aea1a1f245b61d2d3390f2417ea0969c157a31be03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

Release files / eval-0.0.5-py2.py3-none-any.whl

Download URL eval-0.0.5-py2.py3-none-any.whl
Size 3.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f8e6d7b89f073989b120b75c82b9f4735e4e563f9e33b3598b87035952f6a79c
BLAKE2b-256 checksum
How to use checksums
359285bd70702398dd0491ae0b365d86be0c4f66787689c6c2c04fee6677a81d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

1 release file

0.0.3

1 release file

0.0.2

2 release files

0.0.1

1 release file

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