A simple URL decoder that converts URL-encoded strings to JSON objects
Project description
URLDecoder
URLDecoder is a simple yet effective Python library designed to decode URL-encoded strings and convert them into JSON objects. This tool aims to streamline the process of transforming complex URL-encoded strings into a more human-readable and manageable format. With its easy-to-use functionality, URLDecoder can be a valuable addition to any project that requires processing and understanding URL-encoded data. Whether you are working with APIs, web scraping, or data analysis tasks, URLDecoder can help you efficiently decode and interpret URL parameters in a structured way.
Installation
URLDecoder can be installed using pip:
pip install urldecoder
Usage
URLDecoder can be used to decode URL-encoded strings and convert them into JSON objects. The following example demonstrates how to use URLDecoder to decode a URL-encoded string:
from URLDecoder.decoder import URLDecoder
# Example URL-encoded string
url_encoded_string = "name=Adam%20Tan&age=25&city=San%20Jose"
# Initialize the URLDecoder class
decoder = URLDecoder()
# Decode the URL-encoded string and convert it to a dictionary object
decoded_url = decoder.to_dict(url_encoded_string)
print(decoded_url)
# Convert the dictionary object to a JSON object
json_object = decoder.to_json(url_encoded_string)
print(json_object)
The output of the above code is:
{'name': 'Adam Tan', 'age': 25, 'city': 'San Jose'}
{
"name": "Adam Tan",
"age": "25",
"city": "San Jose"
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
URLDecoder is licensed under the MIT License. See LICENSE for more information.
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
Built Distribution
File details
Details for the file URLDecoder-1.0.1.tar.gz
.
File metadata
- Download URL: URLDecoder-1.0.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 392b0257999e803b590d46bf73728bc6f81f16e01846f56303afb47982dcc4b8 |
|
MD5 | 97d729f3857ff2c240707d8714e592b7 |
|
BLAKE2b-256 | 8cced6404e0e88731d66433a56dbae8631d602cc6184189c86bfae4fd61fb129 |
File details
Details for the file URLDecoder-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: URLDecoder-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbbffb976e35218d2a80639fc7c20969037bfa1dd7310f2712a0fe367d582ca4 |
|
MD5 | fb75379238aef410db082af484e1436f |
|
BLAKE2b-256 | c4925a18e543bde85fc317a703c864df5de64a09b70aacabb7ec0fa7db1492ad |