Skip to main content

Sista is a memory-safe and OS-agnostic library for making terminal videogames and animations

Project description

Sista Python C Extension

This directory contains the Python C extension module for the Sista library, which exposes the C API functionality to Python.

Features

  • Full access to Sista C API functions
  • Enum values exposed for foreground colors, background colors, and text attributes
  • Automatic memory management through Python capsules

Building the Extension

Prerequisites

Before building the extension, ensure you have:

  1. Python development headers installed
  2. C++ compiler (g++, clang++, etc.)
  3. The Sista C++ library built and available

Building Process

Option 1: Using setup.py (Recommended)

# Navigate to the project root directory
cd python

# Install required Python packages
pip install setuptools wheel

# Build the extension
python setup.py build_ext --inplace

Installing the Extension

Once built, the extension can be installed in your Python environment:

# Install in development mode
pip install -e .

# Or simply copy the built .so file to your Python site-packages directory

Using the Extension

After successful compilation and installation, you can use the module in Python:

import sista

# Access enum values
print(sista.F_BLACK)    # 30
print(sista.F_RED)      # 31
print(sista.B_WHITE)    # 47
print(sista.A_BRIGHT)     # 1

# Use the API functions
field = sista.create_swappable_field(10, 10)
pawn = sista.create_pawn_in_field(
    field, 'P',
    sista.create_ansi_settings(
        sista.F_RED,
        sista.B_BLACK,
        sista.A_BLINK
    ),
    sista.create_coordinates(0, 0)
)

See the demos in demo/ for more examples.

Testing

You can test the extension with the provided test script:

python demo/test_enums.py

This should output all the enum values that were successfully exposed.

Troubleshooting

Common Issues

  1. Python.h not found: Install Python development headers

    • Ubuntu/Debian: sudo apt-get install python3-dev
    • CentOS/RHEL: sudo yum install python3-devel
    • macOS: brew install python
  2. Library linking errors: Make sure the Sista libraries are built and in your library path

  3. Permission denied: Run with appropriate permissions or use virtual environments

License

This Python extension is licensed under the same license as the Sista project (GNU General Public License v3.0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sista-3.0.0a19-cp314-cp314t-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (158.9 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

sista-3.0.0a19-cp314-cp314-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

sista-3.0.0a19-cp313-cp313-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

sista-3.0.0a19-cp312-cp312-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

sista-3.0.0a19-cp311-cp311-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

sista-3.0.0a19-cp310-cp310-musllinux_1_2_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

sista-3.0.0a19-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file sista-3.0.0a19-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dd8e0831dc6633a3c0c6d5a3eb33699eef27024cb263ba81f564af5d871d2c01
MD5 1a2c6fcf96640db874301602a72883f4
BLAKE2b-256 6ddc8b0e8ee184bd1f5245185281a4e05162ee1fbb48a0c33c876c668bab11e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dbe57a4e2a69b91597e17f205eeefcd92f9e21dfe56dc67f8bcb0bd1476386dc
MD5 0d5c248ec967d2bf84d32282e57a72a4
BLAKE2b-256 d6c5af618750c01649412e2a3bb154f0daa71d065e3a257dc98ed9b0a86f77e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b1aa498ec4037e9aa3936e7843a1837bf6e39e2e3b88653271c13250dcfc83ca
MD5 28829f18ee706173f050dacf2b97d937
BLAKE2b-256 9ed15279e428d2ff0db45177f14ad449f1a3dc66b4f2954de016bf960383f374

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6ecc881b0e11ac67744f28aa0bbe4445a21f22c84060cc33e395b0daeed97809
MD5 d3ab83dc3846700c10ba28863a5ee5e0
BLAKE2b-256 f187c351732b8f0467663114b7227d836de2744f41471a149581758ccebb0a74

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 33b9a69c5f033812ad5f9d9e051051846ab79f5e99d6f9deffef88b3699bcaca
MD5 3f38c94bcdb6b0881dd6fbdc2d275e8a
BLAKE2b-256 cf1057b3864f0841001ef99d1b5215b41ef8da206921cfbbca8122162459ef32

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f63d6c9f097f12753eddd3a405825783b0535b2f57944f39458bad2b9cdf5fb
MD5 f0fc4acbdd4e4b488678401d6b1ff6f9
BLAKE2b-256 b34e3e5c0b936c6e2ed11ed88f3d4ebfd0a50083346ec9b56a53b88aaa06ebee

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1124f37dee6cd38e57325d2977a75e9e1107be75304cc618ff417a946f4caa64
MD5 093a5fe8ae56dce0af644fb747899217
BLAKE2b-256 43aa3df81071225afa9060e351941df682f9147a3382046a67723100421dfc9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 28726750d85b007004e79b0703d10a8bc49147640013628742e47b7ba87f785d
MD5 a9325387ebc4bd673fce906ed6e0fc77
BLAKE2b-256 5af9e70e4668d74569ea70082e1261e9608cb4c7a62b3aa2fd643fe22643cd51

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3c9b99a899313b8359c345f177c145381d64c31f41e8a1ef8a93f898221cddee
MD5 6d4dcf47751c7fb10eea1981b385caca
BLAKE2b-256 1d2ea277ffa264a6203df5f3e5e53c45d70e287c9d8f6501f1e3940057f36cc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e92f5c9120cc8a6f64273df81fb10d9c4098490abf25bc875e14ac51833da941
MD5 f80ef0e358cdccf6156a4f6568d4070a
BLAKE2b-256 6586d85e137b02b001b419f9afcf8fa4660b1b680996bceaa74982655dc1fda1

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2a7b57600ac5f7d6df8420d8b70c1ae09e0cec9662443ca6d7dbaa869748bfb8
MD5 e1f7cc30f2c760d2980cd65345926822
BLAKE2b-256 a64ee2432a9913a45cde1785ada9ff50cd7f9909f1af1ceee6de4bd5586425e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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

File details

Details for the file sista-3.0.0a19-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a19-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9b35ef1f9eb8553446aa71c020a2d2f97e2eec22a81e090042ee59737a80dee3
MD5 87ba32b0ccebb096bfe25158910df54e
BLAKE2b-256 91fe89eaf525d95be1877528181ea9498461499c497d38a3a57c2ebe28e8a32a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a19-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on FLAK-ZOSO/Sista

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