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.107rc0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| blocks_sdk-0.1.107rc0.tar.gz | 69.5 kB | Without provenance | Details for blocks_sdk-0.1.107rc0.tar.gz |
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
|
Security for blocks-sdk 0.1.107rc0
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.