An un-opinionated SiLA 2 library.
Project description
Unitelabs SiLA Python Library
A Python library for creating SiLA 2 clients and servers. This flexible and unopinionated library gives you everything needed to create a SiLA 2 1.1 compliant Python application. It adheres to the SiLA 2 specification and is used by the UniteLabs CDK to enable rapid development of cloud-native SiLA Servers with a code-first approach.
Getting Started
Prerequisites
Ensure you have Python 3.9+ installed. You can install Python from python.org.
Quickstart
To get started quickly with your first connector, we recommend to use our UniteLabs CDK. Use Cookiecutter to create your project base on our Connector Factory starter template:
cookiecutter git@gitlab.com:unitelabs/cdk/connector-factory.git
Installation
Install the latest version of the library into your Python project:
pip install unitelabs-sila
Usage
To start using the SiLA Python library in your project:
-
Import and configure your SiLA server instance:
import asyncio from sila.server import Server from your_project.features import your_feature async def main(): server = Server({"port": 50000}) server.add_feature(your_feature) await server.start() asyncio.run(main())
-
To implement a custom SiLA Feature, create a feature definition following the SiLA2 specification:
from sila.server import Feature, UnobservableCommand your_feature = Feature(...) your_method = UnobservableCommand(...) your_method.add_to_feature(your_feature)
-
Run your server:
$ python your_script.py
Important: Without implementing the required SiLA Service Feature, your SiLA Server will not be fully compliant with the standard. For easier compliance, consider using the UniteLabs CDK, which handles this automatically.
Contribute
Submit and share your work!
https://hub.unitelabs.io
We encourage you to submit feature requests and bug reports through the GitLab issue system. Please include a clear description of the issue or feature you are proposing. If you have further questions, issues, or suggestions for improvement, don't hesitate to reach out to us at developers@unitelabs.io.
Join the conversation! Stay up to date with the latest developments by joining the Python channel in the SiLA Slack.
License
Distributed under the MIT License. See MIT license for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unitelabs_sila-0.7.5.tar.gz.
File metadata
- Download URL: unitelabs_sila-0.7.5.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1082fa8fd48d0a028b45ddc2fc1783d6fbbcf606e5f7ef9fdd72aae702bf8083
|
|
| MD5 |
7ae72c0ec9ec4c42b2de606fb3178889
|
|
| BLAKE2b-256 |
327832c4c494c4f8413b746fc17bcc6cc21621c9325e34c6f2dcc6fb80e61adf
|
File details
Details for the file unitelabs_sila-0.7.5-py3-none-any.whl.
File metadata
- Download URL: unitelabs_sila-0.7.5-py3-none-any.whl
- Upload date:
- Size: 201.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1d1829ccd42bd5b2d7def0378774925a5ed61e754e8ca6aa7b70f0cc86c387b
|
|
| MD5 |
0c621aecfc80d67d634037e8d5d49431
|
|
| BLAKE2b-256 |
fe4e13d14065d66566eab5fd5626e3bd1d4e03051383ddc6ac17d8f2126f0ffb
|