Skip to main content

A Python library for the ftSwarm Python API

Project description

📚 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftswarm_py-1.2.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ftswarm_py-1.2.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file ftswarm_py-1.2.2.tar.gz.

File metadata

  • Download URL: ftswarm_py-1.2.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11

File hashes

Hashes for ftswarm_py-1.2.2.tar.gz
Algorithm Hash digest
SHA256 c7a63eb7765518745d0a81d8c658ecd28da0eba68a7bb959e3c5040edbb92b78
MD5 993ad49610f62804645cd8aa437a6307
BLAKE2b-256 1a3392cdd4e312cccc9a903f372b2e0039e759842d3484a29ed1f5ec7ff31d68

See more details on using hashes here.

File details

Details for the file ftswarm_py-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: ftswarm_py-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Windows/11

File hashes

Hashes for ftswarm_py-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a044e81fca878f80dad888ef0b6cfbd682c20cb556c2f4f04628b4dfb082ffc
MD5 dc9cc2303db9499457bf81764f8d5491
BLAKE2b-256 5af298655693b895e1ae8027dee9da6f7ffb177ec6c6ed44629cef8d7f8806f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page