Metadata-Version: 2.4
Name: just-more-python
Version: 1.0.2
Summary: Just More Python
Description-Content-Type: text/markdown
Requires-Dist: colorama

# JMP

**JMP (Just More Python)** is a small Python utility library with simple functions for common tasks and CLI output.

## Installation

Install JMP from PyPI:

```bash
pip install just-more-python
```

## Usage

Import JMP with:

```python
import jmp
```

### Output functions

JMP provides several colored output functions:

```python
jmp.error("Something went wrong")
jmp.warn("Be careful")
jmp.info("Here is some information")
jmp.success("Everything worked")
```

`error()` and `warn()` support custom headings:

```python
jmp.error("File not found", heading="Oops:")
jmp.warn("This might cause problems", heading="Notice:")
```

You can also remove the heading entirely:

```python
jmp.error("Something went wrong", heading=None)
```

### `pwd()`

Get the current working directory:

```python
directory = jmp.pwd()
```

By default, `pwd()` prints the directory and returns it.

To only return the directory without printing:

```python
directory = jmp.pwd(text=False)
```

### `fatal()`

Print a fatal error and exit the program:

```python
jmp.fatal("Could not continue")
```

By default, `fatal()` exits with status code `1`. A custom exit code can be provided:

```python
jmp.fatal("Invalid configuration", code=2)
```

### `success()`

Print a successful message and return an exit status of `0` by default:

```python
code = jmp.success("Operation completed")
```

A different return code can be provided if needed:

```python
code = jmp.success("Operation completed", code=5)
```

## Functions

| Function    | Description                                       |
| ----------- | ------------------------------------------------- |
| `error()`   | Prints a red error message                        |
| `warn()`    | Prints a yellow warning message                   |
| `info()`    | Prints a blue information message                 |
| `success()` | Prints a green success message and returns a code |
| `fatal()`   | Prints a fatal message and exits                  |
| `pwd()`     | Gets the current working directory                |

## Requirements

JMP currently uses [Colorama](https://pypi.org/project/colorama/) for colored terminal output.

Colorama is installed automatically when JMP is installed through pip.


