A library jam for Python.
Project description
libjam
A library jam for Python.
Installing
libjam is available on pypi, and can be installed using pip.
pip install libjam
Modules
libjam consists of of 6 modules:
Captain
responsible for handling command-line arguments
Drawer
responsible for file operations
Typewriter
responsible for transforming and printing text
Clipboard
responsible for working with lists
Notebook
responsible for configuration
Flashcard
responsible for getting user input from the command line
Example project
#! /usr/bin/python
# Imports
import sys
from libjam import Captain
captain = Captain()
class CLI:
def hello(self, text):
print(text)
if options.get('world').get('enabled'):
print('world!')
cli = CLI()
# Inputs/Commands/Options configuration
app = "example"
description = "An example app for the libjam library"
# help = "" # If you wish to set your own help page text
commands = {
'print': {'function': cli.hello,
'description': 'Prints given string'},
}
options = {
'world': {'long': ['world'], 'short': ['w'],
'description': 'Appends \'world\' after printing given input'},
}
# Getting program arguments
arguments = sys.argv
# Removing script name from arguments
arguments.remove(arguments[0])
# Generating help
help = captain.generate_help(app, description, commands, options)
# Interpreting user input
interpretation = captain.interpret(app, help, commands, arguments, options)
# Getting parsed output
function = interpretation.get('function')
options = interpretation.get('options')
# Executing function
exec(f"cli.{function}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file libjam-0.0.16.tar.gz.
File metadata
- Download URL: libjam-0.0.16.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6a56dac3664e005d7a7b524a179c3dfd7737d4ecf54c9570b9fdaec230ab621
|
|
| MD5 |
7ef32a1ac53c4eed3d630ef42839608f
|
|
| BLAKE2b-256 |
4870e1157087c08ad9f53cc6a63f084c6254d8b0bfd68f283d5e7595b270f772
|
File details
Details for the file libjam-0.0.16-py3-none-any.whl.
File metadata
- Download URL: libjam-0.0.16-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff4e7009db9af52af298eaa328fe337b62f3aecf8a6910d4fd0b351aa120181a
|
|
| MD5 |
cdc3924001b1e7d779f62bd43904de84
|
|
| BLAKE2b-256 |
9061455f0816c4c06f1ac4220db302eb3879d49ed479fe85acf1631cb68a64a0
|