📚 Client library for the ftSwarm Serial API
This library provides a simple interface to the ftSwarm Serial API in a python 3 way.
⚙️ Installation
To install the latest version of the library, run the following command:
pip install ftswarm-py
🚲 Usage
The library provides a simple interface to the ftSwarm Serial API. The following example shows how to connect to the ftSwarm and read a button named "button1" from the ftSwarm.
import asyncio
from swarm import FtSwarm
async def read_button():
swarm = FtSwarm("/dev/ttyUSB0") # Change this to your serial port
button = await swarm.get_button("button1")
print(button.get_state())
asyncio.run(read_button())
Let's just go over the code above. The following steps are performed:
- Creating an async context
- Creating a FtSwarm object with the serial port as parameter
- Getting the button named "button1" from the ftSwarm
- Printing the state of the button
Quite simple, right?
Another simple example can be found at the quickstart section of the documentation.
📝 Documentation
The library is documented using docstrings. You can also find the documentation on my website.
🙆 Contributing
If you want to contribute to the project, feel free to open a pull request. I will review it as soon as possible. Before adding large features, please open an issue first to discuss the feature, so that you don't waste your time.
⚖️ License
This project is licensed under the MIT license. You can find the license in the LICENSE file.
Release files for ftswarm.py 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ftswarm_py-1.2.2.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ftswarm_py-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.2 kB
Release files / ftswarm_py-1.2.2.tar.gz
| Download URL | ftswarm_py-1.2.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7a63eb7765518745d0a81d8c658ecd28da0eba68a7bb959e3c5040edbb92b78
|
|
BLAKE2b-256 checksum How to use checksums |
1a3392cdd4e312cccc9a903f372b2e0039e759842d3484a29ed1f5ec7ff31d68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Windows/11
|
Release files / ftswarm_py-1.2.2-py3-none-any.whl
| Download URL | ftswarm_py-1.2.2-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a044e81fca878f80dad888ef0b6cfbd682c20cb556c2f4f04628b4dfb082ffc
|
|
BLAKE2b-256 checksum How to use checksums |
5af298655693b895e1ae8027dee9da6f7ffb177ec6c6ed44629cef8d7f8806f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Windows/11
|