Metadata-Version: 2.4
Name: filty
Version: 1.0
Summary: Beautiful, secure, and powerful print() replacement
Author: kawlime
Author-email: kawlime@tutamail.com
License: MIT
Description-Content-Type: text/markdown
Requires-Dist: colorama>=0.1.1
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

One simple import completely replaces the built-in `print()` with a powerful callback system.  
Add colors, gradients, animations, password hiding, encryption, logging all with a single filter function.

## Features

- **Auto-overwrites `print()`** on `import filty`
- **Multiple callbacks** – chain as many filters as you want
- `get_callbacks()` – returns clean list of callback names (read-only, no side effects)
- **Cross-platform colors** powered by `colorama`
- **Rainbow gradient** that intelligently skips pre-colored text
- **Animation support** (typing & fade effects)
- **Fast encryption** XOR + Base64 (with custom for security)
- Smart bypass: `print(get_callbacks())` prints raw without filtering
---

## Installation

```bash
pip install filty
```
---
## Quick Start

```python
from filty import *

def hide_password(text):
    if "password" in text.lower():
        return "***HIDDEN***"
    return text

def add_color(text):
    if "ERROR" in text.upper():
        return Colors.red(text)
    return text

def rainbow(text):
    return gradient(text)

add_callback(hide_password)
add_callback(add_color)
add_callback(rainbow)

print("Current callbacks:", get_callbacks())

print("My password is Secret123!")
print("ERROR: Something went wrong!")
print("SUCCESS: Operation completed")

```
---
## All Available Tools

### Colors

```python
from filty import Colors

print(Colors.red("Error message"))
print(Colors.green("Success!"))
print(Colors.cyan("Info text"))
```
---
### Gradient

```python
from filty import gradient
print(gradient("This text becomes beautiful rainbow!"))
```
---
### Animation

```python
from filty import animate_print

animate_print("Loading system...", delay=0.04)
animate_print("Fading in...", delay=0.06, style="fade")
```
---
### Secure (XOR + base64)

```python
from filty import encrypt, decrypt

secret = encrypt("My password is P@ssw0rd!", "1234567890")
print("Encrypted:", secret)

original = decrypt(secret, "1234567890")
print("Decrypted:", original)
```
#### Performance

| Text length | Pure Python (secure.py) | Native|
|-------------|---------------------------|-------|
| 1,000 chars | ~20 ms                   | ~0.3 ms |
| 10,000 chars| ~205 ms                   | ~2.5 ms|
| 100,000 chars| ~2107 ms                  | ~22 ms |
---
### Full Callback Detail

```python
from filty import (
    add_callback,
    set_callbacks,
    reset_callbacks,
    get_callbacks,
    Colors,
    gradient,
    animate_print,
    encrypt
)

# 1. set_callbacks(): Replace all at once
def hide_password(text):
    if "password" in text.lower():
        return "***HIDDEN***"
    return text

def add_color(text):
    upper = text.upper()
    if "ERROR" in upper:
        return Colors.red(text)
    if "SUCCESS" in upper:
        return Colors.green(text)
    if "WARNING" in upper:
        return Colors.yellow(text)
    return text

def rainbow(text):
    return gradient(text)

set_callbacks([hide_password, add_color, rainbow])

print("\nCurrent callbacks:", get_callbacks())
# Output: ['hide_password', 'add_color', 'rainbow']


# 2. Full Secure Filter + set_callbacks
def secure_filter(text):
    lower = text.lower()
    
    if any(word in lower for word in ["password", "secret", "token", "key", "api", "auth"]):
        encrypted = encrypt(text, "mykey")
        return Colors.red("[ENCRYPTED] " + encrypted)
    
    upper = text.upper()
    if "ERROR" in upper:
        return Colors.red(gradient(text))
    if "SUCCESS" in upper:
        return Colors.green(gradient(text))
    if "WARNING" in upper:
        return Colors.yellow(gradient(text))
    
    return gradient(text)

reset_callbacks() 
set_callbacks([secure_filter])

print("\n=== Using Secure Filter ===")
print("My password is SuperSecret123!")
print("ERROR: Access denied")
print("SUCCESS: Login completed")
print("WARNING: Low memory")
print("Normal message here")

# 3. Switch back to multiple callbacks
print("\n=== Switching to Multiple Callbacks ===")
reset_callbacks()

set_callbacks([
    hide_password,
    add_color
])

print("Current callbacks:", get_callbacks())
print("My password is P@ssw0rd!")
print("ERROR: Access denied")
```
---
## Project Structure (for developers)

```
filty/
├── __init__.py
├── core.py          
├── config.py        
├── color.py
├── gradient.py
├── secure.pyd       # Native compiled extension for Windows
├── secure.so        # Native compiled extension for Linux
├── secure.py
└── animate.py
```
All modules are tiny, focused, and optimized.

---

## License

MIT License

---

**Made with ❤️ for clean, beautiful, and secure printer.**
