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=githubGITHUB_TOKEN=<token>REPO_URL=https://github.com/<owner>/<repo>.git(or legacyGITHUB_REPOSITORY_PATH=<owner>/<repo>)
GitLab
REPO_PROVIDER=gitlabGITLAB_TOKEN=<token>REPO_URL=https://gitlab.com/<owner>/<repo>.git
Bitbucket Cloud
REPO_PROVIDER=bitbucketBITBUCKET_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.
Metadata
Release files for blocks-sdk 0.1.104rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| blocks_sdk-0.1.104rc1.tar.gz | 61.9 kB | Details |
Release files / blocks_sdk-0.1.104rc1.tar.gz
| Download URL | blocks_sdk-0.1.104rc1.tar.gz |
|---|---|
| Size | 61.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6e65c237fc512a507898dcfde0a54a862eb0c54da51b111c41a3f7c082abba7
|
|
BLAKE2b-256 checksum How to use checksums |
206acdb0587a8a9475757e7afad69deb42d417bc7f1e36704c8507926d3538f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.11
|