Debian Codegraph @

third_party/python/cookies/cookies-2.2.1.dist-info/METADATA

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