{"id":14997557,"url":"https://github.com/swimmwatch/playwright-localstorage","last_synced_at":"2025-04-09T18:08:35.655Z","repository":{"id":249638196,"uuid":"832077708","full_name":"swimmwatch/playwright-localstorage","owner":"swimmwatch","description":"Extension for the Playwright package that allows access to the Web Storage API.","archived":false,"fork":false,"pushed_at":"2025-03-31T19:19:44.000Z","size":1013,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T20:26:53.608Z","etag":null,"topics":["localstorage","playwright","playwright-python","python","sessionstorage"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swimmwatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-22T10:01:09.000Z","updated_at":"2025-02-03T14:10:10.000Z","dependencies_parsed_at":"2024-09-11T16:48:29.858Z","dependency_job_id":"ba156aa9-9d6c-4d10-aadc-c462f3dae0c1","html_url":"https://github.com/swimmwatch/playwright-localstorage","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"d6c5e05a031b6083727e252721ca2d3620c92010"},"previous_names":["swimmwatch/playwright-localstorage"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swimmwatch%2Fplaywright-localstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swimmwatch%2Fplaywright-localstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swimmwatch%2Fplaywright-localstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swimmwatch%2Fplaywright-localstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swimmwatch","download_url":"https://codeload.github.com/swimmwatch/playwright-localstorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084331,"owners_count":21045124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["localstorage","playwright","playwright-python","python","sessionstorage"],"created_at":"2024-09-24T17:04:18.892Z","updated_at":"2025-04-09T18:08:35.630Z","avatar_url":"https://github.com/swimmwatch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playwright-localstorage\n\n\u003c!-- markdownlint-disable --\u003e\n![playwright-localstorage](https://socialify.git.ci/swimmwatch/playwright-localstorage/image?description=1\u0026font=Raleway\u0026language=1\u0026name=1\u0026owner=1\u0026pattern=Brick%20Wall\u0026theme=Dark)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://pypi.org/project/playwright-localstorage\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/playwright-localstorage.svg\" alt=\"PyPI\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"pyproject.toml\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/pyversions/playwright-localstorage\" alt=\"Supported Python Versions\"\u003e\n    \u003c/a\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/swimmwatch/playwright-localstorage\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/ambv/black\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/code%20style-black-black\" alt=\"Code style\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/pycqa/flake8\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/lint-flake8-black\" alt=\"Linter\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/python/mypy\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/type%20checker-mypy-black\" alt=\"Type checker\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://snyk.io/advisor/python/playwright-localstorage\"\u003e\n        \u003cimg src=\"https://snyk.io/advisor/python/playwright-localstorage/badge.svg\" alt=\"Package health\"\u003e\n    \u003c/a\u003e\n    \u003cbr/\u003e\n    \u003ca href=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/python-check.yml\"\u003e\n        \u003cimg src=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/python-check.yml/badge.svg\" alt=\"Tests\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://codecov.io/github/swimmwatch/playwright-localstorage\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://codecov.io/github/swimmwatch/playwright-localstorage/branch/dev/graph/badge.svg?token=CHNJDD5OY0\" alt=\"Coverage\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/release.yml\"\u003e\n        \u003cimg src=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/release.yml/badge.svg\" alt=\"Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/docs.yml\"\u003e\n        \u003cimg src=\"https://github.com/swimmwatch/playwright-localstorage/actions/workflows/docs.yml/badge.svg\" alt=\"Docs\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\u003c!-- markdownlint-enable --\u003e\n\nExtension for the Playwright package \nthat allows access to the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).\n\n## Installation\n\n```shell\npip install playwright-localstorage\n```\n\n## Usage\n\n### Synchronous\n\n```python\nfrom playwright.sync_api import Playwright\nfrom playwright.sync_api import sync_playwright\n\nfrom playwright_localstorage import LocalStorageAccessor\n\n\ndef run(p: Playwright):\n    chromium = p.chromium\n    browser = chromium.launch(headless=False)\n    \n    page = browser.new_page()\n    page.goto(\"http://example.com\")\n    \n    accessor = LocalStorageAccessor(page)\n    \n    accessor.set(\"token\", \"secret-token\")  # Set value\n    token = accessor.get(\"token\")          # Get value\n    \n    print(token)                           # \u003e\u003e \"secret-token\"\n    \n    exists = accessor.has(\"token\")         # Check key for existence\n    \n    print(exists)                          # \u003e\u003e True\n    \n    keys = accessor.keys()                 # Get all keys\n    \n    print(keys)                            # \u003e\u003e [\"token\"]\n    \n    items = accessor.items()               # Get all items\n    \n    print(items)                           # \u003e\u003e {\"token\": \"secret-token\"}\n    \n    accessor.remove(\"token\")               # Remove key\n    \n    exists = accessor.has(\"token\")\n    \n    print(exists)                          # \u003e\u003e False\n    \n    browser.close()\n\n\nwith sync_playwright() as playwright:\n    run(playwright)\n\n```\n\n### Asynchronous\n\nThe package supports asynchronous implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswimmwatch%2Fplaywright-localstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswimmwatch%2Fplaywright-localstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswimmwatch%2Fplaywright-localstorage/lists"}