The Python utility toolbox you didn't know you needed β until now.
One package. Minimal dependencies. Maximum productivity.
Perfect for GSoC, open-source contributors, backend engineers & interview projects
Built with real-world backend failures in mind β not toy examples.
Installation β’ Features β’ Quick Start β’ Documentation β’ Contributing
Stop installing 5+ packages for basic Python tasks. pyquicktools combines the most-needed utilities into one lightweight, blazing-fast package:
Auto-retry HTTP requests with exponential backoff
Colorized debug printing with file/line tracking
Async retry support for aiohttp
Safe JSON parsing that fixes common errors
Minimal configuration β works out of the box
Before pyquicktools:
pip install requests tenacity simplejson pprint coloramaAfter pyquicktools:
pip install pyquicktoolspip install pyquicktoolsRequirements: Python 3.8+
Never lose data to flaky APIs again. Automatic retries with exponential backoff.
from pyquicktools import get, post
# Auto-retry on failure (default: 3 retries)
response = get("https://api.example.com/data", retries=5, timeout=10)
print(response.json())
# Works with POST too
response = post(
"https://api.example.com/submit",
json={"name": "Suhani"},
retries=3,
retry_statuses=[429, 500, 502, 503]
)Features:
- Exponential backoff (1s β 2s β 4s β 8s)
- Retry on specific status codes (429, 500, 502, 503)
- Configurable timeout per request
- Safe POST retries using idempotency keys (no accidental double writes)
Say goodbye to boring print() statements. Get beautiful, informative debug output.
from pyquicktools import dprint
user = {"name": "Suhani", "age": 22}
items = ["laptop", "phone", "charger"]
dprint(user, items)Output:
π main.py:12 β [user={'name': 'Suhani', 'age': 22}] [items=['laptop', 'phone', 'charger']]
Features:
- Color-coded output (variables in cyan, values in green)
- Automatic file + line number tracking
- Named arguments shown clearly
- Minimal configuration β just replace
print()withdprint()
Advanced usage:
# Disable colors
dprint(data, color=False)
# Custom separator
dprint(x, y, z, sep=" | ")
# Show only values (no variable names)
dprint(user, items, show_names=False)
# File logging support (via standard print file argument)
dprint(error_data, file=open("debug.log", "a"))Supercharge your async code with automatic retries.
β οΈ Note: Async features requireaiohttp.
Install with:pip install pyquicktools aiohttp
import asyncio
from pyquicktools import async_get
async def fetch_data():
# Auto-retry async requests
data = await async_get(
"https://api.example.com/data",
retries=3,
timeout=5
)
print(data)
return data
asyncio.run(fetch_data())Features:
- Async/await support with
aiohttp - Same retry logic as sync version
- Perfect for high-throughput applications
Parse JSON that's almost-but-not-quite valid. Fixes common errors automatically.
from pyquicktools import load_json
# Handles trailing commas, comments, NaN, Infinity
data = load_json("""
{
"name": "Suhani", // This is a comment
"age": "22", // String will be converted to int
"score": NaN, // Will be converted to None
}
""")
print(data["age"]) # Output: 22 (int, not string!)Auto-fixes:
- Trailing commas in arrays/objects
- JavaScript-style comments (
//and/* */) NaNandInfinityvalues- Optional smart typecasting for numeric strings
from pyquicktools import get, dprint
try:
response = get(
"https://api.github.com/users/Suhani1234-5",
retries=3,
timeout=5
)
data = response.json()
dprint(data["name"], data["public_repos"])
except Exception as e:
dprint(f"Error: {e}", color=False)import asyncio
from pyquicktools import async_get
async def fetch_multiple():
urls = [
"https://api.example.com/1",
"https://api.example.com/2",
"https://api.example.com/3"
]
tasks = [async_get(url, retries=2) for url in urls]
results = await asyncio.gather(*tasks)
for data in results:
print(data)
asyncio.run(fetch_multiple())from pyquicktools import load_json
# From API response with comments
messy_json = """
{
"users": [
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}, // trailing comma
],
"total": "100", // Should be int
}
"""
data = load_json(messy_json)
print(type(data["total"])) # <class 'int'>Parameters:
url(str): Target URLretries(int): Max retry attempts (default: 3)timeout(int): Request timeout in seconds (default: 5)retry_statuses(list): HTTP status codes to retry on**kwargs: Additional arguments passed torequests.get()
Returns: requests.Response object
Parameters:
url(str): Target URLretries(int): Max retry attempts (default: 3)timeout(int): Request timeout in seconds (default: 5)retry_statuses(list): HTTP status codes to retry on**kwargs: Additional arguments passed torequests.post()
Returns: requests.Response object
Parameters:
*args: Variables to printcolor(bool): Enable colored output (default: True)sep(str): Separator between arguments (default: ' ')show_names(bool): Show variable names (default: True)**kwargs: Additional arguments passed to built-inprint()(includingfilefor logging)
Parameters:
json_string(str): JSON string to parseauto_typecast(bool): Automatically convert string numbers to int/float (default: True)
Returns: Parsed Python dict/list
from pyquicktools import get
response = get(
"https://api.example.com/data",
retries=5,
retry_statuses=[429, 500, 502, 503, 504],
timeout=10,
headers={"Authorization": "Bearer YOUR_TOKEN"}
)from pyquicktools import dprint
# In production: disable colors for log files
with open("debug.log", "a") as log_file:
dprint(error_data, color=False, file=log_file)We love contributions! Here's how to get started:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
git clone https://github.com/Suhani1234-5/pyquicktools.git
cd pyquicktools
pip install -e ".[dev]"
pytestThis project is licensed under the MIT License - see the LICENSE file for details.
If you find this project useful, please consider giving it a β on GitHub!
Suhani Garg
π§ suhanigarg59@gmail.com
GitHub
Made with β€οΈ by Suhani Garg