Debian Codegraph @

cookies.egg-info/PKG-INFO

raw
1 Metadata-Version: 1.1
2 Name: cookies
3 Version: 2.2.1
4 Summary: Friendlier RFC 6265-compliant cookie parser/renderer
5 Home-page: https://github.com/sashahart/cookies
6 Author: Sasha Hart
7 Author-email: [email protected]
8 License: UNKNOWN
9 Description: What is this and what is it for?
10 --------------------------------
11
12 cookies.py is a Python module for working with HTTP cookies: parsing and
13 rendering 'Cookie:' request headers and 'Set-Cookie:' response headers,
14 and exposing a convenient API for creating and modifying cookies. It can be
15 used as a replacement of Python's Cookie.py (aka http.cookies).
16
17 Features
18 --------
19
20 * Rendering according to the excellent new RFC 6265
21 (rather than using a unique ad hoc format inconsistently relating to
22 unrealistic, very old RFCs which everyone ignored). Uses URL encoding to
23 represent non-ASCII by default, like many other languages' libraries
24 * Liberal parsing, incorporating many complaints about Cookie.py barfing
25 on common cookie formats which can be reliably parsed (e.g. search 'cookie'
26 on the Python issue tracker)
27 * Well-documented code, with chapter and verse from RFCs
28 (rather than arbitrary, undocumented decisions and huge tables of magic
29 values, as you see in Cookie.py).
30 * Test coverage at 100%, with a much more comprehensive test suite
31 than Cookie.py
32 * Single-source compatible with the following Python versions:
33 2.6, 2.7, 3.2, 3.3 and PyPy (2.7).
34 * Cleaner, less surprising API::
35
36 # old Cookie.py - this code is all directly from its docstring
37 >>> from Cookie import SmartCookie
38 >>> C = SmartCookie()
39 >>> # n.b. it's "smart" because it automatically pickles Python objects,
40 >>> # which is actually quite stupid for security reasons!
41 >>> C["rocky"] = "road"
42 >>> C["rocky"]["path"] = "/cookie"
43 >>> # So C["rocky"] is a string, except when it's a dict...
44 >>> # and why do I have to write [""] to access a fixed set of attrs?
45 >>> # Look at the atrocious way I render out a request header:
46 >>> C.output(attrs=[], header="Cookie:")
47 'Cookie: rocky=road'
48
49 # new cookies.py
50 >>> from cookies import Cookies, Cookie
51 >>> cookies = Cookies(rocky='road')
52 >>> # Can also write explicitly: cookies['rocky'] = Cookie['road']
53 >>> cookies['rocky'].path = "/cookie"
54 >>> cookies.render_request()
55 'rocky=road'
56 * Friendly to customization, extension, and reuse of its parts.
57 Unlike Cookie.py, it doesn't lock all implementation inside its own classes
58 (forcing you to write ugly wrappers as Django, Trac, Werkzeug/Flask, web.py
59 and Tornado had to do). You can suppress minor parse exceptions with
60 parameters rather than subclass wrappers. You can plug in your own parsers,
61 renderers and validators for new or existing cookie attributes. You can
62 render the data out in a dict. You can easily use the underlying imperative
63 API or even lift the parser's regexps for your own parser or project. They
64 are very well documented and relate directly to RFCs, so you know exactly
65 what you are getting and why. It's MIT-licensed so do
66 what you want (but I'd love to know what use you are getting from it!)
67 * One file, so you can just drop cookies.py into your project if you like
68 * MIT license, so you can use it in whatever you want with no strings
69
70 Things this is not meant to do
71 ------------------------------
72 While this is intended to be a good module for handling cookies, it does not
73 even try to do any of the following:
74
75 * Maintain backward compatibility with Cookie.py, which would mean
76 inheriting its confusions and bugs
77 * Implement RFCs 2109 or 2965, which have always been ignored by almost
78 everyone and are now obsolete as well
79 * Handle every conceivable output from terrible legacy apps, which is not
80 possible to do without lots of silent data loss and corruption (the
81 parser does try to be liberal as possible otherwise, though)
82 * Provide a means to store pickled Python objects in cookie values
83 (that's a big security hole)
84
85 This doesn't compete with the cookielib (http.cookiejar) module in the Python
86 standard library, which is specifically for implementing cookie storage and
87 similar behavior in an HTTP client such as a browser. Things cookielib does
88 that this doesn't:
89
90 * Write to or read from browsers' cookie stores or other proprietary
91 formats for storing cookie data in files
92 * Handle the browser/client logic like deciding which cookies to send or
93 discard, etc.
94
95 If you are looking for a cookie library but neither this one nor cookielib
96 will help, you might also consider the implementations in WebOb or Bottle.
97
98 Platform: UNKNOWN
99 Classifier: Development Status :: 4 - Beta
100 Classifier: Environment :: Other Environment
101 Classifier: Intended Audience :: Developers
102 Classifier: License :: OSI Approved :: MIT License
103 Classifier: Programming Language :: Python :: 2.6
104 Classifier: Programming Language :: Python :: 2.7
105 Classifier: Programming Language :: Python :: 3
106 Classifier: Programming Language :: Python :: 3.2
107 Classifier: Programming Language :: Python :: 3.3
108 Classifier: Programming Language :: Python :: Implementation :: PyPy
109 Classifier: Topic :: Software Development :: Libraries :: Python Modules