Skip to main content

A simple superset of Python with import expressions added in

Project description

Impexpr

A simple superset of Python with import expressions added in. Beware: This project has only been made as a proof of concept and is not intended to ever be used in production.

Installation

pip install impexpr

Quickstart

impexpr alias can be used in the same way as python alias, a few examples:

  • To run an interactive REPL with import expression support, run impexpr
  • To run a script, run impexpr script.py (all imported modules will also support import expressions)
  • To import itertools and use it in the same line:
for x in (import itertools).chain([1, 2], [3, 4], [5, 6]):
    print(x)
  • To get help about collections.deque:
help((import collections).deque)
  • If your script must run with python alias but you want to enable import expression support in all imported modules (not in the main script!), you can use:
import impexpr
impexpr.add_hook()
# this will now support import expressions
import my_other_script
  • For everything else, run impexpr --help

FAQ

  • Relative imports not supported yet

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

impexpr-0.0.5.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

impexpr-0.0.5-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file impexpr-0.0.5.tar.gz.

File metadata

  • Download URL: impexpr-0.0.5.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.38-1-MANJARO

File hashes

Hashes for impexpr-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d3d615be56659c803111b6323ab84f18c970c6481083debab1f14cc1659f92da
MD5 0959857460843341bcd596fc1b542296
BLAKE2b-256 2338d457a69449c6c920e0536ae240235117ed265f75babd70e8605ac375d0cb

See more details on using hashes here.

File details

Details for the file impexpr-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: impexpr-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.15.38-1-MANJARO

File hashes

Hashes for impexpr-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7955026450c662dadc57df5ebc6c9d5c60af92b9bc0830d5ecbb1fe1ef57479a
MD5 394758b89d37ee5c15acbbee5a549dfd
BLAKE2b-256 c4174ee0f412f59becde86b939c55c44a10e7c88e1a73d97b5024ba49b07108c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page