URL Toolkit
A comprehensive URL manipulation tool for developers.
Features
- - Encode - Encode URL (percent encoding)
- Decode - Decode URL
- Parse - Parse URL into components (scheme, host, path, query, etc.)
- Query Parse - Parse query string into key-value pairs
- Query Build - Build query string from key-value pairs
Usage
CODEBLOCK0
Actions
| Action | Description |
|---|
| INLINECODE0 | URL encode a string |
| INLINECODE1 |
URL decode a string |
|
parse | Parse URL into components |
|
query-parse | Parse query string to JSON |
|
query-build | Build query string from JSON |
Options
| Option | Type | Default | Description |
|---|
| INLINECODE5 | string | - | Input string or URL |
| INLINECODE6 |
bool | false | Full encoding (all chars) vs safe encoding |
Examples
CODEBLOCK1
Use Cases
- 1. API development - Encode/decode URL parameters
- Web scraping - Parse URLs and extract components
- Debugging - Inspect query parameters
- URL building - Construct URLs from components
- Data processing - Clean and normalize URLs
Current Status
Ready for testing.
URL 工具包
为开发者提供的全面URL操作工具。
功能特性
- - 编码 - 对URL进行编码(百分比编码)
- 解码 - 对URL进行解码
- 解析 - 将URL解析为各个组成部分(协议、主机、路径、查询参数等)
- 查询参数解析 - 将查询字符串解析为键值对
- 查询参数构建 - 从键值对构建查询字符串
使用方法
bash
python3 skills/url-toolkit/scripts/url_toolkit.py <操作> [选项]
操作指令
| 操作 | 描述 |
|---|
| encode | 对字符串进行URL编码 |
| decode |
对字符串进行URL解码 |
| parse | 将URL解析为组成部分 |
| query-parse | 将查询字符串解析为JSON格式 |
| query-build | 从JSON构建查询字符串 |
选项参数
| 选项 | 类型 | 默认值 | 描述 |
|---|
| --input | 字符串 | - | 输入字符串或URL |
| --full |
布尔值 | false | 完全编码(所有字符)与安全编码 |
示例
bash
URL编码
python3 skills/url-toolkit/scripts/url_toolkit.py encode --input hello world
输出: {success: true, result: hello%20world}
URL解码
python3 skills/url-toolkit/scripts/url_toolkit.py decode --input hello%20world
输出: {success: true, result: hello world}
解析URL
python3 skills/url-toolkit/scripts/url_toolkit.py parse --input https://example.com:8080/path?q=test&id=123#section
输出: {success: true, result: {scheme: https, host: example.com, ...}}
解析查询字符串
python3 skills/url-toolkit/scripts/url_toolkit.py query-parse --input q=test&id=123&name=hello+world
输出: {success: true, result: {q: test, id: 123, name: hello world}}
构建查询字符串
python3 skills/url-toolkit/scripts/url_toolkit.py query-build --input {q:test,id:123,name:hello world}
输出: {success: true, result: q=test&id=123&name=hello%20world}
应用场景
- 1. API开发 - 对URL参数进行编码/解码
- 网页抓取 - 解析URL并提取组成部分
- 调试排查 - 检查查询参数
- URL构建 - 从组成部分构建URL
- 数据处理 - 清理和规范化URL
当前状态
已准备好进行测试。