Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dev-cafe/context-api-example
Shows how to implement context-aware APIs in different languages.
https://github.com/dev-cafe/context-api-example
api c cffi cmake context cpp fortran
Last synced: 3 months ago
JSON representation
Shows how to implement context-aware APIs in different languages.
- Host: GitHub
- URL: https://github.com/dev-cafe/context-api-example
- Owner: dev-cafe
- License: mpl-2.0
- Created: 2016-05-04T20:22:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-11T13:43:47.000Z (about 5 years ago)
- Last Synced: 2024-01-29T08:49:52.356Z (about 1 year ago)
- Topics: api, c, cffi, cmake, context, cpp, fortran
- Language: Fortran
- Size: 52.7 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/bast/context-api-example.svg?branch=master)](https://travis-ci.org/bast/context-api-example/builds)
[![License](https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg)](../master/LICENSE)# context-api-example
Shows how to implement and use context-aware APIs in C++, Fortran, and Python.
Inspired by Armin Ronacher's
["Beautiful Native Libraries"](http://lucumr.pocoo.org/2013/8/18/beautiful-native-libraries/).Comments, contributions, and improvements are most welcome!
## How to build and run this demo
### Install Python dependencies
```shell
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
```### Configure and build the compiled code
```shell
$ mkdir build
$ cd build
$ cmake ..
$ make
```### Test the C++/Fortran interfaces
```shell
$ make test
```### Test the Python interface
```shell
$ ACCOUNT_LIBRARY_DIR=$PWD/build/lib ACCOUNT_INCLUDE_DIR=$PWD/account PYTHONPATH=$PWD pytest -vv test/test.py
```