Skip to main content

git-dibs-sdk

If you're reading this, you're already in too deep. Yes, I really made a python sdk for the useless utility that is "Git Dibs". It points at https://gitdibs.com by default.

Install

python -m pip install git-dibs-sdk

Quick Start

from git_dibs_sdk import DibsAlreadyCalledError, GitDibsClient

client = GitDibsClient()

dibs = client.get_dibs("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
if dibs is None:
    print("commit is available")
else:
    print(dibs.reserved_by, dibs.upvote_count)

try:
    created = client.call_dibs(
        commit_hash="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        reserved_by="bb",
    )
    print(created.hash)
except DibsAlreadyCalledError as error:
    print(error)

Client Surface

from git_dibs_sdk import GitDibsClient

client = GitDibsClient(
    base_url="https://gitdibs.com",
    timeout=10.0,
)

Available methods:

  • get_dibs(commit_hash: str) -> Dibs | None
  • call_dibs(commit_hash: str, reserved_by: str) -> Dibs
  • list_recent_dibs() -> list[Dibs]
  • list_popular_dibs() -> list[Dibs]
  • search_dibs(*, query: str | None = None, after: str | None = None, limit: int | None = None) -> DibsSearchResult
  • upvote_commit(commit_hash: str, voter_fingerprint: str) -> UpvoteResult

Dibs fields:

  • hash: str Full 40-character lowercase SHA-1 commit hash. Example: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  • reserved_at_utc: str Reservation timestamp in UTC as an ISO 8601 string. Example: "2026-03-28T00:00:00.000Z"
  • reserved_by: str Alphanumeric caller name recorded by the API. Example: "AndyG"
  • upvote_count: int Current number of upvotes for the dibs entry. Example: 7

DibsSearchResult fields:

  • dibs: list[Dibs] Page of dibs results returned by the search endpoint. Example: [Dibs(...), Dibs(...)]
  • query: str | None Hex prefix used to filter results, or None when listing all dibs. Example: "deadbeef"
  • after: str | None Full 40-character cursor hash used to continue pagination, or None on the first page. Example: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  • limit: int Maximum number of results requested for the page. Example: 10
  • has_more: bool Whether another page of results exists after this one. Example: True
  • next_after: str | None Cursor to pass as after for the next page, or None when there are no more results. Example: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"

UpvoteResult fields:

  • applied: bool Whether this request added a new upvote rather than hitting an existing deduplicated vote. Example: True
  • upvote_count: int Current upvote count for the dibs entry after the request. Example: 8

Error Handling

All transport, HTTP, and response-shape failures are raised as GitDibsError subclasses.

  • DibsAlreadyCalledError: the commit is already reserved
  • GitDibsHttpError: a non-success HTTP response came back from the API

Example:

from git_dibs_sdk import DibsAlreadyCalledError, GitDibsError, GitDibsClient

client = GitDibsClient()

try:
    client.call_dibs(
        "cccccccccccccccccccccccccccccccccccccccc",
        "TestUser2",
    )
except DibsAlreadyCalledError as error:
    print(error.commit_hash, error.reserved_by)
except GitDibsError as error:
    print(f"request failed: {error}")

API Notes

This SDK matches the current Git Dibs API contract:

  • GET /api/dibs/<commit>
  • GET /api/dibs/recent
  • GET /api/dibs/popular
  • GET /api/dibs/search?q=<optional-prefix>&after=<optional-full-commit>&limit=<optional-1-to-50>
  • POST /api/dibs
  • POST /api/upvotes

Lookup returns 204 No Content when a commit is available and 200 OK with a dibs payload when it is reserved.

Metadata

Release files for git-dibs-sdk 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-dibs-sdk 1.0.0
File Size Uploaded
git_dibs_sdk-1.0.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-dibs-sdk 1.0.0
File Interpreter ABI Platform
git_dibs_sdk-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / git_dibs_sdk-1.0.0.tar.gz

Download URL git_dibs_sdk-1.0.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7da3c3d0326cb3db5fed2169772057d4ddc8839a45842517ea6c03a0c11281f
BLAKE2b-256 checksum
How to use checksums
f2b4c5e1c53f4757e5c50cab1cf95633311bd45a02e2840c2cd4f3cbc7e4ba34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / git_dibs_sdk-1.0.0-py3-none-any.whl

Download URL git_dibs_sdk-1.0.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0dfc7fb63a492b0780bc0d2a0215a1b7a3ffbbce8fe0a952c627e0fcda7c7a33
BLAKE2b-256 checksum
How to use checksums
053343584e4c1868cb3a8eae402664a74584a2e3b2751ebc861879a9ef875850
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.3

2 release files

0.1.0

2 release files

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