Giter Club home page Giter Club logo

nuklear-cffi's Introduction

nuklear-cffi

https://travis-ci.org/nathanrw/nuklear-cffi.svg?branch=master

A semi-automatic Python binding for the nuklear C library.

The core of this is a python program that parses the nuklear.h header for declarations and passes this to the 'cffi' Python binding generator.

Declarations are extracted using a C preprocessor followed by some simple ad hoc text transformations. The 'pcpp' preprocessor is used. This is a C preprocessor written in Python, so the preprocessing step doesn't actually require a C compiler to be installed.

However, the process of generating the Python binding requires a C compiler.

Some code for interfacing nuklear with pygame is provided under pynk.nkpygame.

Usage

See demo.py. The gist of it is to call the nuklear API via the ffi and lib objects imported from pynk - this is provided by the cffi library. Some code for interfacing with pygame is provided.

Installation

The package on pypi should work: https://pypi.python.org/pypi/pynk

Otherwise

python2 setup.py install

in the git repository should do it.

Dependencies

  • cffi, a Python library.
  • pcpp, a C preprocessor written in Python.

As such you will need a C compiler installed if you want to build the library.

Note that at present the pcpp in pypi won't cut it, because in order to preprocess nuklear.h we rely on a fix that has not (as of writing) yet been integrated. You will have to install the one in my github fork.

For the pygame integration code, pygame is necessary, but it's not a requirement for installation or to use the binding.

How to do a release

The following script will increment the version, commit the change and push a tag. The Travis build will then deploy a new version.

python ./bin/version.py (--major|--minor|--patch)

nuklear-cffi's People

Contributors

nathanrw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.