Rugged Science SDK Python Bindings
Project description
Python SDK
This is a wrapper around the Rugged Science SDK with the only difference being that exceptions are automatically thrown. There are no getLastError
or getLastErrorString
functions.
Installing
The package can be installed either by compiling the sources or installing via python -m pip install rssdk
.
Dio Example
from rssdk import RsDio, OutputMode
dio = RsDio()
try:
dio.setXmlFile("ecs9000.xml")
except Exception as e:
print(e)
exit(1)
dio.setOutputMode(1, OutputMode.ModeNpn)
dio.digitalRead(1, 1)
dio.digitalWrite(1, 11, True)
PoE Example
from rssdk import RsPoe, PoeState
poe = RsPoe()
try:
poe.setXmlFile("ecs9000.xml")
except Exception as e:
print(e)
exit(1)
poe.getPortState(3)
poe.setPortState(PoeState.StateDisabled)
Compiling
The Python bindings are built against the standard C++ SDK libraries using pybind11. There are two ways to compile them. Either using Python's build system or by using cmake directly. Both options assume you have have already cloned the repository as shown in the step below.
NOTE: It is best to enable long paths in Windows when compiling using the Python build system.
git clone https://github.com/ruggedscience/SDK
cd SDK
Python Build
Using Python's build system is the recommended way to build the bindings. It will produce a wheel that can be installed using pip
and handles the installation of the required build modules. It will install all of the modules inside an isolated virtual environment that will be deleted after compilation is finished.
-
Install the Python build module.
python -m pip install build
-
Build the source distribution and wheel.
python -m build
-
Install the newly built wheel.
python -m pip install ./dist/<name of wheel file>.whl
Cmake build
The cmake build process isn't quite as straightforward but offers more flexibility. Since multiple dependencies are required it is suggested that you create a virtual environment for the build process to use. Note that the resulting package will be installed into that virtual environment. Information on how to do this can be found in the official Python docs.
-
Install requirements
python -m pip install pybind11 setuptools_scm mypy
Note: mypy is optional and used to generate stub files. This allows IDEs to offer code completion.
-
Create build folder
mkdir build cd build
-
Configure cmake
cmake -DBUILD_PYTHON_BINDINGS=ON -DINSTALL_PYTHON_BINDINGS=ON -DBUILD_SHARED_LIBS=OFF -DINSTALL_XML=OFF -DINSTALL_UTILITIES=OFF -DINSTALL_SDK=OFF ..
Note: On Linux the build type should be set to release using
-DBUILD_TYPE=Release
. -
Build and install
cmake --build . --target install
Note: On Windows the build type should be set to release using
--config Release
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for rssdk-3.19b0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db362d3e97d5a87f688c0cf96f5e4c84c7799ae800ec21cf4999bd6df746c357 |
|
MD5 | 907c3229adb3855fba5d7ef1ca81766d |
|
BLAKE2b-256 | 3be57afe05653f71e9829a1db1ff3cbc6351bcbdae179caba8b1d56d6108ec08 |
Hashes for rssdk-3.19b0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beaaf6a8aa1624ad55c35331dedbbe5edcd168cd5e1ce67f3b53e19c35721e51 |
|
MD5 | 6594e842ddd42c4afad1965c7b1f4b9b |
|
BLAKE2b-256 | 9f7c358db48031ddb6f1bd0e580ba002b416885238865a32d4319a9ce2e7a145 |
Hashes for rssdk-3.19b0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85942c096ca3f5672d27e71b8fcbacd83fa54012451f8b6a21d6c5c08da86690 |
|
MD5 | c68a74840270056ce3f6938504f69aa9 |
|
BLAKE2b-256 | 1aca8d142ad8a7bcbc014af898b35cb1331886e277e9b253cc240eacbea56146 |
Hashes for rssdk-3.19b0-cp312-cp312-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7ad3c7408602c721ee8749873a174eba31161d90aecbbd652d89a504dc9601a |
|
MD5 | a7f4e425af6cc10cf450a461ac1109d5 |
|
BLAKE2b-256 | 9ed775aea610845a6117cba4a48c8377d48db929ce5c7b84970a974104d09ff4 |
Hashes for rssdk-3.19b0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 995e840df523eb6a0481cb78e9bc1f97d0b74943c1ee352a5bc8b7228657de0a |
|
MD5 | c777dd2cc9eb0f563bd58b68f1292647 |
|
BLAKE2b-256 | 1a04ac72e13f9e2d9bceafb89ed13360a3d5f9010dbc378a5466f05d71dd34f6 |
Hashes for rssdk-3.19b0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fae12d62869b4b1bf45ac11d2806a8c3d360e7f484e4f7a705d49261e127aa24 |
|
MD5 | c8833e080f2760d34d8187cafe91052f |
|
BLAKE2b-256 | 2b9c9aecb1c7c3f3b1803318ba877ea1d2d22f364bfbf4cb01bb75de466d6347 |
Hashes for rssdk-3.19b0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8823dc84dae52eb3cd16f0078a27cc84f156056c218407458493dd34d742bd70 |
|
MD5 | ef9ab0ec2c9e1bbff4d8efcc49a39977 |
|
BLAKE2b-256 | 38b32cb74032f0db2a1993efd9ec24aefec6c2ef9cae282ac6744bdb613fc7ea |
Hashes for rssdk-3.19b0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd1f078554148142c6196c48ac9a02850b3268ae53e73a6aaf9f57321777815a |
|
MD5 | 6a370bc57b9c116c64af3a0c56a5cc78 |
|
BLAKE2b-256 | 505912d0a90fa8470e564d83da366676b6be8da2f459e2d22fb3e2dadc769760 |
Hashes for rssdk-3.19b0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28ede021118bf19b50bf8a04d401de4b900a53991221cde10a51f2f2fd8983d6 |
|
MD5 | b0d5f711ef75463e545e8fd09433d566 |
|
BLAKE2b-256 | e73fdbd4cca5f6efed16f862272178449ee6273b150639c2d4eff8d8acf00c51 |
Hashes for rssdk-3.19b0-cp311-cp311-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79bd5429dcfd18a0653b2e58350aace657468630a74185b3e8d71fddf889a81a |
|
MD5 | ac2f548b8a8eed1bf4c0d52fd488d821 |
|
BLAKE2b-256 | fb17ce0b9addd4ea606017f3e7c37da36879285ac30374a9705ed41788879f51 |
Hashes for rssdk-3.19b0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11f4d309ec788b88642980aec9a86cdeeec28f2ceb574fa34a2186d0f79ee99a |
|
MD5 | 5b384a72e1e7486b9c84dc9a9186b165 |
|
BLAKE2b-256 | 82b93c244fc09b0f93718bd4c7069ff1bf6b0f150bb344a32057095696bab6b6 |
Hashes for rssdk-3.19b0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26e8312debc6e6d2036ce78be83e4f181869f2e5f7efcbc260379e7f06020244 |
|
MD5 | e549faabd05804b890bda9e458582a9a |
|
BLAKE2b-256 | c6e0509d988cf50b2c7a098bbfe84b68d4d000d43ead7ef7339ca663967cb4f1 |
Hashes for rssdk-3.19b0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | decd47a9ea609ddea697a652b660fc8704c46051a5486e116a711657d7b72d01 |
|
MD5 | 3da817c848422b38f094ad38591ee58c |
|
BLAKE2b-256 | ba3bb44003e1a8274e7a25514ad3da81b1d0814ed75eabfd8d5d4b562392c646 |
Hashes for rssdk-3.19b0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74d3bec70b04b5e3c34d5b23338c75bd94bdbd8dd569cf4a0c4ca6b607ca8c53 |
|
MD5 | d4166545782c38af784c054d30a48101 |
|
BLAKE2b-256 | 6807f4fba94f278fdfbbf240028176933945a17195ce71a76336d3a816190acd |
Hashes for rssdk-3.19b0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db82b5cb51a6778d333aa3053cfcdb77fe1cc69cbda2af7831c4f1ad19612346 |
|
MD5 | 86fee00d72bf9e4ce6fd7e9b47a7d0a7 |
|
BLAKE2b-256 | 652c031fc5f762abf7e78e5e6c705c735e4fe86c88b7fc20639a4499b7bf8138 |
Hashes for rssdk-3.19b0-cp310-cp310-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54e7396a65bf04dab124230fe17c347dab159d49caa479fb44104fb477ffd1e |
|
MD5 | 07067d966ac5d53ca2bed9bdbd2a1483 |
|
BLAKE2b-256 | f6ee2dd717f212e1a27b4ce931eb94d54635c10b1df5571555e638a3ce82778f |
Hashes for rssdk-3.19b0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92ff43335dc1396b8498e6c6535eb6daeb9183cc829729dc9fb404343562ba19 |
|
MD5 | 8e44aa673449b0bcd0142759ea6495ea |
|
BLAKE2b-256 | a8d56b0b2089b28da05a0b74f0272afe64d3f5691c2147dc70ed57f890e4c351 |
Hashes for rssdk-3.19b0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab599b773307a0cf36bc302e3bf6813948aa582bf8ff60b815283df85fc1f9f5 |
|
MD5 | 21b7d3bdbe569f54da209bba181927be |
|
BLAKE2b-256 | 59c981362f392d949ef06d564e39736b56fdbff7aeb0b53ebc3085c1e90c57e8 |
Hashes for rssdk-3.19b0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd609c0b900073a0c7416df8c916847f148fe5afe458e084ba29453f628580a5 |
|
MD5 | e8a7b360433786f2407f4e5e4b5b2548 |
|
BLAKE2b-256 | 80e5bbf1158bb5c660ab924e63e4f7754eca1cfc6e806aed5d1f755ecf0c3611 |
Hashes for rssdk-3.19b0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 382fe2d9a49e6a9a78a26f9d4a8597b72e1460b454faf95962e1ad51a728cce2 |
|
MD5 | 3d87db558279a6d79299448d90ac7249 |
|
BLAKE2b-256 | 5fada1d0c63dffc1062f17a842420a548c0856bbe732e0ca8ccc1897a5b03581 |
Hashes for rssdk-3.19b0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b997f37e01089fb2ace3b25d87a24f776d0b4ee3fd17c0def80e6703d3e3623b |
|
MD5 | 801b8f5c66090e758d3f1373e5835666 |
|
BLAKE2b-256 | a1ac430649a8d8c4b869ad7f2f4ff0ae60613fcfe3f99628d3a062614ebf545b |
Hashes for rssdk-3.19b0-cp39-cp39-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0711c2d0a48a00daead53f12c324b47e203e706f3943c7ba8dc048982505a884 |
|
MD5 | cfa8cd79067eb0514458d8b278c977aa |
|
BLAKE2b-256 | f64ab4fca43af0309697ea3be3ba1c85f1aeb256815300703e04bc38e74c6f87 |
Hashes for rssdk-3.19b0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd3f28eeda9b73c6ee75f483f65c82539944e58b8ee4265d08a2516510e112e2 |
|
MD5 | 60d96c6fb66d78f4ec7761d3c8f3d77a |
|
BLAKE2b-256 | 5462407dfda111bb0d8ffef0b09bf8b03bb4823c4767f421d2c1786e7b3d63e6 |
Hashes for rssdk-3.19b0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e3f31dc52673f243e170a37b0c6764a622a6001232680f9b2171a1fb82f1f3 |
|
MD5 | a3ca4c5caeff94641c5703a9acc29f0e |
|
BLAKE2b-256 | d67ee3e47fae8ed4e6e10e131b9d765da82f5d0aefebd606155046f1f6916901 |
Hashes for rssdk-3.19b0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c2bc40a14b000a7bf5250f0162a8152b17848b6d67c09c7457442bd1ea93b6 |
|
MD5 | c01f231cc6b40aa9bc10f1b28f7af2e1 |
|
BLAKE2b-256 | 49fc80f35a4d93916c76b84b207c9d37fa90f30812dcbdd820442c74a4e70854 |
Hashes for rssdk-3.19b0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c524c737bfa1fa52919e72d2c14ebec9e273f31bf4b60e945ad7eae66724c3a3 |
|
MD5 | 34212437982a6ad19ef101b6e311ef11 |
|
BLAKE2b-256 | 47ec8a7eed0113988550a163fa109cf741286b372018d2f945464830f43dcd7d |
Hashes for rssdk-3.19b0-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ffed02e86f491f17b8e87d076141c465d9510cd903b19bbf87a2559e77fbab4 |
|
MD5 | ae019ee648bde1c26a99daf0ce632c25 |
|
BLAKE2b-256 | 94756cde688036dcf350ee6dd95f278eb3e682e34441de24269e180a303580cc |
Hashes for rssdk-3.19b0-cp38-cp38-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb230666745c21192370c42e75bb669d49a3264b4b6a4ec3a84a41a057af38f8 |
|
MD5 | 800cdbe090b2c45a22c6e344344c6db2 |
|
BLAKE2b-256 | 0e93e677507e43e9f19ead5097a75bf43351183db01cfe3b163909697f6db90a |
Hashes for rssdk-3.19b0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 927a3df531d5fcccf3a85542ddaffe923c4284e042c796df451eb43ccb49b128 |
|
MD5 | 1fea0a17a7f5c9ea15cd97a61a639223 |
|
BLAKE2b-256 | af45c7ca4809bc024ad2a7ba4a3db6239294a33dc9fb851e20753d944b2bcc25 |
Hashes for rssdk-3.19b0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d3bfa9bc8354aec21c11d786364a403ff5f906e172bb9ef22eff21b94cc249d |
|
MD5 | 58ddbc21a6cdda8a6d1284a2c681b9db |
|
BLAKE2b-256 | 40307d1dd4a100e90bda7a856bdbd645b64a010f5ac59826599a4c21add7731d |
Hashes for rssdk-3.19b0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 908d6a7e65e28fd2064fed2ea55fd41842620e178e949e657ed97702008ec9fd |
|
MD5 | 46615e3926a1ab2ee9940f1ed8e5efa2 |
|
BLAKE2b-256 | 221592bdf0c40d2e44baee60c7b1fec9e22a2691e50ba855f3d5ac2307f2a27f |
Hashes for rssdk-3.19b0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0794010efa266d171d0f6612c6c0c6f7746815470ff61b6b5dd3c2085344b7ea |
|
MD5 | a80e9e87e7832315ef79f90e28d50f33 |
|
BLAKE2b-256 | 03379bcb11b7f7b91f474992d117bcca20b2222c143d143440ee5d4d91198317 |
Hashes for rssdk-3.19b0-cp37-cp37m-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef26bf33b4a2d1e24ae115150a00e7c7ada656045cfc332100ee58f78fd2dd13 |
|
MD5 | 0b812dc9da4a0cb469c15c681a3c612e |
|
BLAKE2b-256 | d376dae6f61a5fa019a853f14c02a3ce573c9c8df0bb771a57670912778f2504 |
Hashes for rssdk-3.19b0-cp37-cp37m-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00576c4a1f78d2a6115b5940b87f844ee23e0d05f7b6f4436b83cdd18bdb9946 |
|
MD5 | fb37c4f8e80c7124aad9a734a937df7c |
|
BLAKE2b-256 | fd5382fa1f9e4019991dc06c3f56cfa60f373634665cb9cd0f014aa52f38f211 |
Hashes for rssdk-3.19b0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6af0227341981149e9f79d2a621d952a8348e1c1f2475c7a1d849986ee8d1db2 |
|
MD5 | c7321f6a62992d127f79676ea4a14c94 |
|
BLAKE2b-256 | 3c0470b65af9452e15968ea79aa8d33808e6b4a3c5bd4e229abf2b51f3a8c651 |
Hashes for rssdk-3.19b0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d5ece28b8470a881b3890af69ec3d84cb25bf36e405778af8bb22ca2f312538 |
|
MD5 | 25a3d39650862da7abf64b2d8ab2f500 |
|
BLAKE2b-256 | 8ef69481d68da2010bd8bc25b3ed249de405132f449846523041701e62329510 |