Installation¶
You can simply use pip:
pip install phoneshift
Phoneshift is a “connected module”: First, you have to provide an API token in the environement variables that you obtain through the phoneshift website, ex.:
export PHONESHIFT_API_TOKEN=api_duJhSwq878ii44VkyD0X3AIjG1eBpf0kZM3Zek4YXQHTlZhgGqxrWip7z6p8pyUW
Then, you can run some python code, ex.:
python -c 'import phoneshift; print(phoneshift.__version__)'
License verification¶
When loading the module with import phoneshift
, the API token will be checked through the network and thus validate your usage license.
This validation process starts when the module is loading, in the background, thus minimizing any delay before audio processing.
If the license is not valid, and you run any transformation function, a RuntimeError
exception will be raised.
Note
No matter the validity of your license, you will always be able to import the phoneshift module. This is to avoid that a licensing issue blocks a whole SaaS service that makes use of phoneshift as an option only.
Note
No audio stream will be passed to phoneshift servers. 100% of the processing is done locally on your machine. Network connectivity is only used to validate your usage license and send very light usage statistics that help setting priorities of phoneshift’s development.
Testing¶
To verify that everything is setup properly, you can run the tests provided with the module:
python -c 'import phoneshift.tests; phoneshift.tests.run()'
This runs very simple regression tests and smoke tests.
This command does not run all regressions tests for audio processing, as they are too heavy to be shiped with the python module.