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.1.tar.gz (8.8 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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: binsolver-1.0.1.tar.gz
  • Upload date:
  • Size: 8.8 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.1.tar.gz
Algorithm Hash digest
SHA256 043106df3c8ae4bb926658f43b368de11ae87f75661b9bfb9e564621983f0a51
MD5 f3963368cc83937db6df6252d4210f1a
BLAKE2b-256 ffd0bba52b5d6108dbcf0ec9d99c7f8325f4bfe2831e5641acfc607d3277dafa

See more details on using hashes here.

Provenance

The following attestation bundles were made for binsolver-1.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: binsolver-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 828bc8aae95fb497f02147240128e564b4b723d767352566cf7645b93f99218e
MD5 4fdd9671f0f587ac8eba5f8db40bfaff
BLAKE2b-256 4963ab81aec891527988c7e463a9dece9965a3dc25712845a7a0612ddce17ff7

See more details on using hashes here.

Provenance

The following attestation bundles were made for binsolver-1.0.1-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