Skip to main content

A Python library to simplify common programming tasks.

Project description

[!IMPORTANT] This library is compatible with Python 3.14, but certain dependencies might not yet support this version.

xulbux

xulbux is a library that contains many useful classes, types, and functions, ranging from console logging and working with colors to file management and system operations. The library is designed to simplify common programming tasks and improve code readability through its collection of tools.

For precise information about the library, see the library's documentation.
For the libraries latest changes and updates, see the change log.

The best modules, you have to check out:

format_codes console color


Installation

Run the following commands in a console with administrator privileges, so the actions take effect for all users.

Install the library and all its dependencies with the command:

pip install xulbux

Upgrade the library and all its dependencies to their latest available version with the command:

pip install --upgrade xulbux

CLI Commands

When the library is installed, the following commands are available in the console:

Command Description
xulbux-help shows some information about the library

Usage

Import the full library under the alias xx, so its modules and main classes are accessible with xx.module.Class, xx.MainClass.method():

import xulbux as xx

So you don't have to import the full library under an alias, you can also import only certain parts of the library's contents:

# LIBRARY SUB MODULES
from xulbux.base.consts import COLOR, CHARS, ANSI
# MODULE MAIN CLASSES
from xulbux import Code, Color, Console, ...
# MODULE SPECIFIC IMPORTS
from xulbux.color import rgba, hsla, hexa

Modules

Main Module Contents
base
Sub Module Contents
consts Constant values used throughout the library.
exceptions Custom exception classes used throughout the library.
types Custom type definitions used throughout the library.
code Code class, which includes methods to work with code strings.
color rgbahslahexaColor classes, which include methods to work with
colors in various formats.
console ConsoleProgressBar classes, which include methods for logging
and other actions within the console.
data Data class, which includes methods to work with nested data structures.
env_path EnvPath class, which includes methods to work with the PATH environment variable.
file File class, which includes methods to work with files and file paths.
format_codes FormatCodes class, which includes methods to print and work with strings that contain
special formatting codes, which are then converted to ANSI codes for pretty console output.
json Json class, which includes methods to read, create and update JSON files,
with support for comments inside the JSON data.
path Path class, which includes methods to work with file and directory paths.
regex Regex class, which includes methods to dynamically generate complex regex patterns
for common use cases.
string String class, which includes various utility methods for string manipulation and conversion.
system System class, which includes methods to interact with the underlying operating system.

Example Usage

This is what it could look like using this library for a simple but ultra good-looking color converter:

from xulbux.base.consts import COLOR, CHARS
from xulbux.color import hexa
from xulbux import Console


def main() -> None:

    # LET THE USER ENTER A HEXA COLOR IN ANY HEXA FORMAT
    input_clr = Console.input(
        "[b](Enter a HEXA color in any format) > ",
        start="\n",
        placeholder="#7075FF",
        max_len=7,
        allowed_chars=CHARS.HEX_DIGITS,
    )

    # ANNOUNCE INDEXING THE INPUT COLOR
    Console.log(
        "INDEX",
        "Indexing the input HEXA color...",
        start="\n",
        title_bg_color=COLOR.BLUE,
    )

    try:
        # TRY TO CONVERT THE INPUT STRING INTO A hexa() OBJECT
        hexa_color = hexa(input_clr)

    except ValueError:
        # ANNOUNCE THE INVALID INPUT COLOR AND EXIT THE PROGRAM
        Console.fail(
            "The input HEXA color is invalid.",
            end="\n\n",
            exit=True,
        )

    # ANNOUNCE STARTING THE CONVERSION
    Console.log(
        "CONVERT",
        "Converting the HEXA color into different types...",
        title_bg_color=COLOR.TANGERINE,
    )

    # CONVERT THE HEXA COLOR INTO THE TWO OTHER COLOR FORMATS
    rgba_color = hexa_color.to_rgba()
    hsla_color = hexa_color.to_hsla()

    # ANNOUNCE THE SUCCESSFUL CONVERSION
    Console.done(
        "Successfully converted color into different types.",
        end="\n\n",
    )

    # PRETTY PRINT THE COLOR IN DIFFERENT FORMATS
    Console.log_box_bordered(
        f"[b](HEXA:) [i|white]({hexa_color})",
        f"[b](RGBA:) [i|white]({rgba_color})",
        f"[b](HSLA:) [i|white]({hsla_color})",
    )


if __name__ == "__main__":
    main()



View this library on PyPI

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

xulbux-1.9.3.tar.gz (98.4 kB view details)

Uploaded Source

Built Distributions

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

xulbux-1.9.3-cp312-cp312-win_amd64.whl (652.9 kB view details)

Uploaded CPython 3.12Windows x86-64

xulbux-1.9.3-cp312-cp312-win32.whl (566.0 kB view details)

Uploaded CPython 3.12Windows x86

xulbux-1.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

xulbux-1.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

