ðŊ URLCrafter
ðĻ URL Crafting Made Fun!
Tired of wrestling with URL strings? Say goodbye to messy concatenation and hello to URLCrafter! ð
URLCrafter is your friendly neighborhood URL wizard ð§ââïļ, turning URL manipulation from a chore into a breeze. With its chainable API, you'll be crafting URLs like a pro in no time!
Created by Madhav Panchal (2025-03-16)
ðŊ Why Choose URLCrafter?
Python's built-in URL handling can feel like trying to solve a Rubik's cube blindfolded ðĪŠ. URLCrafter swoops in like a superhero ðĶļââïļ to save the day with:
- No more string concatenation nightmares
- Say goodbye to manual URL encoding
- Wave farewell to parameter management headaches
- Welcome to clean, readable, and fun URL manipulation!
ð Installation
pip install urlcrafter
ðŪ Features
ð Chainable API | Build URLs with style and grace |
ð Query Management | Add, remove, update parameters like a boss |
ðĢïļ Path Handling | Navigate paths with ease |
ð URL Encoding | Let URLCrafter handle the encoding magic |
ðĪ Slugify | Turn "My Awesome Post!" into "my-awesome-post" |
ð Fragment Support | Add those fancy #hashtags |
ð§Đ URL Parsing | Break down and rebuild URLs like a pro |
ðŠ Let's Play!
Basic URL Building
from urlcrafter import URL
url = URL("https://example.com").add_path("products").add_param("page", 2).build()
print(url)
url = URL().set_scheme("https").set_netloc("api.example.com").set_path("/v1/users").build()
print(url)
url = URL.parse("https://shop.example.com/products?category=electronics")
url.add_path("laptops").add_param("brand", "apple").remove_param("category")
print(url.build())
ð Fun with Slugify
from urlcrafter import URL
article_title = "10 Python Tips & Tricks for 2025!"
url = URL("https://blog.example.com").add_path("articles").add_slugified_path(article_title).build()
print(url)
ðŊ REST API Magic
from urlcrafter import URL
base_api = URL("https://api.example.com/v1")
users_endpoint = base_api.add_path("users").build()
print(users_endpoint)
user_posts = base_api.add_path("users").add_path("123").add_path("posts").add_param("status", "published").build()
print(user_posts)
ðĪ Join the Party!
Contributions are welcome! Let's make URL manipulation even more awesome together! ð
ð License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with âĪïļ by Madhav Panchal