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/env python3

# Imports
import sys
from libjam import 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.1.3.tar.gz (17.1 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.1.3-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for libjam-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8afe3b11a5396f04d860a187b0a1db2ac1c7a27e1320c8aabc961c4fd68910cc
MD5 9502562b446100e5175b52fb1648ff10
BLAKE2b-256 d8246103862e0ab0fbab815f0e1d307ed4364af5f08e247dc8ab922aae23c41c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for libjam-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f44f80fbd81398fb0ae9ccaa2c54aa58772d27413a0332dc600d1efb4fcac499
MD5 72016bdcb412fa70680feef612b79432
BLAKE2b-256 c33b973669e862c9b039c43cdac365260878c14e5a6b0400a9c21556f4b38cb2

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