Skip to main content

A Python cffi port of libtcod.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Status

VersionsBadge ImplementationBadge LicenseBadge

PyPI Documentation Status Appveyor Travis Coveralls Codacy Scrutinizer

Requirements Status Pyup

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 backward 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.4+, or PyPy 5.4+

  • Windows, Linux, or MacOS.

  • Linux requires the libsdl2 package and must be installed from source.

Extra requirements when installing directly from source

  • MinGW must be on the Windows path for use with pycparser. An equivalent C parser (such as gcc) must be installed on other OS’s.

  • Linux requires the packages: gcc libsdl2-dev libffi-dev python-dev

  • SDL2 is installed automatically on Windows and MacOS

License

libtcod-cffi is distributed under the Simplified 2-clause FreeBSD license. Read LICENSE.txt for more details.

Changelog

2.4.4 - 2017-05-20

Fixed
  • Fixed crashes when exiting on some systems.

2.4.3 - 2017-04-10

Fixed
  • Fixed signatures for MacOS builds.

2.4.2 - 2017-04-10

Removed
  • Dropped support for Python3.3

2.4.1 - 2017-04-07

Fixed
  • Made sure MacOS dependencies are bundled correctly.

2.4.0 - 2017-04-03

Added
  • Renderer regressions fixed, OpenGL and GLSL renderer’s are available again.

Changed
  • The default renderer is now GLSL.

Removed
  • tcod clipboard functions which were never fully implemented removed.

2.3.0 - 2017-03-15

Added
  • Added support for loading/saving REXPaint files.

Fixed
  • Console methods should be safe to use before a root console is initialized.

  • Fixed simplex noise artifacts when using negative coordinates.

  • Fixed backward compatible API inconsistencies with color indexes, console truth values, and line_iter missing the starting point.

  • The SDL callback should always receive an SDL_Surface.

2.2.1 - 2017-03-12

Fixed
  • Fixed Console.print_frame not printing anything.

  • Fixed Noise.sample_ogrid alignment issue.

  • MacOS builds should work even if the system installed SDL2 library is old.

2.2.0 - 2017-02-18

Added
  • You can now sample very large noise arrays using the Noise.sample_mgrid and Noise.sample_ogrid methods.

  • Noise class now supports pickle and copy modules.

2.1.0 - 2017-02-16

Added
  • The root Console instance can now be used as a context manager. Closing the graphical window when the context exits.

  • Ported libtcod functions: sys_clipboard_get and sys_clipboard_set.

2.0.0 - 2017-02-11

Added
  • Random instances can be copied and pickled.

  • Map instances can be copied and pickled.

  • The Map class now has the transparent, walkable, and fov attribues, you can assign to these as if they were numpy arrays.

  • Pathfinders in tcod.path can be given a numpy array as a cost map.

Changed
  • Color instances can now be compared with any standard sequence.

Deprecated
  • You might see a public cdata attribute on some classes, this attribute will be renamed at anytime.

Removed
  • Console.print_str is now Console.print_

  • Some Console methods have been merged together.

  • All litcod-cffi classes have been moved to their own submodules.

  • Random methods renamed to be more like Python’s standard random module.

  • Noise class had multiple methods replaced by an implementation attribute.

  • libtcod-cffi classes and subpackages are not included in the tcod namespace by default.

  • Many redundant methods were removed from the Random class.

  • Map methods set_properies, clear, is_in_fov, is_walkable, and is_transparent were remvoed.

  • Pathfinding classmethod constructors are gone already. Not it’s just one constructor which accepts multiple kinds of maps.

Fixed
  • Python 2 now uses the latin-1 codec when automatically coverting to Unicode.

2.0a4 - 2017-01-09

Added
  • Console instances now have the fg,bg,ch attributes. These attributes are numpy arrays with direct access to libtcod console memory.

Changed
  • Console default variables are now accessed using properties instead of method calls. Same with width and height.

  • Path-finding classes new use special classmethod constructors instead of tradional class instancing.

Removed
  • Color to string conversion reverted to its original repr behaviour.

  • Console.get_char* methods removed in favor of the fg,bg,ch attributes.

  • Console.fill removed. This code was redundant with the new additions.

  • Console.get_default_*/set_default_* methods removed.

  • Console.get_width/height removed.

Fixed
  • Dijkstra.get_path fixed.

