Fast and tasty cookies handling.
Project description
Biscuits
Low level API for handling cookies server side.
Install
pip install biscuits
API
# Parse a "Cookie:" header value:
from biscuits import parse
parse('some=value; and=more')
> {'some': 'value', 'and': 'more'}
# Generate a "Set-Cookie:" header value:
from biscuits import Cookie
cookie = Cookie(name='foo', value='bar', domain='www.example.org')
str(cookie)
> "foo=bar; Domain=www.example.org; Path=/"
Building from source
pip install cython
make compile
python setup.py develop
Testing
make test
Benchmark
See Benchmark for more details.
Changelog
0.2
- unescape antislash when parsing to be consistent with quoting (cf #3)
- unescape octal ascii when parsing to be consistent with quoting (cf #4)
0.3
- add support for the SameSite attribute (cf #8)
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
biscuits-0.3.0.tar.gz
(58.6 kB
view details)
File details
Details for the file biscuits-0.3.0.tar.gz
.
File metadata
- Download URL: biscuits-0.3.0.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b899164133c81b99b7307d629a45e2fb6a3bcc3ea7c08b1ff24b464b411307 |
|
MD5 | 29e878ac5896fad85371800a815d6332 |
|
BLAKE2b-256 | 849de69b0e01b21d73d1997d1065bafb54d218234114c82eb49e4e5703bfac8a |