You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP โ†’
Socket
Book a 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
pipPyPI
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