{"id":13651358,"url":"https://github.com/Mattwmaster58/playwright-python-language-injection","last_synced_at":"2025-04-22T22:31:01.381Z","repository":{"id":160730985,"uuid":"635557035","full_name":"Mattwmaster58/playwright-python-language-injection","owner":"Mattwmaster58","description":"language injection definitions for PyCharm with playwright-python","archived":false,"fork":false,"pushed_at":"2023-05-03T01:13:06.000Z","size":189,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-24T05:37:24.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mattwmaster58.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-05-03T00:29:28.000Z","updated_at":"2024-01-24T05:37:24.201Z","dependencies_parsed_at":"2023-05-14T15:15:18.025Z","dependency_job_id":null,"html_url":"https://github.com/Mattwmaster58/playwright-python-language-injection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattwmaster58%2Fplaywright-python-language-injection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattwmaster58%2Fplaywright-python-language-injection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattwmaster58%2Fplaywright-python-language-injection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mattwmaster58%2Fplaywright-python-language-injection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mattwmaster58","download_url":"https://codeload.github.com/Mattwmaster58/playwright-python-language-injection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223906227,"owners_count":17223045,"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":[],"created_at":"2024-08-02T02:00:48.545Z","updated_at":"2024-11-10T02:30:49.014Z","avatar_url":"https://github.com/Mattwmaster58.png","language":"Python","funding_links":[],"categories":["Utils"],"sub_categories":[],"readme":"## playwright-python-language-injection\n\n### Demo\n\n#### Before\n![picture of IDE before](./screenshots/before.png)\n\n#### After\n![picture of IDE after](./screenshots/after.png)\n\n\n### What is this?\n\nThis repo contains the script to generate [language injection](https://www.jetbrains.com/help/pycharm/using-language-injections.html) definitions for using [playwright-python](https://github.com/microsoft/playwright-python) in PyCharm. From the link:\n\n\u003e Language injections let you work with pieces of code in other languages embedded in your code. When you inject a language (such as HTML, CSS, XML, RegExp, and so on) into a string literal, you get comprehensive code assistance for editing that literal.\n\n## How do I use this?\n\nThe script `generate.py` generates a file `playwright-X.xml` where X is the major component of the installed playwright version. Or, you can just download the [last generated version directly](./playwright-1.xml).\n\nAfter downloading, open up your settings in PyCharm → Editor → Language Injections → Import, and select the file you just downloaded.\n\n![screenshot of settings page](./screenshots/settings.png)\n\n### How does this work?\n\nSince the developers of `playwright-python` were consistent with their style, that made this script a lot easier to write. Every single occurrence of a CSS selector argument in a function uses the name `selector` and every occurrence of a JS expression uses the argument name `expression`. So it's as simple as iterating over the entire API surface, and finding methods that have arguments that match the name and type annotation of `str`. Both async and sync APIs are supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattwmaster58%2Fplaywright-python-language-injection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMattwmaster58%2Fplaywright-python-language-injection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMattwmaster58%2Fplaywright-python-language-injection/lists"}