Skip to main content

ExtraFunctions

ExtraFunctions is a collection of useful Python functions designed to make common programming tasks simpler.

It includes utilities for saving data, generating random values, working with files, terminal displays, text manipulation, encryption, and more.

Installation

Install ExtraFunctions using pip:

pip install ExtraFunctions

Functions

General Utilities

  • negative(used) — Reverses strings or makes numbers negative.
  • average(numbers) — Calculates the average of a collection of numbers.
  • clamp(variable, top, bottom) — Keeps a value between two limits.
  • WaitUntil(boolean, max_frames) — Waits until a condition becomes true.
  • TimeLenFunc(func, *input) — Measures how long a function takes to run.
  • attempt(func, *inputs, times) — Attempts to run a function multiple times.

Save System

  • Save(variable, name) — Saves a variable.
  • SaveReset() — Resets saved data.
  • SaveReturn(name) — Returns a saved value.
  • DeleteSave(name) — Deletes a saved value.
  • SaveChange(variable, name) — Changes an existing saved value.
  • Exists(name) — Checks whether a saved value exists.
  • ReturnSaved() — Returns all saved data.

Random Utilities

  • RandomString(length) — Generates a random string.
  • RandomChoice(choices, amount=1) — Selects one or more unique random choices.
  • WeightedRandom(options, values) — Makes a weighted random selection.
  • GeneratePassword(length) — Generates a secure random password.

Files and Data

  • FileExists(file) — Checks whether a file exists.
  • load(file) — Loads supported files.

Terminal Utilities

  • DrawProgressBar(percent) — Draws a terminal progress bar.
  • UpdateProgressBar(percent) — Updates the progress bar.
  • DrawLoadingSpinner() — Draws a loading spinner.
  • UpdateLoadingSpinner(rotation) — Updates the loading spinner.
  • StartCountdown(seconds) — Starts a terminal countdown.
  • UpdateCountdown(time) — Updates a countdown.
  • SlowWrite(text, speed=0.5) — Prints text gradually, like a typewriter.

Text and Encryption

  • CaesarEncrypt(text, shift) — Encrypts text using a Caesar cipher.
  • CaesarDecrypt(text, shift) — Decrypts Caesar cipher text.
  • IsPalindrome(text) — Checks whether text reads the same forwards and backwards.

Other Utilities

  • FormatTime(seconds) — Converts seconds into a readable time format.
  • RemoveDuplicates(list) — Removes duplicate items from a list.
  • PlanetInfo(planet, info=False) — Returns information about a planet.
  • DistanceTranslate(amount, from_unit, to_unit) — Converts between supported distance units.

Examples

Generate a password

from ExtraFunctions import PasswordGenerator

password = PasswordGenerator(20)

print(password)

Create a progress bar

from ExtraFunctions import DrawProgressBar, UpdateProgressBar
import time

DrawProgressBar(0)

for i in range(101):
    UpdateProgressBar(i)
    time.sleep(0.05)

print()

Slowly print text

from ExtraFunctions import SlowWrite

SlowWrite("Hello, World!", 0.1)

Random choices

from ExtraFunctions import RandomChoice

planets = ["Mercury", "Venus", "Earth", "Mars"]

print(RandomChoice(planets, 2))

Errors

ExtraFunctions includes several custom errors:

  • UknownFormatError
  • SaveError
  • InfiniteError
  • NonexistentPlanetError

Notes

ExtraFunctions is an independent Python project that is continually being expanded with new functions and utilities. - Also, try find the secret function!!!

More features may be added in future updates.

WARNING:

Use the LATEST version of ExtraFunctions. Incompatible with moviepy.

Metadata

Release files for ExtraFunctions 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ExtraFunctions 0.2.3
File Size Uploaded Provenance
extrafunctions-0.2.3.tar.gz 5.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ExtraFunctions 0.2.3
File Interpreter ABI Platform
extrafunctions-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.8 kB

Release files / extrafunctions-0.2.3.tar.gz

Download URL extrafunctions-0.2.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
44b8f97042489af817885d1e53b13686dae959260759904c0be48006b1a9c565
BLAKE2b-256 checksum
How to use checksums
f62290118793f50e65cfa5b746ad33e577133ab9fca37ade6fc6b97644383770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / extrafunctions-0.2.3-py3-none-any.whl

Download URL extrafunctions-0.2.3-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
feb7bb86c7f25575b0c07a7744c7bac956b4de441b2c349900de49f8f5da2c5a
BLAKE2b-256 checksum
How to use checksums
a9c5ad42c34fec717a9581ad1b62f0050f931dfc5b3ab198f481feb9637f4978
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for ExtraFunctions 0.2.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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