Handy Python utilities for strings, files, timing, and networking.
Project description
roshtools 🛠️
A lightweight Python utility library with handy functions for strings, files, timers, and networking.
Save time on common coding tasks with clean, reusable helpers.
✨ Features
- 🔤 String helpers (
slugify,camel_to_snake) - 📂 File helpers (
read_file,write_file) - ⏱️ Time a function takes to execute (
timer) - 🌐 Simple networking (
get_json)
📦 Installation
pip install roshtools
🚀 Usage Examples
1. String Utilities
from roshtools.strings import slugify, camel_to_snake
print(slugify("Hello World!")) # hello-world
print(camel_to_snake("CamelCase")) # camel_case
2. File Utilities
from roshtools.files import write_file, read_file
write_file("hello.txt", "Hello, World!")
print(read_file("hello.txt")) # Hello, World!
3. Timing Functions
from roshtools import timer
@timer("Processing")
def slow_function():
import time
time.sleep(2)
return "done"
slow_function()
# Output: Processing: 2.0001 seconds
4. Networking
from roshtools import get_json
data = get_json("https://api.github.com")
print(data["current_user_url"])
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roshtools-0.1.5.tar.gz
(5.8 kB
view details)
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 roshtools-0.1.5.tar.gz.
File metadata
- Download URL: roshtools-0.1.5.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
840ea7355519048ae5d82080963783b4ffe15eaad062b06700a5fa23a08fd17f
|
|
| MD5 |
2c1b6fb160d4b7a1dada408e0a9148f6
|
|
| BLAKE2b-256 |
4641e0dad4119d9e7517e88f193bb9ad08f74105a3d598667e6a9045b899c82c
|
File details
Details for the file roshtools-0.1.5-py3-none-any.whl.
File metadata
- Download URL: roshtools-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4ca41dd3f3035f366e0b977aa4502bec5e2dd09f9d56cfb3146bacb38d8fd1a
|
|
| MD5 |
5bda382c82cf19a3edb32e4ca0c9a019
|
|
| BLAKE2b-256 |
94f0f2dce4fc6febeb07d521f8c5ccb91b451637dbc13aca192a98f562043703
|