{"id":13540915,"url":"https://github.com/TimMcCool/scratchattach","last_synced_at":"2025-04-02T08:30:52.658Z","repository":{"id":38185715,"uuid":"482979575","full_name":"TimMcCool/scratchattach","owner":"TimMcCool","description":"Scratch API wrapper with support for almost all site features, cloud requests framework and more","archived":false,"fork":false,"pushed_at":"2024-10-31T22:52:54.000Z","size":5231,"stargazers_count":176,"open_issues_count":8,"forks_count":46,"subscribers_count":20,"default_branch":"main","last_synced_at":"2024-11-01T09:37:53.778Z","etag":null,"topics":["api","bot","bot-framework","bots","cloud","python","scratch"],"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/TimMcCool.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":"2022-04-18T19:58:40.000Z","updated_at":"2024-10-31T22:52:58.000Z","dependencies_parsed_at":"2023-01-28T23:00:42.589Z","dependency_job_id":"da51c745-9bee-4a56-921e-6148b57ff18f","html_url":"https://github.com/TimMcCool/scratchattach","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMcCool%2Fscratchattach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMcCool%2Fscratchattach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMcCool%2Fscratchattach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimMcCool%2Fscratchattach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimMcCool","download_url":"https://codeload.github.com/TimMcCool/scratchattach/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423729,"owners_count":20774820,"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":["api","bot","bot-framework","bots","cloud","python","scratch"],"created_at":"2024-08-01T10:00:35.914Z","updated_at":"2025-04-02T08:30:52.634Z","avatar_url":"https://github.com/TimMcCool.png","language":"Python","readme":"**scratchattach is a Scratch API wrapper with support for almost all site features.** Created by [TimMcCool](https://scratch.mit.edu/users/TimMcCool/).\n\nThe library allows setting cloud variables, following users, updating your profile, and\nso much more! Additionally, it provides frameworks that simplify sending data through cloud variables.\n\n\u003cp align=\"left\" style=\"margin:10px\"\u003e\n  \u003cimg width=\"160\" src=\"https://raw.githubusercontent.com/TimMcCool/scratchattach/refs/heads/main/logos/logo.svg\"\u003e\n\n[![PyPI status](https://img.shields.io/pypi/status/scratchattach.svg)](https://pypi.python.org/pypi/scratchattach/)\n[![PyPI download month](https://img.shields.io/pypi/dm/scratchattach.svg)](https://pypi.python.org/pypi/scratchattach/)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/scratchattach.svg)](https://pypi.python.org/pypi/scratchattach/)\n[![GitHub license](https://badgen.net/github/license/TimMcCool/scratchattach)](https://github.com/TimMcCool/scratchattach/blob/master/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/scratchattach/badge/?version=latest)](https://scratchattach.readthedocs.io/en/latest/?badge=latest)\n\n# Documentation\n\n- **[Documentation](https://github.com/TimMcCool/scratchattach/wiki/Documentation)**\n\n- [Cloud Variables](https://github.com/TimMcCool/scratchattach/wiki/Documentation#cloud-variables)\n- [Cloud Requests](https://github.com/TimMcCool/scratchattach/wiki/Cloud-Requests)\n- [Cloud Storage](https://github.com/TimMcCool/scratchattach/wiki/Cloud-Storage)\n- [Filterbot](https://github.com/TimMcCool/scratchattach/wiki/Filterbot)\n- [Self-hosting a TW cloud websocket](https://github.com/TimMcCool/scratchattach/wiki/Documentation#hosting-a-cloud-server)\n\n# Helpful resources\n\n- [Get your session id](https://github.com/TimMcCool/scratchattach/wiki/Get-your-session-id)\n\n- [Examples](https://github.com/TimMcCool/scratchattach/wiki/Examples)\n- [Hosting](https://github.com/TimMcCool/scratchattach/wiki/Hosting)\n\nReport bugs by opening an issue on this repository. If you need help or guideance, leave a comment in the [official forum topic](https://scratch.mit.edu/discuss/topic/603418/\n). Projects made using scratchattach can be added to [this Scratch studio](https://scratch.mit.edu/studios/31478892/).\n\n# Helpful for contributors\n\n- **[Structure of the library](https://github.com/TimMcCool/scratchattach/wiki/Structure-of-the-library)**\n\n- [Extended documentation (WIP)](https://scratchattach.readthedocs.io/en/latest/)\n\n- [Change log](https://github.com/TimMcCool/scratchattach/blob/main/CHANGELOG.md)\n\nContribute code by opening a pull request on this repository.\n\n# ️Example usage\n\nSet a cloud variable:\n\n```py\nimport scratchattach as sa\n\nsession = sa.login(\"username\", \"password\")\ncloud = session.connect_cloud(\"project_id\")\n\ncloud.set_var(\"variable\", value)\n```\n\n**[More examples](https://github.com/TimMcCool/scratchattach/wiki/Examples)**\n\n# Getting started\n\n**Installation:**\n\nRun the following command in your command prompt / shell:\n\n```\npip install -U scratchattach\n```\n\nIf this doesn't work, try running:\n```\npython -m pip install -U scratchattach\n```\n\n\n**Logging in with username / password:**\n\n```python\nimport scratchattach as sa\n\nsession = sa.login(\"username\", \"password\")\n```\n\n`login()` returns a `Session` object that saves your login and can be used to connect objects like users, projects, clouds etc.\n\n**Logging in with a sessionId:** *You can get your session id from your browser's cookies. [More information](https://github.com/TimMcCool/scratchattach/wiki/Get-your-session-id)*\n```python\nimport scratchattach as sa\n\nsession = sa.login_by_id(\"sessionId\", username=\"username\") #The username field is case sensitive\n```\n\n**Cloud variables:**\n\n```py\ncloud = session.connect_cloud(\"project_id\") # connect to the cloud\n\nvalue = cloud.get_var(\"variable\")\ncloud.set_var(\"variable\", \"value\") # the variable name is specified without the cloud emoji\n```\n\n**Cloud events:**\n\n```py\ncloud = session.connect_cloud('project_id')\nevents = cloud.events()\n\n@events.event\ndef on_set(activity):\n    print(\"variable\", activity.var, \"was set to\", activity.value)\nevents.start()\n```\n\n**Follow users, love their projects and comment:**\n\n```python\nuser = session.connect_user('username')\nuser.follow()\n\nproject = user.projects()[0]\nproject.love()\nproject.post_comment('Great project!')\n```\n\n**All scratchattach features are documented in the [documentation](https://github.com/TimMcCool/scratchattach/wiki/Documentation).**\n","funding_links":[],"categories":["Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimMcCool%2Fscratchattach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTimMcCool%2Fscratchattach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimMcCool%2Fscratchattach/lists"}