Metadata-Version: 2.4
Name: ExtraFunctions
Version: 0.2.0
Summary: A collection of useful Python utility functions.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Pillow==0.11.1

# 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:

```bash
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.
* `PasswordGenerator(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

```python
from ExtraFunctions import PasswordGenerator

password = PasswordGenerator(20)

print(password)
```

### Create a progress bar

```python
from ExtraFunctions import DrawProgressBar, UpdateProgressBar
import time

DrawProgressBar(0)

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

print()
```

### Slowly print text

```python
from ExtraFunctions import SlowWrite

SlowWrite("Hello, World!", 0.1)
```

### Random choices

```python
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.

More features may be added in future updates.s
