Skip to content

Commit 39dff31

Browse files
docs: add a README and a LICENSE
1 parent 1519442 commit 39dff31

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright © 2024 Christian Bergschneider
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4+
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
5+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6+
persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
9+
Software.
10+
11+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
12+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
13+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
# Client library for the ftSwarm Client API
1+
# 📚 Client library for the ftSwarm Serial API
2+
3+
This library provides a simple interface to the ftSwarm Serial API in a python 3 way.
4+
5+
## ⚙️ Installation
6+
7+
To install the latest version of the library, run the following command:
8+
```bash
9+
pip install ftswarm-py
10+
```
11+
12+
## 🚲 Usage
13+
14+
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.
15+
16+
```python
17+
import asyncio
18+
from swarm import FtSwarm
19+
20+
21+
async def read_button():
22+
swarm = FtSwarm("/dev/ttyUSB0") # Change this to your serial port
23+
button = await swarm.get_button("button1")
24+
25+
print(button.get_state())
26+
27+
asyncio.run(read_button())
28+
```
29+
30+
Let's just go over the code above. The following steps are performed:
31+
- Creating an async context
32+
- Creating a FtSwarm object with the serial port as parameter
33+
- Getting the button named "button1" from the ftSwarm
34+
- Printing the state of the button
35+
36+
Quite simple, right?
37+
38+
Another simple example can be found at the quickstart section of the [documentation](https://bloeckchengrafik.de/ftswarm.py/quickstart/).
39+
40+
## 📝 Documentation
41+
42+
The library is documented using docstrings. You can also find the documentation on [my website](https://bloeckchengrafik.de/ftswarm.py/).
43+
44+
## 🙆 Contributing
45+
46+
If you want to contribute to the project, feel free to open a pull request. I will review it as soon as possible.
47+
Before adding large features, please open an issue first to discuss the feature, so that you don't waste your time.
48+
49+
## ⚖️ License
50+
51+
This project is licensed under the MIT license. You can find the license in the [LICENSE](LICENSE) file.

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[tool.poetry]
22
name = "ftswarm.py"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
description = "A Python library for the ftSwarm Python API"
55
authors = ["bergschneider <[email protected]>"]
66
readme = "README.md"
7+
documentation = "https://bloeckchengrafik.de/ftswarm.py/"
8+
79
license = "MIT"
810
packages = [
911
{ include = "swarm" },

0 commit comments

Comments
 (0)