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.2.tar.gz
(3.7 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.2.tar.gz.
File metadata
- Download URL: roshtools-0.1.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dd5520ec3e63f16fb492748ab18bcee7d8e83133ff507d5f2e6fb3b6900d6ad
|
|
| MD5 |
7d3baca49da600432b98381879a5a102
|
|
| BLAKE2b-256 |
b768ce9a4162690547f053184598f98be02b46324729d31f7be2640c1530b7c4
|
File details
Details for the file roshtools-0.1.2-py3-none-any.whl.
File metadata
- Download URL: roshtools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 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 |
be85c50f735cb9bfb28165c580ea740d78afc090186b24c30280f5f32f00a1f4
|
|
| MD5 |
863f15e864daf7f9cfad653acb0c81c6
|
|
| BLAKE2b-256 |
f5c0cd119f29da4cb1907ffe4527694b6bed1ad5cd25a21f82f5e15343f1a257
|