CLI tool for searching YouTube/YTMusic and downloading audio/video from 1000+ platforms
Project description
re-kiss — A powerful set of tools for working with regular expressions
An elegant and intuitive toolkit that makes regex operations simple and smooth. Provides comprehensive functions for validation, extraction, and cleaning of data using regular expressions in Python.
🚀 Quick Start
pip install re-kiss # Requires Python 3.7+
from re_kiss import validate_email, extract_emails, strip_html
# Validation
print(validate_email("user@example.com")) # True
# Extraction
text = "Contact: john@mail.com and jane@site.ru"
print(extract_emails(text)) # ['john@mail.com', 'jane@site.ru']
# Cleaning
html = "<p>Hello <b>World</b></p>"
print(strip_html(html)) # "Hello World"
📋 Modules
validators — Validate data
from re_kiss import validate_email, validate_url, validate_phone, validate_password, validate_ip, validate_date
| Function | Description |
|---|---|
validate_email(email, strict=True) |
Email address validation |
validate_url(url, require_https=False) |
URL validation |
validate_phone(phone, locale='any') |
Phone number validation ('us', 'uk', 'any') |
validate_password(password, min_length=8, ...) |
Password strength with configurable rules |
validate_ip(ip, version=4) |
IPv4/IPv6 validation |
validate_date(date_str, format='iso') |
Date validation ('iso', 'us', 'eu') |
extractors — Extract data from text
from re_kiss import extract_emails, extract_urls, extract_phones, extract_numbers, extract_words, extract_between
| Function | Description |
|---|---|
extract_emails(text, unique=True) |
Extract email addresses |
extract_urls(text, unique=True) |
Extract URLs |
extract_phones(text, locale='any') |
Extract phone numbers |
extract_numbers(text, decimals=True, negative=True) |
Extract numbers (int/float) |
extract_words(text, min_length=1, language='all') |
Extract words ('en', 'ru', 'all') |
extract_between(text, start, end, include_bounds=False) |
Extract text between markers |
cleaners — Clean and normalize text
from re_kiss import strip_html, normalize_whitespace, remove_special_chars, remove_numbers, remove_punctuation
| Function | Description |
|---|---|
strip_html(text, keep_content=True) |
Remove HTML tags |
normalize_whitespace(text) |
Collapse multiple spaces/newlines |
remove_special_chars(text, keep_spaces=True, ...) |
Remove special characters |
remove_numbers(text, keep_positions=False, replacement='') |
Remove numbers |
remove_punctuation(text, keep_sentences=True) |
Remove punctuation |
📖 Examples
from re_kiss import *
# Email validation
validate_email("user@example.com") # True
validate_email("invalid-email") # False
validate_email("test@mail", strict=False) # True (loose mode)
# Password strength
validate_password("Weak") # False
validate_password("Str0ng!Pass",
min_length=8,
require_special=True) # True
# Extract numbers
extract_numbers("Price: $19.99, Qty: 5") # [19.99, 5]
extract_numbers("No decimals here",
decimals=False) # []
# Extract between markers
extract_between("hello {world} foo",
"{", "}") # ['world']
extract_between("<!-- comment -->",
"<!--", "-->") # [' comment ']
# HTML cleaning
strip_html("<p>Hello <b>World</b></p>") # "Hello World"
strip_html("<div>Text</div>",
keep_content=False) # ""
# Text normalization
normalize_whitespace("Hello world!\t\n") # "Hello world!"
remove_special_chars("User123! $pecial") # "User pecial"
remove_punctuation("Hello, world!") # "Hello world"
Advanced — RegexPattern class
from re_kiss import RegexPattern
# Create reusable pattern
pattern = RegexPattern(r'\b[A-Z][a-z]+\b')
pattern.findall("Alice Bob and Charlie") # ['Alice', 'Bob', 'Charlie']
# Quick test
pattern.test("No names here") # False
# Count matches
pattern.count("Alice Bob Charlie") # 3
# Replace with function
pattern.replace("Alice Bob", str.upper) # "ALICE BOB"
# Iterator with positions
for match in pattern.finditer("Alice Bob"):
print(match.text, match.start, match.end)
# Alice 0 5
# Bob 6 9
🔧 Dependencies
| Library | Purpose |
|---|---|
| Python Standard Library | re, typing, dataclasses |
Zero external dependencies — uses only built-in Python modules.
❓ FAQ
Why re-kiss over raw re? Simplifies common regex tasks into clean, readable functions with sensible defaults. No more writing boilerplate patterns for emails, URLs, phone numbers.
Performance impact? Minimal. Patterns are compiled once and cached. The RegexPattern class wraps re.compile with a cleaner interface.
Unicode support? Full Unicode support via re.UNICODE flag. Works with Cyrillic, Latin, and other alphabets.
Custom patterns? Use RegexPattern class or pass custom strings to any function that accepts patterns.
📄 License
MIT License — see LICENSE file.
🙏 Acknowledgments
- Python's
remodule — The foundation - Inspired by common regex patterns used in web scraping and data validation
Author: Fkernel653 Repository: github.com/Fkernel653/re-kiss PyPI: pypi.org/project/re-kiss
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fm_dlp-3.6.2.tar.gz.
File metadata
- Download URL: fm_dlp-3.6.2.tar.gz
- Upload date:
- Size: 37.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
023b122c5cd0782c28cc2059b159a2488adcaf2310f6e0603bbba309c6d66cbe
|
|
| MD5 |
5ff611aa825e17eecba3975880d02987
|
|
| BLAKE2b-256 |
71a6609c16baf6babe601863d8003bebff9e2a449bd19c836d442c064b545ed9
|
File details
Details for the file fm_dlp-3.6.2-py3-none-any.whl.
File metadata
- Download URL: fm_dlp-3.6.2-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef6ec991b7f2c0e97ec0307df24d960e22707af4c887ebef9de636f62623aa5c
|
|
| MD5 |
fdb5dcef4cbfd315f48328d4829c4389
|
|
| BLAKE2b-256 |
aafd961241c9189444fcceafcf7751ceef985e3a8c419569d817f389c9f865b4
|