Installation¶
System requirements¶
SnipsKit is a Python 3-only library, requiring Python 3.5 or higher. It’s currently tested on Python 3.5, 3.6 and 3.7.
SnipsKit requires the following Python packages if you want to use the complete functionality:
hermes-python>=0.3.3
paho-mqtt
psutil
toml
If your platform supports these packages, SnipsKit should also be supported.
Install SnipsKit¶
SnipsKit is packaged on PyPI. The latest stable version with all functionality can be installed with the following command:
pip3 install snipskit[hermes,mqtt]
This will also install its dependencies:
hermes-python>=0.3.3
paho-mqtt
psutil
toml
However, in many projects you don’t need the complete functionality. Then you have the following options to prevent pulling in unnecessary dependencies:
The hermes module¶
If you don’t need the snipskit.mqtt
module because you’re using the snipskit.hermes
module, install the SnipsKit library like this:
pip3 install snipskit[hermes]
This will install the complete library and the following dependencies:
hermes-python>=0.3.3
psutil
toml
The mqtt module¶
If you don’t need the snipskit.hermes
module because you’re using the snipskit.mqtt
module, install the SnipsKit library like this:
pip3 install snipskit[mqtt]
This will install the complete library and the following dependencies:
paho-mqtt
psutil
toml
Only the basic modules¶
If you only need the basic modules because you don’t need the snipskit.hermes
and snipskit.mqtt
modules, install the SnipsKit library like this:
pip3 install snipskit
This will install the complete library and the following dependencies:
psutil
toml
Virtual environments¶
It is recommended to use a virtual environment and activate it before installing SnipsKit in order to manage your project dependencies properly. You can create a virtual environment with the name venv in the current directory and activate it like this:
python3 -m venv venv
source venv/bin/activate
After this, you can install SnipsKit in the virtual environment.
Requirements.txt¶
Because the public API of SnipsKit should not be considered stable yet, it’s best to define a specific version (major.minor.patch) in the requirements.txt file of your project, e.g.:
snipskit[hermes]==0.5.3
Then you can install the specified version with:
pip3 install -r requirements.txt
Alternatively, you can define a version like:
snipskit[hermes]~=0.5.0
This will install the latest available SnipsKit version compatible with 0.5.0, but not a higher version such as 0.6.0. Because the minor version is incremented when incompatible API changes are made, this prevents your code from breaking because of breaking changes in the SnipsKit API. Have a look at the Changelog for the versions and their changes.