Skip to main content

Klarg

A Kommand Line ARGument parsing library.

Klarg is a small and simple command line argument parsing library built with no 3rd party dependencies.

Why use klarg?

Simple syntax

It abstracts all the complexities away so that you can focus on developing the appication itself.

# example.py
import klarg
name = klarg.get_str("name")
print(f"Your name is: {name}")

# python example.py --name klarg
# Your name is: klarg

Easy configuring

It makes use of the powerful dictionary data type to make configuring klarg a breeze.

# example.py
import klarg

# Replace -- with +
CONFIG["long_prefix"] = "+"
name = klarg.get_str("name")
print(f"Your name is: {name}")

# python example.py +name klarg
# Your name is klarg

Simple data types

Klarg only returns basic data types such as int, float, str and bool. This means no converting from strings to integers, or to booleans, klarg already does that.

# example.py
import klarg

is_there = klarg.get_bool("is-there")
if is_there:
    print("I am here")
else:
    print("I am not here")

# python example.py --is-there
# I am here

No 3rd party dependencies

Klarg was specifically designed not to include any external dependencies, helping to keep the size small.

Installation

Installing klarg is incredibly simple, just type in

pip install klarg

How to use?

# example.py
import klarg
klarg_is_cool = klargs.get_bool(long="klarg-cool", short="k")
klargs.on_help(do_something)

if (klarg_is_cool):
    print("Oh, my, klarg is cool.")

# python example.py --klarg-cool
# Oh, my, klarg is cool.

# python example.py -k
# Oh, my, klarg is cool.

Check out the Documentation for more.

Metadata

Release files for klarg 1.1.0

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

Source distribution (sdist)

Source distribution for klarg 1.1.0
File Size Uploaded Provenance Actions
klarg-1.1.0.tar.gz 8.1 kB Without provenance Details for klarg-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for klarg 1.1.0
File Interpreter ABI Platform Actions
klarg-1.1.0-py3-none-any.whl Python 3 none any Details for klarg-1.1.0-py3-none-any.whl

Total release size: 15.1 kB

Release files / klarg-1.1.0.tar.gz

Download URL klarg-1.1.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a09956d7054162e5646397001117bffe9eda95240f9d9713ea91ed50f460c572
BLAKE2b-256 checksum
How to use checksums
718196e3c9072365b65f721931a2a7cb941ef898390c663ee8d788b3d02fe543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / klarg-1.1.0-py3-none-any.whl

Download URL klarg-1.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9077e76dbdb57eafc2606069c8b8a2e9fd2ff92c5bcc28ac6177aca7af5a1be8
BLAKE2b-256 checksum
How to use checksums
34cacd34543009daf0a04e88f43ad28525a2fb1a2dac47a1bfdad1778d5a9882
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Security for klarg 1.1.0

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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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