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.106rc0

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.106rc0
File Size Uploaded Provenance Actions
blocks_sdk-0.1.106rc0.tar.gz 59.9 kB Without provenance Details for blocks_sdk-0.1.106rc0.tar.gz

Release files / blocks_sdk-0.1.106rc0.tar.gz

Download URL blocks_sdk-0.1.106rc0.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8de3421dd1ee07465c708071d80899b661d50d3914624961c04a3758a0e5a67b
BLAKE2b-256 checksum
How to use checksums
1d7db39478295c40428221089778a40362eac24a1ddf11371fbde834d6dde79f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for blocks-sdk 0.1.106rc0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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