Skip to main content

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 url_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

URLDecoder-1.0.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

URLDecoder-1.0.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file URLDecoder-1.0.0.tar.gz.

File metadata

  • Download URL: URLDecoder-1.0.0.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

Hashes for URLDecoder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 757ece3e5f336e27c88bb3ef5d1ac2c14c9a24afa540d40bd39a71208b8a1e9c
MD5 22cd1051d17946df2ef517617c7dd72d
BLAKE2b-256 8924fb85bf50d614db35a7351e4c808d44979a57649de9d1868da0f4b96f2949

See more details on using hashes here.

File details

Details for the file URLDecoder-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: URLDecoder-1.0.0-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

Hashes for URLDecoder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6611792528773207f87ed404caaa0bd9742465ed1d6f2e1f78959beac15f64e6
MD5 9af4ac28194277e88e016e46a6e47eaa
BLAKE2b-256 d95f955a7b95f73b3cd226c163f8f1621c3740bbbc2723c35015e5d7091c0ffb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page