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.2.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.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: binsolver-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 c607c189fceb01c663d85539c3dae87d40872f68b34bf4d2fb3cc140383b8426
MD5 c42b6b32f8074064df8a0990b1a2a734
BLAKE2b-256 cfad3781506ccef7915af41161962dd11bb8348c7881ad84f6d9e2e83f8532de

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: binsolver-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db577eb7afe6646ac52999bfb89ee9f65ce4bddf796b4adf5b7f69334c476805
MD5 24a1408d7a5c4d454e185d03dbfae742
BLAKE2b-256 b21e13651023db2525fa997fe80f45198c77a01479a012272d775fd287f3652a

See more details on using hashes here.

Provenance

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