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.4.tar.gz
(18.9 kB
view details)
Built Distribution
qstion-1.1.4-py3-none-any.whl
(15.4 kB
view details)
File details
Details for the file qstion-1.1.4.tar.gz
.
File metadata
- Download URL: qstion-1.1.4.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 774672ee8c566ee3259d324f75a716cf8a8145fc339d8625a431830b91ab01f2 |
|
MD5 | 4ef7277d69941e2918c359aedc8a6611 |
|
BLAKE2b-256 | 04f6086d2319d30721ac77e9c8208fc7780c7fc696972e92dae4267aec8e1d70 |
File details
Details for the file qstion-1.1.4-py3-none-any.whl
.
File metadata
- Download URL: qstion-1.1.4-py3-none-any.whl
- Upload date:
- Size: 15.4 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 | 7c636ca255bb7521f726f0f502f956ec425df0381f48f0a9f889e6f2e7e7ced4 |
|
MD5 | dd8e2ff5b5ad9613a372618429a472c8 |
|
BLAKE2b-256 | 8deff056c1f194d256584d2c103cdebcf6d0055afcf245bfff83b18a49a64f73 |