kien is python3 library that allows you to create a custom line-based command parser with the goal of creating shell-like interfaces. kien is not a shell and doesn’t try to be.
If you want to provide an human and machine friendly text-based interface on a serial device kien is for you. kien’s best-case scenario: you’re just writing the code that actually does things.
Please note that kien is under active development and does not have a stable API yet. Breaking changes will occur between minor versions as long as we didn’t publish v1.0.0 but will be documented in the changelog.
kien has support for:
- (optional) keywords
- variables
- validation
- transformation
- auto-generated help and documentation
- dependency-injection
- human-readable and json output
- tty handling
Examples
kien mostly works by annotating functions with decorators. See the examples folder 😊
# run examples with pipenv
pipenv run example examples/say-some-name.py
# or using your shell powers
# (install dependencies first or initialize and load a virtualenv)
PYTHONPATH=. python3 examples/say-some-name.py
Work in progress
-
There are currently no tests
This is not because there shouldn’t be but because kien just recently has been extracted from an application that only tests the actual commands that kien executes. In this sense there are tests that cover most of kien’s functionality but they simple are not public. That being said: kien should and will have tests in the future.
-
Output formatting & Terminal handling
The way kien handles the terminal and how it writes and formats text are hard-coded and in some need for careful thought and refactoring.
-
There is little documentation
Say my name
kien is a pun and a homage to Commander Keen, because kien’s integral part is called a Commander. kien also is a rather old way to refer to a pine tree in german. There you go :)
Metadata
Release files for kien 0.16.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kien-0.16.3.tar.gz | 29.0 kB | Without provenance | Details |
Release files / kien-0.16.3.tar.gz
| Download URL | kien-0.16.3.tar.gz |
|---|---|
| Size | 29.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33a87efa41bbc4b2750544fae5575129289ab1f5ec0e4e34a7453dfa32b09853
|
|
BLAKE2b-256 checksum How to use checksums |
24197b274e713dc7f32ea3ca806a1b7bb770fa1a4f4dd3c9c74f4ded25e14f27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Security for kien 0.16.3
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.