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.0a18-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.0a18-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.0a18-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.0a18-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.4 kB view details)

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

sista-3.0.0a18-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.0a18-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (157.4 kB view details)

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

sista-3.0.0a18-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.0a18-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.0a18-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.0a18-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.0a18-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.0a18-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.0a18-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fb46f9cfc6c45ee17265dd6466d44329006b06482f2f00cabe82a8e5271def24
MD5 b760b867157b162b9f342a849d05e2ba
BLAKE2b-256 705f565b57ab31e87a89d13fcc1f2025cc597882ce05f8e0ebf6e9eb10355bef

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9d27a3b546eec43e59d9a325af9a24ff0621856fb4fe680f3d7ac4b60c00aed
MD5 7ecbade96ffa52b929d075472a23380c
BLAKE2b-256 661e979f0aba857776f91b0e8c0e59c13b25e39ff26521ecd3ecdc4bce075929

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 647d5815a1f81c242ec943496f7149118074c4610dffba0f263bbe462fcb8b11
MD5 1c8e5b8f41b599eb2de7863984bb398e
BLAKE2b-256 75d5e86412ca3a5b93dc17b811d1d703802cea7695868da69a9312e4f6ff6462

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f35a5c4db209f59ee2d30c6343fe0cd56b583cd8df4226f537d971b607ddd62b
MD5 1d6e8d681ad20df608df534abdffff79
BLAKE2b-256 12fa95084db504ce06ea8352bb7f33872525f084c1e1786594b5b6c8557c0879

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 66719780bb6855b80e224e908a82d045f17bcdce82221737d7733db31fdb93e5
MD5 c37535d5c33d825bbd2939d9990dc5c4
BLAKE2b-256 f266836c3c1ef98345227805fd46e81522356930e3c017ed2d71a570e039258d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22b886e15fe6c86af8bbd7ca18a0f6a8cf19877843d96e326cd1d88e824dd0aa
MD5 e7977ca37b2be3610feadff674748d5e
BLAKE2b-256 b9ebe697f3e6a383a39af451e5b796a3838b5f597543f8afe388cdeadc7207a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 981a1f3e9cd625a2b0f28aaa219ad3e69625d35f5792eaad579c8554af8364e0
MD5 02fec855cd0d9f6edebb42d8c73a2015
BLAKE2b-256 f44b1d04bae9860b19769c00c0ba33d6b9f9922dfba86b1bc7d94fda55c730e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9403ab53cf684ceaf573d1d5dab3729ee2d091b24e049776667943eb17d0a48a
MD5 f0d5be13e72f20620b8ee4a1d9258c74
BLAKE2b-256 a435eaf76dcae1f2a1c4a1291575c169244da7dad9be0a4ddb67a4eae79100d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5e8ac89a57cf666b4897ab9d6093b6593f357a88de9c767f8895e4647a6f34b4
MD5 ae814325647b6220ead8f116c89ad986
BLAKE2b-256 fe9f8e2542e3e5dc47475749b96e12ad0b23d5c2f975bb08e1d2fb36e464c1ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b955e4d14e770aa9b2e1516c5f9de1f27b07a8d818ca2a241066e944d5d85e8e
MD5 943fe04f62ac1b057c0072603cc24e79
BLAKE2b-256 8d936abb799a7852fc3c461a0498452eaca5cfa549ac4c4b079a7ac82c0605cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bde36e3b539a54be60fe52c9d872862fb661123e580b793bd0c4507367d4982b
MD5 c6ac29f46fbbe1aea6c4007c7cf24cd6
BLAKE2b-256 42847642857494df3b0c4144e7a1524013250a1ed0930a7d5cf353ea1c47053f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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.0a18-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0a18-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0e468c6f397c8d469cf7dbc8822bd2118ecffbf8897a77de06f7f236a9689cb
MD5 9cae47d787e76b7c405432c1cf5b1d8f
BLAKE2b-256 88738887f95b80b0f485ad701f8a21cf23403e751fa05b894bb0ffb0293e1d65

See more details on using hashes here.

Provenance

The following attestation bundles were made for sista-3.0.0a18-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