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.18.tar.gz (16.3 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.18-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libjam-0.0.18.tar.gz
  • Upload date:
  • Size: 16.3 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.18.tar.gz
Algorithm Hash digest
SHA256 6c5be7aecf58007b35c04c88c42e8973743ff462fd970027e3873a0b65ef6282
MD5 769ee521f1f1fc36aad4142cf8c1a21c
BLAKE2b-256 07a83b4c4c9d49245a04edcdae6403a157491c6939d58d87f8fca1883906bba9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libjam-0.0.18-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

Hashes for libjam-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 364de9560898f191e979a0e69bc730a13d2a2ed317e157a3ed404b31afce12a7
MD5 262442aa7bb0ec13dd3b47eb5c3151e2
BLAKE2b-256 f095b17f2800475cec02c9d8f45fb3c347e0cedd151ec08c18cc8362bb45a0c4

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