Skip to main content

Official Python SDK for the BinSolver API

Project description

BinSolver Python SDK

Official Python SDK for the BinSolver API.

Installation

pip install binsolver

Usage

from binsolver import BinSolver, PackRequest, Item, Bin

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

# Check API health
if client.health():
    print("API is healthy")

# Pack items
try:
    response = client.pack(
        PackRequest(
            objective="minBins",
            items=[
                Item(id="item-1", w=5, h=5, d=5, quantity=12)
            ],
            bins=[
                Bin(id="box-small", w=10, h=10, d: 10, quantity=10),
                Bin(id="box-large", w=20, h: 20, d: 20, quantity=5)
            ]
        )
    )

    print(f"Placed {response.stats.placed} items in {response.stats.bins_used} bins.")

    for bin_result in response.bins:
        print(f"Bin {bin_result.bin_id}: {len(bin_result.placements)} items")

except Exception as e:
    print(f"Packing failed: {e}")

Features

  • Fully Typed: Pydantic models for request and response validation.
  • Modern: Uses httpx for efficient HTTP requests.
  • Easy to Use: Pythonic interface for the BinSolver API.

License

MIT

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

binsolver-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

binsolver-1.0.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file binsolver-1.0.0.tar.gz.

File metadata

  • Download URL: binsolver-1.0.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for binsolver-1.0.0.tar.gz
Algorithm Hash digest
SHA256 edde82f230e79a83fad849e4c5c0f41ee3646b2c00a8b18914dc0e9a15f6feb4
MD5 5bb6d023dcfd5c22e0d80a426387e45f
BLAKE2b-256 caeefa5660a18130829a3c1e1eb5a7b3b9a5eb596dee21bcb46113705691953b

See more details on using hashes here.

Provenance

The following attestation bundles were made for binsolver-1.0.0.tar.gz:

Publisher: release.yml on welltyped-systems/binsolver-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file binsolver-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: binsolver-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for binsolver-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 411c78a85536b8972e70c947bf4e9e83fc5fb4575a9ba32fb4dc1e26d73ac065
MD5 d19eba2ca2f8c2127e32cdb186953184
BLAKE2b-256 9e75fe3f5988ff5dc8df7bb411cb4a93a4565ec5f05a7c53e9d0113a2531912e

See more details on using hashes here.

Provenance

The following attestation bundles were made for binsolver-1.0.0-py3-none-any.whl:

Publisher: release.yml on welltyped-systems/binsolver-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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