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.3.tar.gz
(4.2 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.3.tar.gz.
File metadata
- Download URL: roshtools-0.1.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b9be6c6a1d11b194c78a7f20183909d57a1175df3892611b0039dbf79ccc335
|
|
| MD5 |
21bdb443c1d96a3ed4c19d4ad04b688e
|
|
| BLAKE2b-256 |
417297c44450050379482c9d5781bb53bb2db13d03b95cca3de1cff08c5d90fa
|
File details
Details for the file roshtools-0.1.3-py3-none-any.whl.
File metadata
- Download URL: roshtools-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.1 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 |
a86b36ac68b518b0985968c4fdd74cc8b398c60202fb4835585580bf11daef40
|
|
| MD5 |
bea9cef88c85c80da53ce58dab8ce3f0
|
|
| BLAKE2b-256 |
ed2cef506026c9b98f7bf64d8ca6f4c18ec680d769f72b37bcd65aa04d9cd4a7
|