Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
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.
The package can be installed either by compiling the sources or installing via python -m pip install rssdk
.
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)
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)
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
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
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
.
FAQs
Rugged Science SDK Python Bindings
We found that rssdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.