Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Blocks SDK

Write custom AI-enabled codebase automations in Python. Leverage a full codebase-aware API. Automatically trigger automations from Github, Slack, and other providers.

We're currently in private alpha, we recommend consistently updating your SDK to the latest version to get the latest features and fixes.

Getting Started

1. Install SDK

pip install blocks-sdk

2. Create a new Blocks project

mkdir -p .blocks/myautomation
cd .blocks/myautomation

3. Create a new automation

# automation.py
from blocks import task, on

@task(name="my_automation")
@on("github.pull_request", repos=["MyOrg/MyRepo"])
def my_automation(event):
    print(event)

5. Upload your automation

blocks init --api-key <your-api-key>
blocks push automation.py

Repository Provider Configuration

Set REPO_PROVIDER when using blocks.repo APIs.

GitHub

  • REPO_PROVIDER=github
  • GITHUB_TOKEN=<token>
  • REPO_URL=https://github.com/<owner>/<repo>.git (or legacy GITHUB_REPOSITORY_PATH=<owner>/<repo>)

GitLab

  • REPO_PROVIDER=gitlab
  • GITLAB_TOKEN=<token>
  • REPO_URL=https://gitlab.com/<owner>/<repo>.git

Bitbucket Cloud

  • REPO_PROVIDER=bitbucket
  • BITBUCKET_TOKEN=<token>
  • REPO_URL=https://bitbucket.org/<workspace>/<repo_slug>.git
  • Optional for git clone auth flows: BITBUCKET_USERNAME=<username>

Bitbucket pull request support includes creating/updating PRs, general and inline comments, replies, approvals, and request-changes reviews.

Release files for blocks-sdk 0.1.107rc0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blocks-sdk 0.1.107rc0
File Size Uploaded
blocks_sdk-0.1.107rc0.tar.gz 69.5 kB Details

Release files / blocks_sdk-0.1.107rc0.tar.gz

Download URL blocks_sdk-0.1.107rc0.tar.gz
Size 69.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0ebbd7b057c03fc526f61e34ebdf58cfea93efe7a93277b7f8d765f4fedc4ee1
BLAKE2b-256 checksum
How to use checksums
913fc13341d5af899fe5b59601c07227398e1cf446735780bf9257d1d65f2a0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.1.107rc0 This release

1 release file

0.1.105

1 release file

0.1.104

1 release file

0.1.103

1 release file

0.1.101

1 release file

0.1.99

1 release file

0.1.98

1 release file

0.1.97

1 release file

0.1.96

1 release file

0.1.95

1 release file

0.1.94

1 release file

0.1.93

1 release file

0.1.92

1 release file

0.1.91

1 release file

0.1.90

1 release file

0.1.89

1 release file

0.1.88

1 release file

0.1.87

1 release file

0.1.84

1 release file

0.1.83

1 release file

0.1.82

1 release file

0.1.81

1 release file

0.1.80

1 release file

0.1.79

1 release file

0.1.78

1 release file

0.1.76

1 release file

0.1.75

1 release file

0.1.74

1 release file

0.1.73

1 release file

0.1.70

1 release file

0.1.69

1 release file

0.1.67

1 release file

0.1.66

1 release file

0.1.65

1 release file

0.1.64

1 release file

0.1.63

1 release file

0.1.61

1 release file

0.1.60

1 release file

0.1.59

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page