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:
plainObjects
ignoreQueryPrefix
- alwaysFalse
, query is always considered without prefixStrict null handling
Stringifier:
- custom
encoder
anddecoder
functions sorting
of keysfiltering
of keys
Additional support
- parsing
primitive
values:int
,float
are represented asdecimal.Decimal
, bool-like values are represented asbool
whatever the case they are in, however this can be processed strictly usingprimitive_strict
option, null-like values are represented asNone
Modifications:
Parser:
sparse arrays
are represented as dictionaries with keys as indexesundefined
values are represented as strings'undefined'
- queries such as
a
without=
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
qstion-1.1.5.tar.gz
(19.5 kB
view details)
Built Distribution
qstion-1.1.5-py3-none-any.whl
(15.6 kB
view details)
File details
Details for the file qstion-1.1.5.tar.gz
.
File metadata
- Download URL: qstion-1.1.5.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b9c3e19ccb6f2fb16870bd374766fd4c8c04bf3a0555f4d745b37d26559828 |
|
MD5 | d3b53f6e1a83cdfd4c11082e8b6b0fde |
|
BLAKE2b-256 | 610840ace19974f8d7ad7f422c2647ede37058cc785cc7832f3c5ea1b9d2caa5 |
File details
Details for the file qstion-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: qstion-1.1.5-py3-none-any.whl
- Upload date:
- Size: 15.6 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 | fd0d6d2cf2462c18282b4d075e8b59e73d211fd670e5b4498f028471638982e5 |
|
MD5 | 4d5669bcb810e7d7bed872c92e2b7ab6 |
|
BLAKE2b-256 | 12a4aa94637c23aa5637b050937387ffd76908933de51f9275666663498aad83 |