Skip to main content

This lightweight Python library provides reusable utility functions to simplify common development tasks.

Project description

nurgapy

 | \ | |_   _ _ __ __ _  __ _|  _ \ _   _
 |  \| | | | | '__/ _` |/ _` | |_) | | | |
 | |\  | |_| | | | (_| | (_| |  __/| |_| |
 |_| \_|\__,_|_|  \__, |\__,_|_|    \__, |
                  |___/             |___/

Small convenience Python library.

Rationality to build this library, that I don't want to copy over this code to multiple projects.

Currently, nurgapy library consists two functions:

  • tyme - it is a small wrapper function, which is used for measuring execution time of functions. Also works for the class functions.
  • trackbar - it is a simple progress bar, which just works without many imports. Inspired by stackoverflow post. There is well-known tqdm library, but it prevents user from using print statements. For simple use-cases this progress bar should be enough. There is another nice library alive-progress, which does not have this issue and many others. But I just wanted to have some simple progress bar, which lives in the single library with other convenience functions.

Getting started

This project uses Poetry for the package management.

Install Poetry (if not installed)

curl -sSL https://install.python-poetry.org | python3 -

Install dependencies

poetry install

Run the project example

poetry run src/main.py

Installing pre-commit checks

Install pre-commit

poetry run pre-commit install

Pre-commit will run automatically after running git commit. But it is also possible to run pre-commit checks against all files manually. Adding --verbose will also print more detailed info. Helpful for debugging test.

poetry run pre-commit run --all-files

Update the pre-commit hooks.

poetry run pre-commit autoupdate

Running tests

Run tests using pytest.

poetry run pytest -v

-s - will print the print() statements. Use it for debug.

Publish a new version

In NurgaPy semantic versioning is used. After pushing a new version, a GitHub Actions workflow will be triggered, which will push a new version to PyPi and will also create a new GitHub Release. In order to publish a new version, apply the next steps:

poetry version patch  # 0.0.x

poetry version minor  # 0.x.0

poetry version majon  # x.0.0

Then create a proper git tag

git tag x.x.x

And push it

git push origin --tags

Roadmap

  • Add basic code
  • Add pre-commit hook
    • Add more rules to pre-commit
  • Add public API to the init.py
  • Add tests
  • Add tests automation Nox
  • Add badges
  • Add packaging
  • Publish nurgapy to pip
  • Add a runner, which automatically publishes a new version to pip
  • Add documentation folder
  • Create an examples folder

Progress bar

  • Add percentages
  • Flexible size
  • Progress bar runs in the independent thread

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nurgapy-0.1.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nurgapy-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file nurgapy-0.1.1.tar.gz.

File metadata

  • Download URL: nurgapy-0.1.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for nurgapy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fe13a4faecb9d73a80d4a3058917df98b6467957253c936b3444166f207eea18
MD5 55a556364f5f4d46839f196f58e5ebdd
BLAKE2b-256 6f34d793d3b6fdc76b6620e637f61d90980f4f1918f6e540459eb4f45c12bcd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nurgapy-0.1.1.tar.gz:

Publisher: release.yml on nurgalive/nurgapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nurgapy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nurgapy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for nurgapy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 adcdc15664a3e3fb876c88a66b5d3e8840a4256e79d3287aee90b654473e99da
MD5 2884695f855d15e472202abf00c1cd7f
BLAKE2b-256 1758f7ae2f80632ee0eb14bf229b5c22eaa2be8d38898372b819ffcf477995b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nurgapy-0.1.1-py3-none-any.whl:

Publisher: release.yml on nurgalive/nurgapy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page