Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

rookie-cookies (Python)

Extract cookies from local browsers on Linux, macOS, and Windows.

This file is the Python guide (PyPI landing page and repo tutorial). Rust stays in rookie-rs/README.md. The tree may still publish as 0.6.0-alpha.x. The recommended 0.6 entry is jar / read (ADR 0004).

CPython ≥ 3.11. Wheels are cp311-abi3 (tested 3.11–3.14). CPython 3.8–3.10 and PyPy are not supported in 0.6.

pip install rookie-cookies

Recommended 0.6.0 usage

import rookie_cookies as cookies

# Session import — pass profile= for session cookies
session_jar = cookies.jar(browser="chrome", profile="Default")

# Domain-intact records (storage_state / allowlists)
rows = cookies.read(browser="chrome", profile="Work").as_list()
header = cookies.read(browser="chrome", profile="Default").header(
    "https://example.com/"
)

jar is read(...).as_jar(). read never URL-filters; http.cookiejar owns send-match. There is no module-level header() — call ReadResult.header(url) on a snapshot you already took.

  • No-profile read(browser="chrome") matches chrome() (persistent / legacy-eligible cookies).
  • Naming a profile includes session cookies.
  • Session import (including NotebookLM-style flows) should pass profile=.

Named helpers (chrome(), firefox(), load()) still work. They are the compatibility bridge from thewh1teagle/rookie and will break in a later major version. Prefer read / jar for new code.

Reports

read / chrome() flatten one source. Reports keep every profile and failure visible. Identifiers and codes are open snake_case strings.

from rookie_cookies import browser_profiles, browser_report, supported_browsers

for browser in supported_browsers():
    print(browser["id"], browser["display_name"], browser["engine"])

for profile in browser_profiles("chrome"):
    print(profile["profile"]["profile_id"], profile["profile"]["display_name"])

report = browser_report("chrome", domains=["example.com"])
assert report["schema_version"] == 1
for profile in report["profiles"]:
    for source in profile["sources"]:
        if source["selected"] and source["status"] == "succeeded":
            print(source["source"]["path"], len(source["cookies"]))

Job-layer aliases (same DTO):

import rookie_cookies

descriptors = rookie_cookies.profiles("chrome")
report = rookie_cookies.report(browser="chrome", profile="Default")

A missing install is status == "no_sources", not an empty success. Bad requests raise RookieRequestError. Engine failures raise RookieEngineError. schema_version versions the DTO; reject unknown values. termination (completed, timed_out, cancelled, resource_exhausted) is independent of status. Issues count every hit in occurrences but keep at most MAX_ISSUE_SAMPLES in samples.

supported_browsers() is registration, not detection. chrome() stays default-first. chrome_profiles() / chrome_profile() add activity-hint order and a grouped report; lossy paths need the opaque profile_id. load_report() covers every registered browser.

Explicit paths

from rookie_cookies import chromium_cookies_from_path, cookies_from_path

firefox = cookies_from_path("/path/to/cookies.sqlite", ["example.com"])
chrome = chromium_cookies_from_path(
    "/path/to/Chrome/Default/Network/Cookies",
    {"browser_id": "chrome", "domains": ["example.com"]},
)

At most one of browser_id, local_state_path, plaintext_only=True. Zero selectors is Automatic (Linux/macOS platform keys; Windows Chromium paths raise missing_local_state_file instead of guessing). Request faults on these three path APIs are RookieRequestError, not a bare RuntimeError.

any_browser(), chromium_based*, and flat firefox_based() are deprecated until ≥ 0.7. firefox_based_detailed() stays for container context.

Timeouts and cancellation

read / jar / cookies_from_path take timeout (seconds) and cancellation. Chromium path options accept the same keys.

import threading
import rookie_cookies

cancellation = rookie_cookies.CancellationHandle()
timer = threading.Timer(5, cancellation.cancel)
timer.start()

try:
    rows = rookie_cookies.read(
        browser="chrome",
        profile="Default",
        timeout=30,
        cancellation=cancellation,
    ).as_list()
except RuntimeError as error:
    if "operation deadline expired" in str(error):
        print("timed out")
    elif "operation cancelled" in str(error):
        print("cancelled")
    else:
        raise
finally:
    timer.cancel()

Netscape

from rookie_cookies import chrome, to_netscape

output = to_netscape(chrome())

Tabs / CR / LF in cookie fields become %09 / %0D / %0A. Same bytes as Rust, CLI, and Node for the same cookies.

0.5.6 API

In the 0.5.6 line the public surface was the flat named-browser helpers. There was no read / jar job API, no typed RookieRequestError / RookieEngineError split, and no canonical path builders.

import rookie_cookies

cookies = rookie_cookies.chrome()
cookies = rookie_cookies.firefox(["example.com"])
all_cookies = rookie_cookies.load()
jar = rookie_cookies.to_cookiejar(cookies)
path_cookies = rookie_cookies.firefox_based("/path/to/cookies.sqlite")

Wheels were cp38-abi3 until the 0.6 break.

Migrate 0.5.6 → 0.6.0

