Personal utility functions that I use across different codebases.
Project description
myfuncs
myfuncs
is a Python package that provides a set of utility functions designed to streamline your code and enhance efficiency across various projects and platforms.
Installation
You can install myfuncs
using pip:
pip install myfuncs
Functions Overview
-
nlprint
: Enhanced print function. -
is_jwt
: Checks if a given string or bytes is a valid JWT (JSON Web Token). -
ranstr
: Generates a random string of specified length and character set. -
runcmd
: Executes a shell command and optionally returns its output. -
get_terminal_width
: Retrieves the terminal width, defaulting to 80 if undetectable. -
print_middle
: Displays a string centered amidst a specified character. -
print_columns
: Prints list items in columns based on terminal width. -
objinfo
: Presents detailed information about an object, its attributes, methods, and documentation. -
default_repr
: Provides a standardized string representation of an object. -
typed_evar
: Fetches an environment variable with inferred or specified type.
For more detailed descriptions and usage examples, please refer to the module's source code.
Running Tests
The myfuncs
package includes a test suite to verify the operation of its functions. To run the tests:
python -m unittest tests/test_myfuncs.py
The other tests file exists for legacy purposes for legacy code in funcs.py
(no longer used but kept for backwards compatibility).
Contributing
Contributions to myfuncs
are welcomed. If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file myfuncs-1.6.0.tar.gz
.
File metadata
- Download URL: myfuncs-1.6.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd7697e214608d261b0d258065ff0db6149c5c2049166f6d938e6f9ebe93826 |
|
MD5 | 050efc6c304825ce1748648c5c0243cc |
|
BLAKE2b-256 | e00a49f4eb33fa252aae695d9e63d83e604663193609af1b115ad53a60242ff7 |