Skip to main content
Pre-release

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

rookie-cookies

Extract cookies from web browsers Bindings for rookie-cookies

CPython 3.11 or newer is required. Published wheels use the cp311-abi3 stable ABI and are tested on CPython 3.11–3.14.

Usage

from rookie_cookies import chrome
cookies = chrome()
for cookie in cookies:
    print(cookie['domain'], cookie['name'])

Firefox profiles

from rookie_cookies import firefox_profile, firefox_profiles

for profile in firefox_profiles():
    print(profile["name"], profile["path"], profile["is_default"])

cookies = firefox_profile("work", ["example.com"])

Chrome profiles

chrome() keeps its legacy default-first selection. Use the additive APIs to prefer Chrome's advisory active-profile hints while retaining report metadata:

from rookie_cookies import chrome_profile, chrome_profiles

profiles = chrome_profiles()
if profiles:
    report = chrome_profile(profiles[0]["profile"]["profile_id"], ["example.com"])
    print(report["status"])

Missing or malformed hints fall back to the generic order. A selector may also be a display name, directory name, or a full path when descriptor["profile"]["path_lossy"] is false; lossy paths require the profile ID. Ambiguous names raise instead of silently choosing a channel.

Browser registry and reports

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"]))

Reports keep failures visible instead of raising: a registered browser that is not installed is a report with status no_sources, and problems arrive as issues on the report, a profile, or a source. Only a bad request — an unknown browser ID or a profile ID this browser did not yield — raises, as a RuntimeError whose message is a diagnostic rather than a stable contract. load_report() covers every registered browser in one report.

schema_version versions the serialized report shape; reject a value your consumer does not understand. termination describes why execution stopped and is independent from status: its current vocabulary is completed, timed_out, cancelled, and resource_exhausted. For example, a timed-out request can still have status partial and retain sources that completed before the deadline.

An issue counts every occurrence in occurrences but keeps at most MAX_ISSUE_SAMPLES entries in samples; comparing the two tells a truncated excerpt from a complete one.

Every identifier and code (status, termination, engine, role, format, severity, …) is an open snake_case string, so compare against a known value and keep a fallback: a build newer than your code can return one you have not seen.

Explicit paths

Use cookies_from_path() when the file may be Firefox or Chromium. Use the Chromium-specific functions when selecting credentials explicitly:

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"]},
)

Chromium options accept at most one credential selector: browser_id, local_state_path, or plaintext_only=True. Omitting all three selects Automatic credentials. Automatic probes platform credentials on Linux and macOS; on Windows an explicit Chromium path raises RuntimeError with the core missing_local_state_file diagnostic because it does not guess a browser installation. chromium_cookies_from_path_detailed() returns the same cookies with partition/source context.

Compatibility direct-path functions

from rookie_cookies import chromium_based_detailed, firefox_based_detailed

chromium_records = chromium_based_detailed(
    "/path/to/Brave/Default/Network/Cookies",
    ["example.com"],
    browser_id="brave",
)
firefox_records = firefox_based_detailed("/path/to/cookies.sqlite")

Each record contains the familiar cookie dictionary under cookie and a separate context dictionary. Existing functions and cookie dictionaries are unchanged. On Unix, chromium_based() also accepts browser_id as its third argument. Omit it only for plaintext-only databases; encrypted rows fail rather than using an assumed Chrome identity.

any_browser(), chromium_based() and its detailed twin, and flat firefox_based() are deprecated in 0.6 for removal no earlier than 0.7. Their runtime behavior remains unchanged throughout 0.6.x. The detailed Firefox API is not deprecated because there is no generic detailed Mozilla replacement.

Netscape export

from rookie_cookies import chrome, to_netscape

output = to_netscape(chrome())