Area 0.5.6 / early 0.5.x 0.6.0
Recommended entry chrome() / to_cookiejar(...) jar(browser=..., profile=...) or read(...).as_list()
Session cookies Not a first-class profile= Pass profile= to read / jar
CPython 3.8-era / cp38-abi3 ≥ 3.11, cp311-abi3
Path APIs firefox_based, chromium_based, any_browser cookies_from_path / chromium_cookies_from_path (legacy deprecated until ≥ 0.7)
Path request faults Flat RuntimeError RookieRequestError (ValueError subclass)
Header view Manual / to_cookiejar ReadResult.header(url)no module-level header()
Reports Not in 0.5.6 report(...) / browser_report(...), profiles(...)
  1. Bump to CPython 3.11+.
  2. Replace to_cookiejar(chrome()) with jar(browser="chrome", profile="Default").
  3. Keep named helpers only for the frozen compatibility set.
  4. Move explicit DB paths off *_based / any_browser.
  5. Catch RookieRequestError (and optionally RookieEngineError).
  6. Do not invent a top-level header().

See CHANGELOG.md.

Logging

import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)

Disable with logging.CRITICAL.

More

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rookie_cookies-0.6.0b1.tar.gz (496.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rookie_cookies-0.6.0b1-cp311-abi3-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.11+Windows x86-64

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.9 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ s390x

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ppc64le

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (3.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARMv7l

rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

rookie_cookies-0.6.0b1-cp311-abi3-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rookie_cookies-0.6.0b1-cp311-abi3-macosx_10_12_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file rookie_cookies-0.6.0b1.tar.gz.

File metadata

  • Download URL: rookie_cookies-0.6.0b1.tar.gz
  • Upload date:
  • Size: 496.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rookie_cookies-0.6.0b1.tar.gz
Algorithm Hash digest
SHA256 047ad7d0fbe4bbd721e244b6985ad78eb560b78e0f5ee514fb2baec921aa5abd
MD5 bbe3324bb363b8b2f2fc9c2d8c91e2e3
BLAKE2b-256 be8bb97e4b4045a385e99f202c4f2d1a442388c374ce98d87eaad9af8f95a3c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1.tar.gz:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e5a40d731ee2feb21570dd962359cb49ff9f45b6ca1f19f72846446d500536d3
MD5 20fd6103f81e43225682a7426d6480cb
BLAKE2b-256 5db0fea2a9910243146b61f7a18062eadffd875963d5bf199cda102f145c3c4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-win_amd64.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d72f9ada3ef15915675511b31ecec66aa0dfe646ad5c9100f76231281acb296
MD5 9976698f45b0464b907c240d14aee587
BLAKE2b-256 e4ee641edf8ed2e7f77efef5d892515faf256cd2d3d893a1431f86572863ab98

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 05795f11f46fb53862cce8083cce0a6a659d15aedc7eceda11a40e387325f8b5
MD5 31f96aa3a43ffa9296359f45ce016eb5
BLAKE2b-256 ade163b4d806c07887f042089903d68fe56a8c86d9c9763a3c622c23b401632d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 e6c3849fe81f773c44bc51881cc8f4abf2566e791ebe76bd0c1a8bdc2fefa212
MD5 db00f699a2a7da83847efb3e576d6f04
BLAKE2b-256 968f76056d420f126ed3e912dcd77355787d0703c96008dd27efb895fd0a0e1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 aac214e271471bcc3d5d3b1f912c55d82433bdfc91efe1c374bb6d83de8f5647
MD5 56e9d170fa297ec6a6e2b0c649e42928
BLAKE2b-256 90b07595b84935e6a477373b8fc24f06dc0c6acc7a548ae350d0d461b5a53ca2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 a761efcbede9aebd56d32ecbbc29f9709a9f3eb7583f305612aef1d2c2769147
MD5 bf6f1a3896fcca7384ea343b3ee80cd9
BLAKE2b-256 e79e2bed5cedf04fdd0d7289c58b49aaf43adde235848d569f112b650d7c40a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e298af8836a005c8a524897895f3f3f506a35191140bba7be8bb8cc66ce67468
MD5 1cb353ddf3256b08cd70c747b69fa883
BLAKE2b-256 b5d9755cb914ecdeb4a260d17a697947fb26ea8e820129f3ad310543236bd87b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bef74fa4965065272f217e51b56c62ef6229d8162238efa7394f91c658a05bb
MD5 86cf7629561f38ac86a5ddd64e04ad8d
BLAKE2b-256 16874bf37df544096af9b47c521aa7661f72017fef1497e8fa5967cf74bb3d70

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

File details

Details for the file rookie_cookies-0.6.0b1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0b1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a3eea1a763c62e1d4110881973449994496fd5d5a79f5d7394751c0374aecc8
MD5 9a6f29fe417f7e9fda08d7b109477d7e
BLAKE2b-256 dbaa8de7516f7847236f1b7cd0cecabfceb1288d92340a65c4c0c941135e462a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0b1-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-py.yml on teng-lin/rookie-cookies

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

Release history Release notifications | RSS feed

0.6.0

6 files

This release

0.6.0b1 This release

10 files

0.5.9

10 files

0.5.8

10 files

0.5.7

10 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