Shows how to implement and use context-aware APIs in C++, Fortran, and Python. Inspired by Armin Ronacher's "Beautiful Native Libraries".
Comments, contributions, and improvements are most welcome!
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir build
cd build
cmake ..
make
cd ..
PROJECT_BUILD_DIR=$PWD/build PROJECT_INCLUDE_DIR=$PWD/api PYTHONPATH=$PWD/api py.test test/test.py
.
|-- api
| |-- example.h (C interface)
| `-- example.py (Python interface)
|-- src
| |-- bank.cpp (C++ library)
| |-- bank.f90 (Fortran library)
| `-- bank.h (C++ library)
`-- test
|-- test.cpp (C++ client)
|-- test.f90 (Fortran client)
`-- test.py (Python client; automatically tested)