VAPython contains is a C++ extension for the Python3 interpreter that provides a (networked) interface to VA.
VAPython is a C++ extension for the Python3 interpreter that provides a (networked) interface to VA.
### License
## License
Copyright 2015-2023 Institute of Technical Acoustics (ITA), RWTH Aachen University
...
...
@@ -19,43 +18,36 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## Requirements
### Requirements
Python 3.7 or higher. The [setuptools](https://setuptools.pypa.io/en/latest/) and the [wheel](https://pypi.org/project/wheel/) package to create or use installer.
### Install
The VA binary packages come with wheel installers for the supported python versions 3.7 - 3.9 which are located in the *python* folder. The files have a similar name to *va-2021b-cp39-cp39-win_amd64.whl*. They can be installed using pip from the respective folder:
`pip install va-2021b-cp39-cp39-win_amd64.whl`
Afterwards you can start a VAServer and try the script in the *example* folder.
### Quick build guide
Before you can build VAPython you have to run CMake with option `ITA_VA_WITH_BINDING_PYTHON` as this among others will prepare the *setup.py* file.
Python 3.8 or higher.
#### Visual Studio
## Install
Running CMake creates a Visual Studio project called `VAPython`. "Building" this target will run a batch script (*setuptools_build_va_python.bat*), that will build the `va` package for Python and create a wheel installer file using setuptools (see below). Note, that this might only work in Release mode. You can modify the batch script, e.g. to specify the python version. Per default it uses the Python launcher *py* to create installers for multiple Python versions.
The VA binary packages come with a wheel installer.
The wheel supports all versions above 3.8.
It can be installed using pip from the respective main folder with:
Remember to adapt the release version (here `2022.0`) in the command above.
Afterwards, you can start a VAServer and try the `va_example_simple.py` script in the *example* folder.
After running CMake you can use Pythons *setuptools* to build the module that is called `va`. Check the respective [Requirements](#requirements). Creating an installer is done using the following two steps:
## Quick build guide
`python setup.py build --force`
VAPython can be built from the [VA](https://git.rwth-aachen.de/ita/VA) base project.
Further build instructions can be found [here](https://git.rwth-aachen.de/ita/ITACoreLibs/-/wikis/home#build-guide).
During configuration, the variable `ITA_VA_WITH_BINDING_PYTHON` must be set to enable the build for VAPython.
Afterwards, the CMake target for VAPython can be built or a wheel generated with the `wheel` target.
`python setup.py bdist_wheel`
## Using
Within Python, the module is called `VAPython`. It is generally recommended to import using the *va* alias:
#### Trouble shooting
```python
importVAPythonasva
```
If you get some errors like `module not found`, this usually refers to missing or incompatible shared libraries that the `va` module is trying to load upon import within the Python interpreter. Make sure the following files are available (i.e. copy them next to the va*.pyc file in the dist/lib/ site-packages folder or into the distribution zip file)