Skip to main content

IQ Motion Python API

Python Build codecov tag release

This library is to talk to any IQ Control devices from mulititude of communication protocols.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To Learn more about this API, Read the Communications API Documentation

Prerequisites

Pipenv

Read the second part of this and this for more information on pipenv.

Windows and mac users:

Linux users:

Installing

You can install this library using "pipenv" or "pip":

pipenv install iqmotion

or

pip install iqmotion

If you want to edit this library and/or run some tests, You can clone this repository locally on your computer.

Submodule

If you are using this repository as a submodule, make sure to make a symbolic link:

ln -s python_api/iqmotion iqmotion

If you prefer not to use symbolic links, you could dynamically append the library to your system PATH at runtime by following along with the example below:

├── examples 
│   ├── api_testing.py <---------------(current python script)
│   ├── async_example.py
│   ├── multi_turn_example.py
│   └── propeller_example.py
├── iqmotion   <-----------------------(IQMOTION API LIBRARY)
│   ├── client_entries
│   │   ├── client_entry_data.py
│   │   ├── client_entry.py
│   │   ├── dictionary_client_entry.py
│   │   ├── __init__.py
│   │   └── process_client_entry.py
│   ├── clients

If you wanted to run api_testing.py from the examples Directory, you would need to append the iqmotion library to the system path at the top of my api_testing.py script:

import sys

#  Adds the parent directory to the system path 
# (Same location that the iqmotion library is located)
sys.path.append("../") 

Running the tests

You will need the following packages to run the tests:

  • pytest
  • pytest-cov

They should be already installed with pipenv.

You can then run the software tests with the following command:

pytest ./iqmotion/tests/ --cov-config=.coveragerc --cov=iqmotion --cov-fail-under=100

The test will fail if coverage is under 100%

You can run the hardware tests with the following commands:

python run_hardware_tests.py speed --usb_handle=/dev/ttyUSB0
python run_hardware_tests.py servo --usb_handle=/dev/ttyUSB0
python run_hardware_tests.py step_dir --usb_handle=/dev/ttyUSB0

Clean Code

Formatting

We use black as a formatter. It does everything for you and it should be installed with the dev packages of pipenv.
I recommend setting up your IDE to format with black when saving. Vscode has a known issue sometimes with new .py files where you need to run black in the terminal first You can also run black from the terminal with:

black ./

Linting

We use pylint as a linter. It does everything for you and it should be installed with the dev packages of pipenv.
We have a .pylintrc file that setups your pylint for you.

I would recommend to set up your IDE to use pylint automatically (vscode should find the .pylintrc automatically).

Sometimes pylint shouts at out some errors you do not wantc you can disbale a pylint error locally in a file/method/class with a comment like this:

# pytlint: disable=my-error

You can also run pylint from the terminal with the following command:

pylint your_project_directory

New Releases

It is really easy to create a new release, simply run the following script and follow the prompt:

(You might need to run the following command to use a bash script in windows):

dos2unix ./ci_scripts/new_release.sh
./ci_scripts/new_release.sh

Versioning

We use SemVer for versioning.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Raphael Van Hoffelen
  • Malik B. Parker

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • Matt Piccoli for helping out debugging the architecture and continuously testing the API.

Metadata

Release files for iqmotion 0.30.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iqmotion 0.30.0
File Size Uploaded Provenance
iqmotion-0.30.0.tar.gz 40.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iqmotion 0.30.0
File Interpreter ABI Platform
iqmotion-0.30.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 108.0 kB

Release files / iqmotion-0.30.0.tar.gz

Download URL iqmotion-0.30.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
58d7bebb633e56dc798928ff5c8f6f79846b93c2e8a7255a5bcecd9e87211b0e
BLAKE2b-256 checksum
How to use checksums
b1b495cfeb62b34469ca65aae59f0b7781537376d124f79addfb954a822dba59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.2

Release files / iqmotion-0.30.0-py2.py3-none-any.whl

Download URL iqmotion-0.30.0-py2.py3-none-any.whl
Size 67.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f94958f2505956750fab72e286a4e11ce6d8ba3e7fc875ced5b413532be4527e
BLAKE2b-256 checksum
How to use checksums
5e412edd5a2a8f0bac7df2b267614001789be87d36f451045b9b5c4e52423f43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.2

Security for iqmotion 0.30.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.30.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page