Skip to main content

⚠️ DEPRECATED: This package is deprecated and therefore obsolete. Please use the new package binarycookies instead.

Github Actions Status

Binary Cookies

Python library and CLI tool for reading and writing binary cookies files.

Requirements

  • Python 3.9 or higher

Installation

pip install binarycookies

If you want to use the parser as CLI, it's recommended to use pipx to install the package in an isolated environment.

pipx install binarycookies

Basic Usage CLI

After installation, you can use the command-line interface to read a binary cookies file:

bcparser <path_to_binary_cookies_file>

Replace <path_to_binary_cookies_file> with the path to the binary cookie file you want to read.

Basic Usage Python

Deserialization

import binarycookies 

with open("path/to/cookies.binarycookies", "rb") as f:
    cookies = binarycookies.load(f)

Serialization

import binarycookies 

cookie = {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure"
}

with open("path/to/cookies.binarycookies", "wb") as f:
    binarycookies.dump(cookie, f)

Output Types

The bcparser CLI supports two output types: json (default) and ascii.

JSON Output

The json output type formats the cookies as a JSON array, making it easy to parse and manipulate programmatically.

Example usage:

bcparser path/to/cookies.binarycookies --output json

Example output JSON:

[
  {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure"
  },
  {
    "name": "user_token",
    "value": "xyz789",
    "url": "https://example.com",
    "path": "/account",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "HttpOnly"
  }
]

ASCII Output

The ascii output type formats the cookies in a simple, line-by-line text format, making it easy to read and pipe to other command-line tools.

Example usage:

bcparser path/to/cookies.binarycookies --output ascii

Example output ASCII:

Name: session_id
Value: abc123
URL: https://example.com
Path: /
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: Secure
----------------------------------------
Name: user_token
Value: xyz789
URL: https://example.com
Path: /account
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: HttpOnly
----------------------------------------

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome.

Metadata

Release files for binary-cookies-parser 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binary-cookies-parser 2.1.2
File Size Uploaded
binary_cookies_parser-2.1.2.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binary-cookies-parser 2.1.2
File Interpreter ABI Platform
binary_cookies_parser-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.9 kB

Release files / binary_cookies_parser-2.1.2.tar.gz

Download URL binary_cookies_parser-2.1.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d43fd057e10498579ab4343b5ea6582e6a649ae1cf44181fd7e3bb05ace3b3e3
BLAKE2b-256 checksum
How to use checksums
a756c117d7186bc2dcde3fbad2f01c2c3f2df896d5119a3b704ac97c1f011b19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.9 Darwin/24.5.0

Release files / binary_cookies_parser-2.1.2-py3-none-any.whl

Download URL binary_cookies_parser-2.1.2-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d33a1be0d5e0bda9c1bc338a542f04dcc12f80b05e82282aaf904545650e5b3b
BLAKE2b-256 checksum
How to use checksums
d3890b7e5e8a23c9fe366bc9561ab0687e1473c757babe2a4bbf1521ed682ecf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.9 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page