{"id":17271964,"url":"https://github.com/pndurette/pybatchexecute","last_synced_at":"2025-06-11T21:39:40.807Z","repository":{"id":152479426,"uuid":"350174206","full_name":"pndurette/pybatchexecute","owner":"pndurette","description":"Python package to ease interactions with Google's batchexecute batch RPC system","archived":false,"fork":false,"pushed_at":"2025-03-27T01:51:13.000Z","size":39,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T08:11:18.427Z","etag":null,"topics":["batchexecute","google","rpc"],"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/pndurette.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2021-03-22T01:56:47.000Z","updated_at":"2025-03-27T01:51:16.000Z","dependencies_parsed_at":"2024-07-23T06:47:57.983Z","dependency_job_id":null,"html_url":"https://github.com/pndurette/pybatchexecute","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpybatchexecute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpybatchexecute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpybatchexecute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pndurette%2Fpybatchexecute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pndurette","download_url":"https://codeload.github.com/pndurette/pybatchexecute/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248845572,"owners_count":21170803,"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":["batchexecute","google","rpc"],"created_at":"2024-10-15T08:47:28.229Z","updated_at":"2025-04-14T08:30:18.877Z","avatar_url":"https://github.com/pndurette.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pybatchexecute\n\n\u003e Python package to ease interactions with Google's `batchexecute` batch RPC system. It assists in preparing requests for it and decoding responses returned from it.\n\nThis package codifies the research of Ryan Kovatch[^1] and Boudewijn van Groos[^2] about Google's `/batchexecute` endpoint used accross Google Web applications.\n\n## Usage\n\n### Prepare a request\n\n```python\n\u003e\u003e\u003e from pybatchexecute import PreparedBatchExecute\n\u003e\u003e\u003e\n\u003e\u003e\u003e # RPCs to call\n\u003e\u003e\u003e rpc1 = {\"rpcid\": \"rpc1id\", \"args\": [\"some\", \"args\"]}\n\u003e\u003e\u003e rpc2 = {\"rpcid\": \"rpc2id\", \"args\": [\"some\", \"args\"]}\n\u003e\u003e\u003e\n\u003e\u003e\u003e # Prepare request\n\u003e\u003e\u003e pbe = PreparedBatchExecute(\n...     rpcs=[rpc1, rpc2],\n...     host=\"example.com\",\n...     app=\"example\",\n... )\n\u003e\u003e\u003e\n\u003e\u003e\u003e # Access request attributes\n\u003e\u003e\u003e pbe.url\n'https://example.com/_/example/data/batchexecute'\n\u003e\u003e\u003e pbe.headers\n{'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'}\n\u003e\u003e\u003e pbe.params\n{'rpcids': 'rpc1id,rpc2id', '_reqid': 3807}\n\u003e\u003e\u003e pbe.data\n{'f.req': '[[[\"rpc1id\",\"[\\\\\"some\\\\\",\\\\\"args\\\\\"]\",null,\"1\"],[\"rpc2id\",\"[\\\\\"some\\\\\",\\\\\"args\\\\\"]\",null,\"2\"]]]'}\n```\n\nUse the `url`, `headers`, `params` and `data` attributes (optionally combined with your own, e.g. an `at` parameter[^1] or a `Cookie` header[^1] for authenticated requests) to make a POST request with the HTTP library of your choice (e.g. [`requests`](https://requests.readthedocs.io/en/latest/)).\n\n## Decode a response\n\n```python\n\u003e\u003e\u003e from pybatchexecute import decode\n\u003e\u003e\u003e\n\u003e\u003e\u003e # Raw response\n\u003e\u003e\u003e # (from a request made with no `rt` parameter)\n\u003e\u003e\u003e raw_reponse = r\"\"\"\n... )]}'\n...\n... [[\"wrb.fr\",\"rpc1id\",\"[\\\"some\\\",\\\"response1\\\"]\",null,null,null,1],\n... [\"wrb.fr\",\"rpc2id\",\"[\\\"some\\\",\\\"response2\\\"]\",null,null,null,2],\n... [\"di\",38],\n... [\"af.httprm\",37,\"5314567270682293609\",6],\n... [\"e\",4,null,null,643]]\n... \"\"\"\n\u003e\u003e\u003e\n\u003e\u003e\u003e # Decode response\n\u003e\u003e\u003e # List of tuples (index, rpcid, response)\n\u003e\u003e\u003e decode(raw)\n[(1, 'rpc1id', ['some', 'response1']), (2, 'rpc2id', ['some', 'response2'])]\n```\n\n### Documentation\n\nSee [docs/](docs/) for more:\n\n* [API reference](docs/api.md)\n* [Response formats](docs/response-formats.md)\n\n## Disclaimer\n\nThis project is *not* affiliated with Google. It is intended for use in accordance with [Google's Terms of Service](https://policies.google.com/terms).\n\n## Licence\n\n[The MIT License (MIT)](LICENSE) Copyright © 2023-2024 Pierre Nicolas Durette\n\n[^1]: [Deciphering Google’s mysterious 'batchexecute' system](https://kovatch.medium.com/deciphering-google-batchexecute-74991e4e446c)\n\n[^2]: [November 2020 Google Translate API Changes](https://github.com/Boudewijn26/gTTS-token/blob/master/docs/november-2020-translate-changes.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpndurette%2Fpybatchexecute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpndurette%2Fpybatchexecute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpndurette%2Fpybatchexecute/lists"}