Skip to main content

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

Reason this release was yanked:

Semantic versioning broken

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

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

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

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

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

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

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

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

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

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

sista-3.0.0-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.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (152.6 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.0-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sista-3.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f8c38a8b791b1a44ea70a02fe5f8e568d365c3d68f60c4a9e66d7d3aa851efd4
MD5 2f1076c3f467f94e1b99218060d467bf
BLAKE2b-256 64e8d4a677bfcf578d1f2f423cdc4c2852d2ae9712c0e53c54f195c103acaba3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91ef15095f4d0e3e54ea7ffd0a6a833f1cbc9343803f40f1af4b0b5a33078fd5
MD5 89cff97ad8fad499c38960c8fd30c60c
BLAKE2b-256 5f0c471e7397c8c0e7662a208ce71d6aa72ab4220422daf725b53d63f19f8f7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 07e9a7052829987b30834625b9087a8a5bd0f5a3d4bed5307a44d9152671ece9
MD5 cd9da06367be4b52bb0384d3cac1a9db
BLAKE2b-256 805598545366cf2b50440788c47142311ab95b9b36a6548a8f8a21846b7c2755

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6ba87f9a1f4932ba7500b409b17300ebba8cd3db66b4676cf9e825ec8251cf33
MD5 63f39fc48b3902e581e92401b834974b
BLAKE2b-256 be41641c9823fccd4148466314deb3baeefb61fcb4d23f95a4624849ff568798

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e91fda9ababa90f123ea5393dab333cf7234dfea5624f20dbb3929b69dabbae3
MD5 23a9fcaa09d10f40164bf4cbcc82123c
BLAKE2b-256 3b49b40f8d8e95ac1eaf7a42a8262592a2716c8c080afd1f4986daa37d3fd96c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f2027cbaf8c062753d8289e2199879f06c8de869ce652775fa6dfdfea29d613b
MD5 1236333b39c6d66dd897235c06b76308
BLAKE2b-256 a3369bd1d38494c0afa650d48ade0d2f9e9eedda6166ba7cbc25b90c83c73919

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b19c9e43da31b1d0344ac8c158d13f9fcbf29eb20cc6b05118f6982c6fc92a2b
MD5 e254a9dd8b26900be9bd5a96e94aaca6
BLAKE2b-256 ea69db1332e5d5ee6ddf21fcaa2fae0c750df4fe465aefe056bf4fc555673863

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 33efce7e42330b120e332f220ac93863a5cf571627f1a1d4501d5925c4d60167
MD5 d2e995b94f5816fb2a2aac4c17a64291
BLAKE2b-256 29e62cd3be3403618961e899276959e6d4d8c30184375ce35aa56ae5f2355431

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9b4336c7ab1c43ebef0ed6b975e0aa4936d971d78933139232ddbee08f04dbad
MD5 67afd18bf1d0309333a238bc1bc47dec
BLAKE2b-256 9b787755d1868bc1ec343f45e697d426e9dc5970716f632946bf5e93f5b75be9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dc62e1d986e34a29d976a14ce68e6ad41cb67f1a489862e9f3ac34162da8f313
MD5 e73b13caeed14067f03605a36ea8b8ae
BLAKE2b-256 c90f8928a929e4dfbbc1ca0827608af0ef8e6f382623dbab4d12d680c84ea880

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ddca48a4377b8ee53af77b2d7334d79d12ca0662de77ab7b6327b5ab353f9198
MD5 8e78d0fd7f63c4a9a95eeee1df352eaf
BLAKE2b-256 a2e691aad49fd2b27a517bee95f796ccf2b734ee64bec3ca3a39140878945e29

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for sista-3.0.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 505edf41f1c128f1cb87b50b4d67ff0e08428a2b9bcf876371e65602c73981c4
MD5 a89ccd9318b598380d102bc47fa0c090
BLAKE2b-256 238c0305dd839421b34f706987a2e49a6c8ce07d7da95c56b88073e7a69d5799

See more details on using hashes here.

Provenance

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