Skip to main content

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!')

# Setting commands and options
app = "example"
description = "An example app for the libjam library"
commands = {
  'print':     {'function': CLI.hello,
  'description': 'Prints given string'},
}
options = {
 'world': {'long': ['world'], 'short': ['w'],
 'description': 'Appends \'world\' after printing given input'},
}

# Generating help
help = captain.generate_help(app, description, commands, options)
# Interpreting user input
interpretation = captain.interpret(app, help, commands, options)
# Getting parsed output
function = interpretation.get('function')
options = interpretation.get('options')
# Executing function
exec(f"CLI().{function}")

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

libjam-0.0.19.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libjam-0.0.19-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file libjam-0.0.19.tar.gz.

File metadata

  • Download URL: libjam-0.0.19.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for libjam-0.0.19.tar.gz
Algorithm Hash digest
SHA256 09059b9a732169eaf00820ea63c9da216ca20674200cc6a4d91c81fd892383ab
MD5 e3b8a73f7ab48e803f88cc1cbcd9ac76
BLAKE2b-256 acff92168470ab2ba21b8389b4a2bfb2f916147e079d6bb7fbc249b414ac1af8

See more details on using hashes here.

File details

Details for the file libjam-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: libjam-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for libjam-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 3b461fe8a41b05f9c2e14d7b33e65c3f4b556f5b4ac4f1d6acc3ddee3106c1cc
MD5 fdc18339cbfd1926705dcd4a191dab9f
BLAKE2b-256 511e12853790aa2469739e50134350a1efa9f2785dbf6db9c4d3508811c356a5

See more details on using hashes here.

Supported by

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