快速且美味的饼干处理。
项目描述
Biscuits
处理服务器端cookie的低级API。
安装
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=/"
从源码构建
pip install cython
make compile
python setup.py develop
测试
make test
基准测试
更多信息请见 基准测试。
变更日志
0.2
- 解析时转义反斜杠以保持引号一致性(参考 #3)
- 解析时转义八进制ASCII以保持引号一致性(参考 #4)
0.3
- 添加对SameSite属性的 支持(参考 #8)