Skip to main content

cookiesparser is a mini module for parsing cookies.

Project description

cookiesparser

GitHub GitHub release (latest by date) PyPI

Description

cookiesparser is a mini module for parsing cookies 🍪✨. This basic but super useful tool allows you to easily extract and encode cookies from strings.

Installation

You can install cookiesparser using pip:

pip install cookiesparser

Usage

import cookiesparser as cparser

c = "token=xyz789; userId=42; color=blue;"
parsed = cparser.parse(c)
encoded = cparser.encode(parsed)
token = cparser.get_cookie(c, "token")
print(f"Orignal: {c}")
print(f"Parsed: {parsed}")
print(f"Encoded: {encoded}")
print(f"Token: {token}")

Output

Orignal: token=xyz789; userId=42; color=blue;
Parsed: {'token': 'xyz789', 'userId': '42'}
Encoded: token=xyz789; userId=42
Token: xyz789

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on the GitHub repository.

License

cookiesparser is released under the Apache 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

cookiesparser-1.4.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

cookiesparser-1.4.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file cookiesparser-1.4.0.tar.gz.

File metadata

  • Download URL: cookiesparser-1.4.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cookiesparser-1.4.0.tar.gz
Algorithm Hash digest
SHA256 52f6a3941c64020d654acb902063b5d6ca4d241874ec4a4704d243a4c6159bb0
MD5 30a26933bcaef445815c8626c9fc21b5
BLAKE2b-256 1a7464911da610dd96d1ced935e3ee9027e7bea3197728cfc5e800cf3902e2cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiesparser-1.4.0.tar.gz:

Publisher: workflow.yml on farhaanaliii/cookiesparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cookiesparser-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cookiesparser-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b1f0feeab0ba0dc8a0d81bbed240e5ab8b82e50bae7f0a4dab4f902ba582711
MD5 295d42ef7c9c9a012e862f097ae0026f
BLAKE2b-256 14f3ecff5849b37f90751f6cc7497be4b6c65e188b6424c150ed7c5eafa9e7ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiesparser-1.4.0-py3-none-any.whl:

Publisher: workflow.yml on farhaanaliii/cookiesparser

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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