xulbux-1.9.3-cp312-cp312-macosx_11_0_arm64.whl (879.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

xulbux-1.9.3-cp311-cp311-win_amd64.whl (647.6 kB view details)

Uploaded CPython 3.11Windows x86-64

xulbux-1.9.3-cp311-cp311-win32.whl (560.2 kB view details)

Uploaded CPython 3.11Windows x86

xulbux-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

xulbux-1.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

xulbux-1.9.3-cp311-cp311-macosx_11_0_arm64.whl (869.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

xulbux-1.9.3-cp310-cp310-win_amd64.whl (647.6 kB view details)

Uploaded CPython 3.10Windows x86-64

xulbux-1.9.3-cp310-cp310-win32.whl (559.8 kB view details)

Uploaded CPython 3.10Windows x86

xulbux-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

xulbux-1.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

xulbux-1.9.3-cp310-cp310-macosx_11_0_arm64.whl (882.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file xulbux-1.9.3.tar.gz.

File metadata

  • Download URL: xulbux-1.9.3.tar.gz
  • Upload date:
  • Size: 98.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3.tar.gz
Algorithm Hash digest
SHA256 7fb2aad326171cfc93e7f5c4562a1c64eaeb4614392921e6c7b900bd520937ac
MD5 2ed50d89e1559a6d1d731582f3418fa4
BLAKE2b-256 f2ea943d5dce1d2e36a1228994869863a1f59ec9d4c535dbe06d6140df63e133

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 652.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6823664c6ad4f68a238e04c153a1797b55463221297bb5eed003626e9961939c
MD5 6b33701ea2267949144c575e206ad674
BLAKE2b-256 2836f745a9b40034cc0065c70db59f201fcf4bfc36b207133675e3110f3b9329

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp312-cp312-win32.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp312-cp312-win32.whl
  • Upload date:
  • Size: 566.0 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 03298c51cebf597e4f7ac5d07c5fe387ad631bb0b4a1e60090982ab2d970dff7
MD5 3cfd08e1e48fb965d964ed5f6dd6209f
BLAKE2b-256 f7977afd910da23cb21e48f57a6b1dc43cb80adc9b30dbf02447a1616085eb00

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00fde4608b51f292d7ba8d2ea962dfbfa518d96f21afe2195f1391065f51b77f
MD5 4e7828eebe81f62144195d13105a2d3d
BLAKE2b-256 7f3b55198a43402f7eba7ea2d057a185ac2d1a6c686c65f567c424ac28a67818

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c238a1653653700c5ba1d3a491b14efa6bc1d832463de202ca565f7043daf0ab
MD5 b6003d86a9a23230b9b1d0266197dcb1
BLAKE2b-256 2201fde9a46b69adcdaeced71468f2f41f98c8a5ea96d7e0cfe5574eb3279351

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2352339bddfa447b6c48e435c5c89c0e7aecdb18ce74c18ae6b7bdacba04c8c
MD5 fc45fb8d81da32ab95435f0a90c10835
BLAKE2b-256 63074b63e616cc07229650bcd713ca88d42a93835af0a7e42e56767389f51a7d

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 647.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 be6b36c9417e696bd208656f9bb928bd637d32676cbd988628d4a4c1bf4bef5c
MD5 e251c020a0118141a0c246591533b94d
BLAKE2b-256 1eab7258f209552831a54e8fba8f997f2aa97e070a2c01aa624a947b12d0fbd4

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp311-cp311-win32.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp311-cp311-win32.whl
  • Upload date:
  • Size: 560.2 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 e98c32eae6dd084d85d8b6ba5d8e8dd3370b232704c2e2d3b161a3e9bb0e3184
MD5 587f8d0bec8e29629b717a737cc4c322
BLAKE2b-256 98403c90b2f48b88aa01e4874869d00670d78dc9d9cac5c18fc44a3c8d1a56a3

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 949e0ae4662b6734001c15fb483cff0da4ec7f88e8898d1be30635d2d80ed753
MD5 9f630f21ff3c1c5222bd17251147ec90
BLAKE2b-256 e4126816aa56a31da7ff63bafb5d6f84c91c655342c7405621eb9476e25800b1

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 af4338119f73b60a8a84e8d1237148d3ca54bc6d0e2c47319fadedf253257824
MD5 43515ec361b0760e8317afe7b4b136a4
BLAKE2b-256 e29dd487d8ded97aeab92272abc24f2ff7b7aafc1e211b8b87854d324b3dc0df

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6939afa537f7ad06101d55313ac5e86e7db508df6ae8cbefdcb2263610fe9113
MD5 fa428105ca3bfb1060f97fad784d767e
BLAKE2b-256 3b2dbf5996407b0e4c3f475d168137189f93c1a4dc18c889c4523a9fc2f69fa1

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 647.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 86de2831e9d9f80cded0688123d7e8f6ad4fe78a2f0675516b363b83d3ba48c0
MD5 b215ed0eddb6ea12b93e1cc8b43cbe6b
BLAKE2b-256 2bc1e413db75b587da8a89da4c17b37db033d6b91490bd0ad14d6f9ef364ce22

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp310-cp310-win32.whl.

File metadata

  • Download URL: xulbux-1.9.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 559.8 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for xulbux-1.9.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 869e7a9c99d549f2b8b4942f6f72f363ca6b26bf665dc2f86a48b0dd6a97d768
MD5 90ca53f5b557b675b90a2f3e3c0376aa
BLAKE2b-256 d4b4085ac1bd10449940fb9653d2b71744dcaf8c873cb2dbd2d08a02aaa62007

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7bf6eff4e7cb1645571fbe50f1c7a272398943c14772b0ad5893fe44022a71f
MD5 8f1ee0bffd5220cee6dfe9577ed313ed
BLAKE2b-256 b3d648b11c517f5ce7b75b48ed65f6cd3645955345defd0c4b606da986a4b064

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d2339e4d4e34a4d3f6f4ae6347e55dee2dee568cc673b1d4d4f524d4c2937833
MD5 5aa552d089ebb455ca7d45836f9879ab
BLAKE2b-256 49325cb5fe7f2896fa0851ab4d3d5c293d149a1b99e4f05353c85e89e4602ef9

See more details on using hashes here.

File details

Details for the file xulbux-1.9.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xulbux-1.9.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9ccff82806ac7036edd686849f82db9ad2fd0251ff4b4c6a797a99add86ffca
MD5 13b63a604ec85869bae013e7dfb70b82
BLAKE2b-256 3ca1fb4b7ba55a5da56844912cea58f4f8b0ac4cbc45fc8cef48cc0a294c85a9

See more details on using hashes here.

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