Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scratchattach

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scratchattach

A Scratch API Wrapper

  • 2.1.5
  • PyPI
  • Socket score

Maintainers
1

scratchattach is a Scratch API wrapper with support for almost all site features. Created by TimMcCool.

The library allows setting cloud variables, following users, updating your profile, and so much more! Additionally, it provides frameworks that simplify sending data through cloud variables.

PyPI status PyPI download month PyPI version shields.io GitHub license Documentation Status

Documentation

Helpful resources

Report bugs by opening an issue on this repository. If you need help or guideance, leave a comment in the official forum topic. Projects made using scratchattach can be added to this Scratch studio.

Helpful for contributors

Contribute code by opening a pull request on this repository.

️Example usage

Set a cloud variable:

import scratchattach as sa

session = sa.login("username", "password")
cloud = session.connect_cloud("project_id")

cloud.set_var("variable", value)

More examples

Getting started

Installation:

Run the following command in your command prompt / shell:

pip install -U scratchattach

If this doesn't work, try running:

python -m pip install -U scratchattach

Logging in with username / password:

import scratchattach as sa

session = sa.login("username", "password")

login() returns a Session object that saves your login and can be used to connect objects like users, projects, clouds etc.

Logging in with a sessionId: You can get your session id from your browser's cookies. More information

import scratchattach as sa

session = sa.login_by_id("sessionId", username="username") #The username field is case sensitive

Cloud variables:

cloud = session.connect_cloud("project_id") # connect to the cloud

value = cloud.get_var("variable")
cloud.set_var("variable", "value") # the variable name is specified without the cloud emoji

Cloud events:

cloud = session.connect_cloud('project_id')
events = cloud.events()

@events.event
def on_set(activity):
    print("variable", activity.var, "was set to", activity.value)
events.start()

Follow users, love their projects and comment:

user = session.connect_user('username')
user.follow()

project = user.projects()[0]
project.love()
project.post_comment('Great project!')

All scratchattach features are documented in the documentation.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc