Skip to main content

Python bindings for Swiss pairing algorithm for (not only) Magic: The Gathering.

Project description

swisspair-python

A python client for https://github.com/karlosss/swisspair.

Requirements

  • pybind11
  • gcc
  • cmake
  • gmp

Installation

Local installation

  • Clone the repository
  • In your project, do pip install <PATH_TO_THE_CLONED_REPOSITORY>

Pip installation

  • pip install swisspair

Docker image

Because pybind11 can be pain on some distributions (looking at you, Ubuntu), there is a docker image based on ArchLinux with python and swisspair module.

TODO publish the image

Usage

The basic interface is as follows:

from swisspair import Player, create_matches

players = [Player(id="P1", points=3, rank=1), Player(id="P2", points=0, rank=2)]

matches = create_matches(players)

print(matches)

For all available parameters, please refer to the interface file.

License

MIT, whatever it means. If you like this project, I would be happy for a star :)

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

swisspair-0.0.9.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file swisspair-0.0.9.tar.gz.

File metadata

  • Download URL: swisspair-0.0.9.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for swisspair-0.0.9.tar.gz
Algorithm Hash digest
SHA256 b49be9bf4ed166079a72a7c536b8c3d78f0a418aea0e597a5c80cc83ae63611f
MD5 b5164c0adde55150c1ca4901b27e20d4
BLAKE2b-256 33d68dc5bac4b8d9aacf5a71d87fad574c1e201173572e502a1af3b215faedcd

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