# qsreplace
`qsreplace` is a Python utility to replace query parameters in URLs.
## Installation
You can install `qsreplace` using pip:
```bash
pip install qsreplace
```
## Usage
After installing `qsreplace`, you can use it in your Python scripts. Here's how you can use the `qsreplace` function:
```python
from qsreplace import qsreplace
# Example usage
url_lst = ["https://example.com", "https://example.com/?param=value"]
payloads = ["new_value", "another_value"]
replaced_urls = qsreplace(url_lst, payloads, edit_base_url=True, url_encode=True)
for url in replaced_urls:
print(url)
```
Result:
```
https://example.com/new_value
https://example.com/another_value
https://example.com/?param=new_value
https://example.com/?param=another_value
```
In the example above:
- `url_lst` should contain a list of URLs
- `payloads` is a list of values that will replace query parameters in the URLs List
- `edit_base_url` tells qsreplace whether or not to append payload to base urls i.e. which doesn't contain any parameters in it.
- `url_encode` defines whether it should encode the generated urls or not
Raw data
{
"_id": null,
"home_page": "https://github.com/basedygt/qsreplace",
"name": "qsreplace",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "qsreplace, url editor, params editor",
"author": "basedygt",
"author_email": "basedygt@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ac/48/a66b930a5e5cf2fa798cc28182343dd56943f0fb4ec39a04624b0bb72e1e/qsreplace-0.0.4.post1.tar.gz",
"platform": null,
"description": "# qsreplace\n\n`qsreplace` is a Python utility to replace query parameters in URLs.\n\n## Installation\n\nYou can install `qsreplace` using pip:\n\n```bash\npip install qsreplace\n```\n\n## Usage\n\nAfter installing `qsreplace`, you can use it in your Python scripts. Here's how you can use the `qsreplace` function:\n\n```python\nfrom qsreplace import qsreplace\n\n# Example usage\nurl_lst = [\"https://example.com\", \"https://example.com/?param=value\"]\npayloads = [\"new_value\", \"another_value\"]\n\nreplaced_urls = qsreplace(url_lst, payloads, edit_base_url=True, url_encode=True)\n\nfor url in replaced_urls:\n print(url)\n```\n\nResult:\n\n```\nhttps://example.com/new_value\nhttps://example.com/another_value\nhttps://example.com/?param=new_value\nhttps://example.com/?param=another_value\n```\n\nIn the example above:\n- `url_lst` should contain a list of URLs\n- `payloads` is a list of values that will replace query parameters in the URLs List\n- `edit_base_url` tells qsreplace whether or not to append payload to base urls i.e. which doesn't contain any parameters in it.\n- `url_encode` defines whether it should encode the generated urls or not\n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0 License",
"summary": "A utility to replace query parameters in URLs",
"version": "0.0.4.post1",
"project_urls": {
"Homepage": "https://github.com/basedygt/qsreplace"
},
"split_keywords": [
"qsreplace",
" url editor",
" params editor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d1033b7aa1c098e79ebef3794806d73f31657516163df517afe45533d3a46fd0",
"md5": "f0101ea8d7a3e8a78a60df31c0440cb1",
"sha256": "8a8b71a2a0c233a995974181d1e737d4c2d07c8c00a24dc8be301ffaf0cdc8c0"
},
"downloads": -1,
"filename": "qsreplace-0.0.4.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f0101ea8d7a3e8a78a60df31c0440cb1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6422,
"upload_time": "2024-06-23T13:59:00",
"upload_time_iso_8601": "2024-06-23T13:59:00.492767Z",
"url": "https://files.pythonhosted.org/packages/d1/03/3b7aa1c098e79ebef3794806d73f31657516163df517afe45533d3a46fd0/qsreplace-0.0.4.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac48a66b930a5e5cf2fa798cc28182343dd56943f0fb4ec39a04624b0bb72e1e",
"md5": "e972f937790a0898500f2f5ed4a226dc",
"sha256": "e44197e7fbc48860911b4ebe4e31dac31aaacdf16131b807fb3ffd4cb6eb367b"
},
"downloads": -1,
"filename": "qsreplace-0.0.4.post1.tar.gz",
"has_sig": false,
"md5_digest": "e972f937790a0898500f2f5ed4a226dc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6107,
"upload_time": "2024-06-23T13:59:02",
"upload_time_iso_8601": "2024-06-23T13:59:02.548433Z",
"url": "https://files.pythonhosted.org/packages/ac/48/a66b930a5e5cf2fa798cc28182343dd56943f0fb4ec39a04624b0bb72e1e/qsreplace-0.0.4.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-23 13:59:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "basedygt",
"github_project": "qsreplace",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "qsreplace"
}