🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
DemoInstallSign in
Socket

urlcrafter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlcrafter

ðŸŽŊ Your friendly URL wizard - Craft, manipulate, and manage URLs with style!

0.1.5
Source
PyPI
Maintainers
1

ðŸŽŊ URLCrafter

URLCrafter Logo

PyPI version Python Versions License: MIT

ðŸŽĻ 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

FeatureDescription
🔗 Chainable APIBuild URLs with style and grace
🔄 Query ManagementAdd, remove, update parameters like a boss
ðŸ›Ģïļ Path HandlingNavigate paths with ease
🔒 URL EncodingLet URLCrafter handle the encoding magic
ðŸ”Ī SlugifyTurn "My Awesome Post!" into "my-awesome-post"
📊 Fragment SupportAdd those fancy #hashtags
ðŸ§Đ URL ParsingBreak down and rebuild URLs like a pro

🎊 Let's Play!

Basic URL Building

from urlcrafter import URL

# Build a simple URL
url = URL("https://example.com").add_path("products").add_param("page", 2).build()
print(url)  # https://example.com/products?page=2

# Create a URL from scratch
url = URL().set_scheme("https").set_netloc("api.example.com").set_path("/v1/users").build()
print(url)  # https://api.example.com/v1/users

# Parse and modify an existing 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())  # https://shop.example.com/products/laptops?brand=apple

🎭 Fun with Slugify

from urlcrafter import URL

# Turn any text into a URL-friendly slug
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)  # https://blog.example.com/articles/10-python-tips-tricks-for-2025

ðŸŽŊ REST API Magic

from urlcrafter import URL

# Build REST API endpoints with ease
base_api = URL("https://api.example.com/v1")

# GET /users
users_endpoint = base_api.add_path("users").build()
print(users_endpoint)  # https://api.example.com/v1/users

# GET /users/123/posts?status=published
user_posts = base_api.add_path("users").add_path("123").add_path("posts").add_param("status", "published").build()
print(user_posts)  # https://api.example.com/v1/users/123/posts?status=published

ðŸĪ 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

Keywords

url

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts