Skip to main content

header

levish: Create your own Shell

Installation

Install levish using pip:

pip install levish

Getting started

Using levish is very easy. We start by importing the 'Shell' class and creating a new Shell object.

from levish import Shell

sh = Shell("MyShell")

After that we can create our first command. We do that by first creating a simple function. The function has to take varargs called '*args'. Then we can add the function to our Shell object using the add_command() method. Pass in our new created function and add a simple description using the 'description' argument.

def hello(*args):
    print("what's up?")

sh.add_command(hello, description="This command prints hello!")

Now we just need to run our shell. We do that by executing the run() function of our Shell object.

Complete code

from levish import Shell

sh = Shell("MyShell")

def cmd_hello(*args):
    print("hello!")

sh.add_command(hello, description="This command prints hello!")

sh.run()

Output

[>] hello
hello!

Other examples can be found in the examples folder.

Metadata

Release files for levish 0.1.8.1

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

Source distribution (sdist)

Source distribution for levish 0.1.8.1
File Size Uploaded Provenance Actions
levish-0.1.8.1.tar.gz 4.2 kB Without provenance Details for levish-0.1.8.1.tar.gz

Release files / levish-0.1.8.1.tar.gz

Download URL levish-0.1.8.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6f977ab64bc4ecec28a97821da671cb4a27ff697ca6dc994a7a245f1a369163c
BLAKE2b-256 checksum
How to use checksums
14479709e8f88a1c534f7ece12fdd7da279f494acdd2ba4a6e3d69754e81f6ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Security for levish 0.1.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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