The serializer prevents extra columns or forged records by encoding tabs, carriage returns, and line feeds in cookie-controlled fields as %09, %0D, and %0A. Every other character is preserved. Its output is byte-identical to the Rust, CLI, and Node serializers for the same cookies.

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.0a3.tar.gz (483.7 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.0a3-cp311-abi3-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.11+Windows x86-64

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

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

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (2.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ s390x

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ppc64le

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (2.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARMv7l

rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

rookie_cookies-0.6.0a3-cp311-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rookie_cookies-0.6.0a3-cp311-abi3-macosx_10_12_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: rookie_cookies-0.6.0a3.tar.gz
  • Upload date:
  • Size: 483.7 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.0a3.tar.gz
Algorithm Hash digest
SHA256 0d1a9b6d5f0d4101f52d7e6dc1a6798a120954028f7563188e1ca850fd993c5d
MD5 93b5931ce3a77d80f2474e57b0317a25
BLAKE2b-256 b3eb1d99d77badd9d9adcc9d1ad77975511f638438d36f29e21aeab8f5da020e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3.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.0a3-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f54c178be6c5ab76bf82977b8df1cfb18249360c7ba24ae4376f8b5090a7e2ec
MD5 d96d6869e064c6b026c7e63f610442b3
BLAKE2b-256 333436e5b976bb381a2ab86748d282f95f5c1e67fb011e06f5891898eba3ed31

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d4047aecdfa4ebee4fb7b6e278a5db6ebd8bb5b872ebd7f154e8e4e2d0a40d2
MD5 498f3e33b14a0e43bed01f2f8b06e8ab
BLAKE2b-256 2e282225e254dbb45e20fcd535cf752ea912fa93148ba9edeceb401bac5572be

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 aa6479cb96618ea8c51219872816d57e4be836d862420f9cd31e0c09c370be58
MD5 f4e085b6107621ae91934aa065ceff16
BLAKE2b-256 bdae2b366415de480a9331c2f088015e974c588e1ec208c0ef4652f9c4ad2902

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 c874d433a904915256ee88b63ee67b243ef511e8069dcfaef3c84553e3e68b07
MD5 991957af5d718a5bf4e14882e844ec30
BLAKE2b-256 3802bb67b2847560757c5f5f2629bd116d47550961e8c3172aef9c902373f3a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d0604f3f4392a8e41fc1e078a63d484379b42e3ea09e6c122a9c9400ad4830d6
MD5 ddb6879c380b0a373e89c5c415701056
BLAKE2b-256 49a0665a532b821194f3aef6daeb98f0b034169c769dd35bab5a375bd268493e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7fc1ee9351e757e204292939b581db473e83eb4ecded97bb455c36e3097bfb2b
MD5 5d552afcdfa6755c0d5f5cdaef1747f2
BLAKE2b-256 3d12731a5062de57e2e069ee4aa6c307586fd6722ad35384a7a504c456037885

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2cc74bdbf3f07b8779eead5875471492de7ff5051f48e4b919f4e93fb7dd40f9
MD5 cc3a3e7192a6271becf182be04579cd6
BLAKE2b-256 c2612f4eef7749dddbbfea32d7ae7fb4680d567a960b7ddc2471afeaf39ccf40

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a0f3e7bb967feb11616b2fe1689ec4efc7bb8cd39b64816bef50fa836f246180
MD5 d02ebaf3d5631058a82e6a525f0ddf5b
BLAKE2b-256 d3c22e31420e7477542829107c2ebf0b9e3ac67c8fa15a23ac192ef3c8733bb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rookie_cookies-0.6.0a3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 752c605564fa945f415fa3a73299122ba2e2c9d8cf5f2ccff65de821bef65d77
MD5 e9632a6edfcdd066055214baa5d39730
BLAKE2b-256 a1802d67ab0ae99f6290b49bbdc9c3c01b205b8e13c6c0484bb78d16dfc37667

See more details on using hashes here.

Provenance

The following attestation bundles were made for rookie_cookies-0.6.0a3-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.0a3 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