Skip to main content

Comprehensive cookie library

Project description

The goal of ocookie is to provide a comprehensive API for working with cookies.

cookielib provides cookie management functionality, but the client and server parts are separate and not easily convertible from one to the other. Using cookielib is complicated because it expects httplib request and response objects in order to parse cookies. Lastly, cookielib’s API itself can be improved.

ocookie should satisfy the needs of any application dealing with cookies. Specifically it aims to address the following use cases:

  • HTTP clients/crawlers/scrapers dealing with cookies

  • HTTP servers dealing with cookies

  • HTTP proxies forwarding cookies

  • Test frameworks keeping track of cookies and asserting over cookies

  • Examining cookies returned from a single request

  • Keeping track of session cookies via a cookie jar

  • Maintaining pristine lists of cookie headers

  • Accessing cookies as dictionaries

At the same time ocookie is intended to be easy to use:

  • Client and server interfaces are similar where it makes sense

  • Straightforward conversions from client to server objects and vice versa

  • Clear and intuitive naming conventions

  • Complete documentation

ocookie is not intended to provide a full cookie parser, as this turns out to be a rather complex undertaking. ocookie has a minimal parser that will work for most web sites and applications, and for the remaining cases ocookie will fall back on cookielib for cookie parsing.

Note: API is not yet stable.

Tests

Execute the test suite by running nosetests.

The test suite uses some nose features and will not work with unittest alone.

https://api.travis-ci.org/p/ocookie.png

License

Released under the 2 clause BSD license.

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

ocookie-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file ocookie-0.1.1.tar.gz.

File metadata

  • Download URL: ocookie-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ocookie-0.1.1.tar.gz
Algorithm Hash digest
SHA256 317adeef7c334e9ac86c9af602c295eb243d41fc4e2f02a351b2fd6fb237ce32
MD5 9fc498640646c007237d9edbe8832922
BLAKE2b-256 1f28425d8b129cc5446c69a2801a26f4c745e12bd0156b4e8ae87b3699cd8493

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page