Skip to main content

README - pygeneral

A collection of general-purpose Python utilities.


Table of Contents

  1. Overview
  2. Installation
  3. Command-Line Usage
  4. Python Usage
  5. Project Structure
  6. License

Overview

pygeneral is a set of small Python utilities that can simplify common tasks.

  • ProgressBar is a simple progress bar that can be used in the console.
  • StdoutCounter provides a straightforward way to show progress in the console, incrementally updating a single line.
  • is_root helps you check if the current user has root (on Linux/Unix) or administrator (on Windows) privileges.
  • lensort sorts 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 = 2 has 1 character before =.
  • yy = 3 has 2 characters before =.
  • abc = 1 has 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)

Source distribution for pygeneral 1.1.2
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)

Table of built distributions (wheels) for pygeneral 1.1.2
File Interpreter ABI Platform Actions
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 log

Release 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 log

Security 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.

Select from 2 files

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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page