2.0a3 - 2017-01-02

  • The numpy module is now required as a dependency.

  • The SDL.h and libtcod_int.h headers are now included in the cffi back-end.

  • Added the AStar and Dijkstra classes with simplified behaviour.

  • Added the BSP class which better represents bsp data attributes.

  • Added the Image class with methods mimicking libtcodpy behaviour.

  • Added the Map class with methods mimicking libtcodpy behaviour.

  • Added the Noise class. This class behaves similar to the tdl Noise class.

  • Added the Random class. This class provides a large variety of methods instead of being state based like in libtcodpy.

  • Color objects can new be converted into a 3 byte string used in libtcod color control operations.

  • heightmap functions can now accept carefully formatted numpy arrays.

  • Removed the keyboard repeat functions: console_set_keyboard_repeat and console_disable_keyboard_repeat.

2.0a2 - 2016-10-30

  • 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 - 2016-10-16

  • 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 - 2016-10-05

  • updated to compile with libtcod-1.6.2 and SDL-2.0.4

1.0 - 2016-09-25

  • 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 - 2016-09-24

  • 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 - 2016-09-16

  • 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 - 2016-09-16

  • SDL is now bundled correctly in all Python wheels

0.2.10 - 2016-09-13

  • 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 - 2016-09-01

  • Fixed crashes in list and parser modules

0.2.8 - 2016-03-11

  • Fixed off by one error in fov buffer

0.2.7 - 2016-01-21

  • 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 - 2015-10-28

  • Added requirements.txt to fix a common pip/cffi issue.

  • Provided SDL headers are now for Windows only.

0.2.5 - 2015-10-28

  • Added /usr/include/SDL to include path

0.2.4 - 2015-10-28

  • Compiler will now use distribution specific SDL header files before falling back on the included header files.

0.2.3 - 2015-07-13

  • 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 - 2015-07-01

  • This module can now compile and link properly on Linux

0.2.1 - 2015-06-29

  • 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 - 2015-06-27

  • The library is now backwards compatible with the original libtcod.py module. Everything except libtcod’s cfg parser is supported.

0.1.0 - 2015-06-22

  • First version released

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

libtcod-cffi-2.4.4.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

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

libtcod_cffi-2.4.4-pp256-pypy_41-win32.whl (684.1 kB view details)

Uploaded PyPyWindows x86

libtcod_cffi-2.4.4-pp254-pypy_41-win32.whl (684.1 kB view details)

Uploaded PyPyWindows x86

libtcod_cffi-2.4.4-cp36-cp36m-win_amd64.whl (904.9 kB view details)

Uploaded CPython 3.6mWindows x86-64

libtcod_cffi-2.4.4-cp36-cp36m-win32.whl (754.3 kB view details)

Uploaded CPython 3.6mWindows x86

libtcod_cffi-2.4.4-cp35-cp35m-win_amd64.whl (904.9 kB view details)

Uploaded CPython 3.5mWindows x86-64

libtcod_cffi-2.4.4-cp35-cp35m-win32.whl (754.3 kB view details)

Uploaded CPython 3.5mWindows x86

libtcod_cffi-2.4.4-cp34-cp34m-win_amd64.whl (904.8 kB view details)

Uploaded CPython 3.4mWindows x86-64

libtcod_cffi-2.4.4-cp34-cp34m-win32.whl (757.7 kB view details)

Uploaded CPython 3.4mWindows x86

libtcod_cffi-2.4.4-cp34-abi3-macosx_10_11_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.4+macOS 10.11+ x86-64

libtcod_cffi-2.4.4-cp34-abi3-macosx_10_6_intel.whl (1.5 MB view details)

Uploaded CPython 3.4+macOS 10.6+ Intel (x86-64, i386)

