Skip to main content

A collection of utilities for python

Project description

Librairie Python

Installation

pip install uwutilities

progress bar

la barre de progression est un objet qui permet de faire une barre de chargement.

Elle a de nombreuses options:

Args:

    steps (int): le nombre de d'étapes

    text (str): le message affiché a gauche de la barre

    pattern_bar (str): le motif de la barre

    pattern_space (str): le motif de l'espace

    lenght (int): la longueur de la barre

    show_steps (bool): afficher les étapes sur le nombre d'étapes total

    show_time (bool): afficher le temps passé sur le temps total

    show_time_left (bool): afficher le temps restant

Exemple d'utilisation:

Code

from uwutilities import bar

import time



Bar = bar(steps=10, text="chargement", lenght=50)



for _ in range(10):

    Bar.next()

    time.sleep(1)

Resultat


chargement | ██████████████████████████████                    | 60% [ steps:  6 / 10 | finished in: 0:00:03 ]

Methodes

  • next(): avance la barre de chargement

  • stop(): arrête la barre de chargement

String_tools

Cette classe permet de modifier des strings facilement.

Methodes

- replace

Args:

    string (str): le string à modifier

    *args (str): les strings à remplacer par pair



Returns:

    str: le string modifié

Code

a = "Hello World"

a = string.replaces(a, "Hello", "Hi", "World", "Earth")

print(a) -> "Hi Earth"

- replaces

Args:

    string (str): le string à modifier

    index (int): l'index du caractère à remplacer

    char (str): le caractère qui remplace



Returns:

    str: le string modifié

Code

a = "Hello World"

a = string.replace(a, 4, "a")

print(a) -> "Hella World"

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

uwutilities-1.4.4.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

uwutilities-1.4.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file uwutilities-1.4.4.tar.gz.

File metadata

  • Download URL: uwutilities-1.4.4.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for uwutilities-1.4.4.tar.gz
Algorithm Hash digest
SHA256 4c7faddfc872ef821fba7cd0a4cca5f35fdadf5c4ee87ef65999925f66db8383
MD5 ace609132f1b8df2d9451f2287f16fa8
BLAKE2b-256 df500e71c41d93bbab4cd57d68db5eb7018b759c481e7b2fb1b47c6c3dcdf4a1

See more details on using hashes here.

File details

Details for the file uwutilities-1.4.4-py3-none-any.whl.

File metadata

  • Download URL: uwutilities-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for uwutilities-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d5169c6980a2bf3203146cd8bfd7d1c31e36200bc46e00ea793618f0d1cdde6
MD5 598f996156ad750db25c791c58f73ec5
BLAKE2b-256 d2721442d6addcdc79ae2d5c35659c017f656cbc51f98336674429c39d29296c

See more details on using hashes here.

Supported by

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