README - pygeneral
A collection of general-purpose Python utilities.
Table of Contents
Overview
pygeneral is a set of small Python utilities that can simplify common tasks.
ProgressBaris a simple progress bar that can be used in the console.StdoutCounterprovides a straightforward way to show progress in the console, incrementally updating a single line.is_roothelps you check if the current user has root (on Linux/Unix) or administrator (on Windows) privileges.lensortsorts lines based on their distance to a match of a specified regular expression.
Installation
pip install pygeneral
Or, for development:
# (1) Clone the repository
git clone https://github.com/BartSte/pygeneral.git
cd pygeneral
pip install -e ".[dev]"
Usage
You can import the classes and functions from pygeneral as you normally would
with in a Python script. Additionally, some of the utilities are also available
as command-line tools. As is explained below.
Lensort
After installation, you will have the lensort command available:
lensort [OPTIONS] <REGEX>
Example
Suppose you have a file named input.txt:
abc = 1
x = 2
yy = 3
If you run:
lensort '=' -f input.txt
The output will be:
x = 2
yy = 3
abc = 1
Explanation:
- It sorts lines by the number of characters before the
=match. x = 2has 1 character before=.yy = 3has 2 characters before=.abc = 1has 3 characters before=.
You can also pipe content directly to lensort, for example:
cat input.txt | lensort '='
License
This project is licensed under the MIT License.
See the LICENSE file for details.
Metadata
Release files for pygeneral 1.1.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 | Provenance | Actions |
|---|---|---|---|---|
| pygeneral-1.1.2.tar.gz | 30.8 kB | With provenance | Details for pygeneral-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygeneral-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for pygeneral-1.1.2-py3-none-any.whl |
Total release size: 46.7 kB
Release files / pygeneral-1.1.2.tar.gz
| Download URL | pygeneral-1.1.2.tar.gz |
|---|---|
| Size | 30.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41979d6749bb1a154265d0f857ce1219edf79fa6a9cdb1d1f1f9ba04d122680c
|
|
BLAKE2b-256 checksum How to use checksums |
45771a1f7046c9a93a60b678b540524788ae54e3655692b828f4873bc1f886c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 10, 2025.
Transparency logRelease files / pygeneral-1.1.2-py3-none-any.whl
| Download URL | pygeneral-1.1.2-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9648c56b55edef3fa26bbffdedaed5480864831255e21636649aedbf47351d02
|
|
BLAKE2b-256 checksum How to use checksums |
22ae9e4ee7594d36c062287195f50bec46883aa59b25be18d540bd8d67ad441a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 10, 2025.
Transparency logSecurity for pygeneral 1.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pygeneral-1.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 10, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.