A Python cffi port of libtcod.
Project description
Status
About
This is a Python cffi port of libtcod.
This library is hosted on GitHub.
Any issues you have with this module can be reported at the GitHub issue tracker.
The latest documentation can be found here.
This project was spun off from the python-tdl project, and is now it’s own module.
Installation
The recommended way to install is by using pip.
With Python installed, run the following command to install libtcod-cffi:
python -m pip install libtcod-cffi
This is good enough for most Python installations. See the requirements section if you’re building from source.
Usage
This module was designed to be backwards compatible with the original libtcod module that is distributed with libtcod. If you had code that runs on the original module you can use this library as a drop-in replacement like this:
import tcod as libtcod
Guides and Tutorials for the original library should also work with this one.
Requirements
Python 2.7+, Python 3.3+, or PyPy 5.4+
Windows, Linux, or Mac OS X
Python cffi module must be version 1.8 or higher
Extra requirements when installing directly from source
Python pycparser module must be 2.14 or higher
MinGW gcc.exe must be on Windows path for use with pycparser. An equivalent program must be installed on other OS’s
Mac OS X requires sdl2, which can be installed using the homebrew command: “brew install sdl2”
Linux requires the packages: libsdl2-dev, libffi-dev, and python-dev
License
libtcod-cffi is distributed under the Simplified 2-clause FreeBSD license. Read LICENSE.txt for more details.
Changelog
- 2.0a2
FrozenColor class removed.
Color class now uses a properly set up __repr__ method.
Functions which take the fmt parameter will now escape the ‘%’ symbol before sending the string to a C printf call.
Now using Google-Style docstrings.
Console class has most of its relevant methods.
Added the Console.fill function which needs only 3 numpy arrays instead of the usual 7 to cover all Console data.
- 2.0a1
The userData parameter was added back. Functions which use it are marked depreciated.
Python exceptions will now propagate out of libtcod callbacks.
Some libtcod object oriented functions now have Python class methods associated with them (only BSP for now, more will be added later.)
Regression tests were added. Focusing on backwards compatibilty with libtcodpy. Several neglected functions were fixed during this.
All libtcod allocations are handled by the Python garbage collector. You’ll no longer have to call the delete functions on each object.
Now generates documentation for Read the Docs. You can find the latest documentation for libtcod-cffi here.
- 2.0a0
updated to compile with libtcod-1.6.2 and SDL-2.0.4
- 1.0
sub packages have been removed to follow the libtcodpy API more closely
bsp and pathfinding functions which take a callback no longer have the userdata parameter, if you need to pass data then you should use functools, methods, or enclosing scope rules
numpy buffer alignment issues on some 64-bit OS’s fixed
- 0.3
switched to using pycparser to compile libtcod headers, this may have included many more functions in tcod’s namespace than before
parser custom listener fixed again, likely for good
- 0.2.12
version increment due to how extremely broken the non-Windows builds were (false alarm, this module is just really hard to run integrated tests on)
- 0.2.11
SDL is now bundled correctly in all Python wheels
- 0.2.10
now using GitHub integrations, gaps in platform support have been filled, there should now be wheels for Mac OSX and 64-bit Python on Windows
the building process was simplified from a linking standpoint, most libraries are now statically linked
parser module is broken again
- 0.2.9
Fixed crashes in list and parser modules
- 0.2.8
Fixed off by one error in fov buffer
- 0.2.7
Re-factored some code to reduce compiler warnings
Instructions on how to solve pip/cffi issues added to the readme
Official support for Python 3.5
- 0.2.6
Added requirements.txt to fix a common pip/cffi issue.
Provided SDL headers are now for Windows only.
- 0.2.5
Added /usr/include/SDL to include path
- 0.2.4
Compiler will now use distribution specific SDL header files before falling back on the included header files.
- 0.2.3
better Color performance
parser now works when using a custom listener class
SDL renderer callback now receives a accessible SDL_Surface cdata object.
- 0.2.2
This module can now compile and link properly on Linux
- 0.2.1
console_check_for_keypress and console_wait_for_keypress will work now
console_fill_foreground was fixed
console_init_root can now accept a regular string on Python 3
- 0.2.0
The library is now backwards compatible with the original libtcod.py module. Everything except libtcod’s cfg parser is supported.
- 0.1.0
First version released
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for libtcod_cffi-2.0a2-py3.5-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 785897cd0d2debb83df97dafb5be083bd4b5dcafc31f1e1275039bdc30b224ce |
|
MD5 | f9e99f7e22ad1d1ce53329cd4b70edbc |
|
BLAKE2b-256 | 9a07c3d52d9778ef548dff3d3efbd3f43b9c4346735e88a829a3092a6684f73b |
Hashes for libtcod_cffi-2.0a2-py3.5-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 595e3c41e7495b5c1e260b32758c8c61a66516a01c887d9039bafc248c188b7c |
|
MD5 | 20fb30622aa0251bc0a951277e7fe57a |
|
BLAKE2b-256 | 4ab642b0b723c16010513f4c7e11342cf6ee79341280790c8f7701869883802b |
Hashes for libtcod_cffi-2.0a2-py3.4-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d01d66d59af7878a85605df8e0b082a6763812aac3ce590f22224bc46513369 |
|
MD5 | 3dab187768e3bbd86e5ceddad8088321 |
|
BLAKE2b-256 | c78e7a21622684e6bd95abbea730ebfbed98d467689b341acbc2c1b8d95592e7 |
Hashes for libtcod_cffi-2.0a2-py3.4-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d51001bc2bad68a143c2ca895371b0f41f058a769faaf9e1a822c410da0e01 |
|
MD5 | 25968806993987b0c68dadfcd9af72d9 |
|
BLAKE2b-256 | 4af56130523427ca619cefd56f05cd06e84acf409387180c6ff7215d8c7622fa |
Hashes for libtcod_cffi-2.0a2-py3.3-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b2ae765721db8cd0c271efc28538ff74458b7387efed0a50aadc05c080df4f1 |
|
MD5 | 718948ed8b5e331dd494eeacaeb012a1 |
|
BLAKE2b-256 | 23a572931d3bf94ac307989effdac38a50554886e7b96476ccd63fb8354fe6b0 |
Hashes for libtcod_cffi-2.0a2-py3.3-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86088a6e58ac6faea817416cad8c3cbe4fb72ee34f71b97efaec506cb84e360 |
|
MD5 | 7ed67b6ac7d7859bac14dd1853ca1c1b |
|
BLAKE2b-256 | d1cda022dd1923a479241cf4d19b4a9d21987f6d466d2ec84c7ac634235168a6 |
Hashes for libtcod_cffi-2.0a2-py2.7-win-amd64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5cc58b9c28d8124759b549eb570b36d5a4b0cfaf89195a0c82775ae1b92bb4f |
|
MD5 | d4b4fb93a3d6b5d441f71dc9cbb3727c |
|
BLAKE2b-256 | f1c78be568992d020dc76e87a80540255e29904b1023cda24988c718c9ff16ab |
Hashes for libtcod_cffi-2.0a2-py2.7-win32.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44df49f0d7c0d4efe402ebe12cef4aa11f8b04d3dd6a10977b1ca2be9f749748 |
|
MD5 | 5dd79cd001a266680fb046f19f65707d |
|
BLAKE2b-256 | e777b352cc722e750b0464bf93211b8a7377dce345e3ee50789789dc3573c440 |
Hashes for libtcod_cffi-2.0a2-pp355-pp355-macosx_10_11_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145e32dda4e0d7cc42f2460e3d4891bd695bc79abd3b2b4e5abdcc4e437b631d |
|
MD5 | 390bc8bd3b0c5e816fe7eea38fa6e9a5 |
|
BLAKE2b-256 | fee28477c58d5e063d40580ecc207394fb671c5140828408c0b6035c487ffdbb |
Hashes for libtcod_cffi-2.0a2-pp254-pypy_41-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbb0a1aba5f5eb338a5854bf055e3e05a680301bbeaaf94649b8fe176901d985 |
|
MD5 | b75b11905cfd7ca610d7fdd09c15b859 |
|
BLAKE2b-256 | 9dae8ec1f2af9cba12fa4a33c0a472fd7b35679b2181ab510bd1c51200399a2b |
Hashes for libtcod_cffi-2.0a2-pp254-pypy_41-macosx_10_11_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2981abeed96f2996308158a01e0f22917bf90caf4de0a017b5cd0c85b582d36 |
|
MD5 | c9f5e6df4c2ae632344d70041c54cadb |
|
BLAKE2b-256 | 812c3523197f1f6c271b8c5ce4ce8d2350f19b98c4d3b731a1416ebcd7054544 |
Hashes for libtcod_cffi-2.0a2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09d5f0515c53fcbc2d57305e52157aa5635a2ce393d43d809d5a5f2ba1f3ef89 |
|
MD5 | e938eed9fb6af8f65cac5d61a0c711d5 |
|
BLAKE2b-256 | 1af461befbab626fc069158760896fd4c163f551c8c0f2b6d954d97a2040b09d |
Hashes for libtcod_cffi-2.0a2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6879d86df2b621e2a2b4a3aa3bd38c3130ac0c3d77cf04d927ae092b835219ab |
|
MD5 | 4436b1c3cc9b486e4718525d94feaedd |
|
BLAKE2b-256 | 2636f1cf228645c835e2584449d1261bded4d0ae05fdbba839f3d6375a1b94f0 |
Hashes for libtcod_cffi-2.0a2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c5ee26b13be71fb46444c37b6ec9f35c4a08b0b1b46ab6981f8e04288c40493 |
|
MD5 | c5d3c1b202b39cfac1ac5cbecc51e2f6 |
|
BLAKE2b-256 | 383320d4fb0710b4b633460d2ef12f99e1a55932dbbf717b4ab41c7dd819c42e |
Hashes for libtcod_cffi-2.0a2-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9b3b92e9f44adad102c51e21288bf5e2b92c02accdcde12f0dfdcda7c1e42f |
|
MD5 | 418ad6e746862b341fe0547ad6b1b19e |
|
BLAKE2b-256 | 17080607cb5a58475113910e1a0b4d55eb10cdc9b18c3ad36a61eac69434b41d |
Hashes for libtcod_cffi-2.0a2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5471c399f7a81556677455f006a05bb427a80ff8def7226d769d52906cae0e0 |
|
MD5 | dec8f74b25cd66871cec5c7b106f40e2 |
|
BLAKE2b-256 | 472ff4b34501c03ec4d41901eabe755e3d5f3b67312b4ba40683ea19fde3a8ed |
Hashes for libtcod_cffi-2.0a2-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d05edde6647fc85bd4a7146dbe83f384878996b606afc4ba5ba8707060db05f |
|
MD5 | e91dd48370698e461113230b17b5981a |
|
BLAKE2b-256 | 7c53c92edd0240e969b8639e088c6cbb67c41a81e8e3de65e833000ce37b5ed4 |
Hashes for libtcod_cffi-2.0a2-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27f3e416a6f4ed14ccad6ccc5759530604315d468f89ba7c0bab4d48c3415ffa |
|
MD5 | bcb9dbe13d8aa1ab6a17194d010edf86 |
|
BLAKE2b-256 | 63f68b3207ed22475ab150a514c6115901e3ded8c877d2e590c51af2d277b449 |
Hashes for libtcod_cffi-2.0a2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea0201c0e1049ee8b7d692c02532614cc3709fe8e5f50dd384d47b92586fd79 |
|
MD5 | ba3e4f7fa7e05995c375b1e14db006c8 |
|
BLAKE2b-256 | 76544bd9d1a8eac46ff0a7722463ce997124763b035826d74d8d0847f0d02a9c |
Hashes for libtcod_cffi-2.0a2-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817928c24f9b133c26c54411803b32fcc888e1b8ad2b2646d801577498a1fd00 |
|
MD5 | 8e2dedb7414f8ca08d3b9dda42a4600c |
|
BLAKE2b-256 | 17415b4c71d42e4eb073e62b40525572d7648db18a206fd4f658ff632ab6f97c |
Hashes for libtcod_cffi-2.0a2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00bdec5a85c053d50cad380a2c7a3a53bc7e948378bd6aad6d3b2b47cc70bed2 |
|
MD5 | 01bd32f5fccde0290e82a665b7c965f6 |
|
BLAKE2b-256 | 76769be92dc271bb103babe653ef893807b27ed860c5f3ae8115c3994d7f0719 |
Hashes for libtcod_cffi-2.0a2-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81183f1e099b68f669f6c40c779e617089c1eea65e076142f569dedd695513d0 |
|
MD5 | 9f2e4da870983e41d93e4c2236cf9988 |
|
BLAKE2b-256 | 2dd255a249a2252579a5c7858dc29e1a04e00dd0b9f80b4a1ecaf1296c6e655a |
Hashes for libtcod_cffi-2.0a2-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58276aef6013c491d61bad33e288f0702208f2908fcd2ec55833d19f10e48845 |
|
MD5 | 239855f8d87c737b1b0a9bbd30d66d39 |
|
BLAKE2b-256 | e48f1db797af11df2f5416a3b0a5b3b3952c443707bbed4997ce3dae6a4f08dd |
Hashes for libtcod_cffi-2.0a2-cp33-cp33m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d16f7c2aba58667560d9cb2d7cc4eab76898e7504a12210b8ae8445e43f8a03 |
|
MD5 | d5da2d4245dbb1667421cbf74b32fc37 |
|
BLAKE2b-256 | b3bc940c4653b08766ce3ec65a1e8459d6e855da5350e6b6d87c6d3f3ffaf5d4 |
Hashes for libtcod_cffi-2.0a2-cp33-cp33m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f02a633dd7a0c245505a749f991639db8ce65085af7399876acdc649868bb53 |
|
MD5 | 4dd3b5cf66b541244e8f58c75b047f6b |
|
BLAKE2b-256 | e1a7a07ae801aa7621126a8376aced34de173a6d41eb86eb986a21dad657f802 |
Hashes for libtcod_cffi-2.0a2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f4ed63e6cff66e7574102ea4ed2442faee646e841c82625740f13185c0aa25 |
|
MD5 | 2ca9b1ed107820b93bcfd4e27940b6bd |
|
BLAKE2b-256 | b329f6307ce38b8bb3990ad89cf5ceca41973a1b9fe02439ff5609c57520097c |
Hashes for libtcod_cffi-2.0a2-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e7360866e26e1c0930663130a76314be7e768171a11a7066f853d06b62f1e3 |
|
MD5 | f27db45a55411303e4cc7c1bf3e54ca8 |
|
BLAKE2b-256 | 11a80bdac4f6ea20cd549513abae1d510b0d5d6db43b7874c412aedb8e120159 |
Hashes for libtcod_cffi-2.0a2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 661e9cefd978ea4472a5755c5d5663295cf5ad95f6349fee961525b986be3105 |
|
MD5 | 2416ea609594d9b5a15f2463d635683c |
|
BLAKE2b-256 | ac2ed6d9595ff90aa57201347433db08edba75eb4eaf02627b8462a24a452ef5 |
Hashes for libtcod_cffi-2.0a2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cc557ea82ee05c8d6413b437c6f64a0998ce82d127831d6317919dcdbc596cf |
|
MD5 | f232beec4e80c3f869158c7cfd3c7328 |
|
BLAKE2b-256 | 20cfd1fa927efed970db065d4ce35e631733ee21637330b71cf932cc77a0df95 |
Hashes for libtcod_cffi-2.0a2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d18f68989f72648a73e264eed18880ffb1991fc3c6ae2a72fdc2eb4c1f2d29e |
|
MD5 | 5b5ef3c8cff3de6f00b2dd2fd9e47d8c |
|
BLAKE2b-256 | fbdccc5adc190d144f8620f8d875609cade0b126234d686f82792d0acaef94ac |
Hashes for libtcod_cffi-2.0a2-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a07c2062d00f0b2ff7568468ef5871db714c7d8fc9744817d3ec1acc76502b5 |
|
MD5 | c5cdd137802957f060dad2b73a2a53f5 |
|
BLAKE2b-256 | bc796626a937a6d1e3bc6d515ea4250a3a2b261c73b9920c0eef8002ee3395fb |
Hashes for libtcod_cffi-2.0a2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe456f657fe934d2a5874be7d7919fb470f4645477626b1a9521525d964ef3ea |
|
MD5 | eed561233b7b06e8ae28e91892df2a37 |
|
BLAKE2b-256 | d04fd5d0e1113fb6d60dd3e8dc29d3a454d2c97986a90364aba5835cf15d74fc |