Metadata-Version: 2.4
Name: libjam
Version: 0.0.21
Summary: A library jam for Python.
Project-URL: Homepage, https://github.com/philippkosarev/libjam
Project-URL: Issues, https://github.com/philippkosarev/libjam/issues
Author-email: Philipp Kosarev <philipp.kosarev@gmail.com>
License-Expression: GPL-2.0
License-File: LICENSE
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12.0
Requires-Dist: patool>=4.0.0
Requires-Dist: rarfile>=4.2
Requires-Dist: send2trash>=1.8.3
Description-Content-Type: text/markdown

# libjam
A library jam for Python.

## Installing
libjam is available on [pypi](https://pypi.org/project/libjam/), 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
```python
#! /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}")
```