libtcod_cffi-2.4.4-cp27-cp27m-win_amd64.whl (907.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

libtcod_cffi-2.4.4-cp27-cp27m-win32.whl (751.1 kB view details)

Uploaded CPython 2.7mWindows x86

libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_11_x86_64.whl (1.2 MB view details)

Uploaded CPython 2.7mmacOS 10.11+ x86-64

libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_6_intel.whl (1.5 MB view details)

Uploaded CPython 2.7mmacOS 10.6+ Intel (x86-64, i386)

File details

Details for the file libtcod-cffi-2.4.4.tar.gz.

File metadata

  • Download URL: libtcod-cffi-2.4.4.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for libtcod-cffi-2.4.4.tar.gz
Algorithm Hash digest
SHA256 c85f8538ed53dd148457af2335cdeb2a0a4e63d6a2db478962d09da505ffcb52
MD5 c25151cc5cc455f3bd5eb7e3194e34e3
BLAKE2b-256 e6bc01266db17d4958dfa64e9a26c040c1193ecbbd4aa8675f366bfa883543c9

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-pp256-pypy_41-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-pp256-pypy_41-win32.whl
Algorithm Hash digest
SHA256 7d2cb09b247ed1ff35d950e672f9f8163d2d3be3f583e02c3f2499441bd607e4
MD5 ca7f43829fe5da3c67fe65aaa184adc9
BLAKE2b-256 928d2370fd81b910825e3f27d8462d24db5c26641157c951c1e758cbd6263813

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-pp254-pypy_41-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-pp254-pypy_41-win32.whl
Algorithm Hash digest
SHA256 2070ab5bcb439f22a734c21d54589b3a79bedf990acd2c79d01c45f448650cb9
MD5 ea15aa5defa59388e5eb87007a855810
BLAKE2b-256 d2368217faa1d652687a64065e1b713abb25f1ef9cd65702986daceb279cde28

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 710b7146ce3351cb71a3c8149069d76ef76e2e0cb351e292d566f90bec728818
MD5 c1e6da8eed67e582487d37306b980f8b
BLAKE2b-256 37fd8f42c0d4fd1be6779593b822e501528b7d7591ab9ffa2a168cd62ef2f832

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 7b10f78d0227ac9b9de2ce8abb4ac7a35151bc603e5a4ee3c37cea54e8828d13
MD5 c8b6f9d5a1b30fa9c40a2623dd4530de
BLAKE2b-256 63b1839fe5f6e466526c2a8761a205701d0343b4263cb47bba0fd416e0564b7a

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 547d16a0902a4ed8c121cc0629323e599da99654440ca00c3ecc437bca1d96bd
MD5 871b70c94e8e82267382a8bf639aa93a
BLAKE2b-256 c18172678f07aaf5aef587623cb5c08687f6e3d93703f283647345f1e6c60202

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 3fec8be1c2228b79ac20e5ae8b7d07d5b930af894cc02fdd6f72ae725ca1cc98
MD5 3cedc25fbf188c2855ea2376d454ba3c
BLAKE2b-256 9775d9fb0923b11b82ce94f4b9a87fb8f6bc3cfb152db316b771279c16a7f45a

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 fba835ebaa15f958f0597bb9d294cc160fc3ee8b4efafc52475a9ccc26f60e28
MD5 0f9f0069074bcb58e0062847381934df
BLAKE2b-256 b4be9a5f44c8d7e524674b9917aaf18e2178b3c8f8e0cac39c767e24cf39edcb

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f37fa953e14d1efee1a677e87baf916a6eaf6939850f9d502d0895b30e4f51f4
MD5 9a627e4e3852847995d4731fecf83ac3
BLAKE2b-256 dc8577f9f213d49a83be5de77795ee7689845d3218d62e703df0042c2db2403f

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp34-abi3-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp34-abi3-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 f2750745c6f8cfb5c2e9408a6c8aa54efdca5d8946e10e0c3bf00db0c5dbd8a0
MD5 111b2bc1ee6df532aed15042ce59add8
BLAKE2b-256 1a5ef70f39176c7a856048c63dab0d317738a846ce2a4bb6d4061deeddcd52d3

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp34-abi3-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp34-abi3-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 20abd124d44378cb1e9cbb617d4b16f53bf7cb5d509e02652eb49b01824c1bfd
MD5 a9bb9ae5fb1162ec35e696c20d23b6dd
BLAKE2b-256 cb83172ac5fdd406d9e6a167b5c7e45d96ae9c286ef90d14329a753678066997

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 41a54ba4d509f828648d7b35c8d6e129fa7ef86bb98cdba3ce23a34e0a2c2486
MD5 ddcb645e1a053efd699e48c63cd4b7bf
BLAKE2b-256 488ca705d6005926036cef9368862532cec3f74926e5234e310619fdf79c7e0f

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 6fdaec7a457c88875c7e13b993c9dca69861e8fca73c61d448b33c9e5f3c85bd
MD5 8961e3ca128c0b6fb28bd14c16c95058
BLAKE2b-256 004a2697ee3efa1e62445abf3ba54cac0a2064563bf8a40527ad7385ce6cd45b

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 e056bad24dfec6d233ee632f605d5af556b96051bc1189f70f8385144d4134f7
MD5 9f1f15c18371d74f89a533f2e5346a62
BLAKE2b-256 faa8ca74db5201c9ac3ba852fa9cea5b3c4c8d48f2669ba3eda5956b586958f3

See more details on using hashes here.

File details

Details for the file libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for libtcod_cffi-2.4.4-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 1c5e248884a26730cc616c7bad8705c23a9ccd392e1b6a12cbfb9dd3f535576c
MD5 1664090af1e623218ec816304e56cc70
BLAKE2b-256 4d376e6a087b33a9fd2e7c665209b05eaa618c3d431d7905840e2f377252a389

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