Simple package for parsing querystrings into nested dictionaries and vice versa.
Project description
qstion
A querystring parsing and stringifying library with some added security. Library was based on this js library.
Usage
import qstion as qs
x = qs.parse('a=c')
assert x == {'a': 'c'}
x_str = qs.stringify(x)
assert x_str == 'a=c'
Documentation details
Full documentation reference: https://www.npmjs.com/package/qs Result of parsing can be returned as root object if needed, but default implementation is to return a dictionary.
Not supported
Parser:
plainObjectsignoreQueryPrefix- alwaysFalse, query is always considered without prefixStrict null handling
Stringifier:
- custom
encoderanddecoderfunctions sortingof keysfilteringof keys
Additional support
- parsing
primitivevalues:int,floatare represented asdecimal.Decimal, bool-like values are represented asboolwhatever the case they are in, however this can be processed strictly usingprimitive_strictoption, null-like values are represented asNone
Modifications:
Parser:
sparse arraysare represented as dictionaries with keys as indexesundefinedvalues are represented as strings'undefined'- queries such as
awithout=are considered as non-value and thus are not included in the result
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qstion-1.1.7.tar.gz.
File metadata
- Download URL: qstion-1.1.7.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc3bf6c31481b6d33816142b6f3afb8dfa5438403b15f7d4cb2846f6d495f17b
|
|
| MD5 |
f4395002f242f8081b8960b933e8bc5d
|
|
| BLAKE2b-256 |
04e81cbd625f04d7d8f3097f88912c1aa2dec426419a947a8b7e718798acd4a2
|
File details
Details for the file qstion-1.1.7-py3-none-any.whl.
File metadata
- Download URL: qstion-1.1.7-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2c00532a26527dd9778776a63f9148973f2eaee30054c78648e9d343e668438
|
|
| MD5 |
e4aee1daa284819cf830707d7979cd22
|
|
| BLAKE2b-256 |
72abbb442adee129f99df057ff0f3fba33af722ac33b9bc5c3ae0abe48cbbf73
|