Skip to main content

Python SDK for the Driftstone API.

Project description

Driftstone - Python

Python SDK for the Driftstone repository API.

Install

pip install driftstone

Quick Start

from driftstone import Driftstone

client = Driftstone(api_key="your-api-key")

repo = client.repos.create(
    "hello-world",
    initial_files={"README.md": "# Example Repo\n"},
)

branch = client.repos.create_branch(
    "hello-world",
    "feature/readme",
    from_ref=repo.default_branch,
)

client.repos.write_file(
    "hello-world",
    "README.md",
    branch=branch.name,
    message="Update README",
    content="# Example Repo\nUpdated content.\n",
)

client.repos.merge(
    "hello-world",
    head=branch.name,
    base=repo.default_branch,
    message="Merge README update",
)

Using A Context Manager

from driftstone import Driftstone

with Driftstone(api_key="your-api-key") as client:
    repo = client.repos.get("hello-world")
    readme = client.repos.read_file(
        repo.name,
        "README.md",
        branch=repo.default_branch,
    )

    print(readme.content)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

driftstone-0.3.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

driftstone-0.3.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file driftstone-0.3.0.tar.gz.

File metadata

  • Download URL: driftstone-0.3.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.6

File hashes

Hashes for driftstone-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2e6299100398eff8d45722e4358d957abc968c07f98bf72a07adce390e185f7f
MD5 897813bff192c6855edb8ad5526a56af
BLAKE2b-256 ffc851950e96c39b6e22ba662f6b5979d58e33071558680c9f80fbf0e1361830

See more details on using hashes here.

File details

Details for the file driftstone-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for driftstone-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac61fce027935c8f32fc6a0e32a5b61257a89127fa8556b4930f7570521bf7ac
MD5 10fe95fafaba40a8a972ea6a06865744
BLAKE2b-256 ab0aab42cd6788d8d98c2ffee607949c40fd8327cba62e897c1c71795bf2d12c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page