Skip to content

astral-sh/schlepper

schlepper

Actions status Discord

A Python library for deploying static assets to Cloudflare Pages.

Installation

uv add schlepper

Usage

import schlepper

result = schlepper.deploy(
    "./dist",
    project_name="my-site",
    account_id="your-account-id",
    credentials=schlepper.ApiToken(token="your-api-token"),
    branch="production",
    commit_message="Deploy v1.0.0",
)

print(f"Deployed to {result.url} (status: {result.status})")

ApiKey credentials are also supported:

credentials = schlepper.ApiKey(key="your-global-api-key", email="you@example.com")

Development

Linting/formatting/type checking:

uv run ruff check
uv run ruff format --check
uv run ty check

Unit testing:

uv run pytest
# with coverage
uv run coverage run -m pytest

Integration tests (requires Cloudflare credentials):

# see it.env.example
export $(cat it.env | xargs)
uv run pytest -m integration

Build docs:

uv run sphinx-build -b html docs docs/_build/html

Licence

schlepper is licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in schlepper by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.

About

A pure-Python version of `wrangler pages deploy`

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages