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:
pip install just-more-python
Usage
Import JMP with:
import jmp
Output functions
JMP provides several colored output functions:
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:
jmp.error("File not found", heading="Oops:")
jmp.warn("This might cause problems", heading="Notice:")
You can also remove the heading entirely:
jmp.error("Something went wrong", heading=None)
pwd()
Get the current working directory:
directory = jmp.pwd()
By default, pwd() prints the directory and returns it.
To only return the directory without printing:
directory = jmp.pwd(text=False)
fatal()
Print a fatal error and exit the program:
jmp.fatal("Could not continue")
By default, fatal() exits with status code 1. A custom exit code can be provided:
jmp.fatal("Invalid configuration", code=2)
success()
Print a successful message and return an exit status of 0 by default:
code = jmp.success("Operation completed")
A different return code can be provided if needed:
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 for colored terminal output.
Colorama is installed automatically when JMP is installed through pip.
Release files for just-more-python 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| just_more_python-1.0.2.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| just_more_python-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.2 kB
Release files / just_more_python-1.0.2.tar.gz
| Download URL | just_more_python-1.0.2.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bf75975de5576904d889d29119f8224cceafd85f33b460c3d13c1ac64c5e7ce
|
|
BLAKE2b-256 checksum How to use checksums |
e938445b2826800f098553f52a60ce8aa12b5af36a5d7cc99b35feb1178ac5d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / just_more_python-1.0.2-py3-none-any.whl
| Download URL | just_more_python-1.0.2-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
329c754163a9486edaf9037eb9485a2b2c959844d0e5448ea8f3136a12397116
|
|
BLAKE2b-256 checksum How to use checksums |
e03923a6798cd8c805cc9725e3e99caa0344b22312c0f41ebc98b0fc73f0ff25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|