Every open source project lives from the generous help by contributors that sacrifice their time and rosrestpy is no different. To make participation as pleasant as possible, this project adheres to the Code of Conduct by contributor-covenant.
-
Fork the rosrestpy repository to your GitHub account.
-
Clone your forked repository of rosrestpy to your computer:
git clone https://github.com/<your username>/rosrestpy cd rosrestpy
-
Add a track to the original repository:
git remote add upstream https://github.com/hexatester/rosrestpy
-
Install dependencies with python-poetry:
pip install poetry poetry install --no-root
Recommended linter (linting) mypy
and code formater black
.
If you already know what you'd like to work on, you can skip this section.
If you have an idea for something to do, first check if it's already been filed on the issue tracker. If so, add a comment to the issue saying you'd like to work on it, and we'll help you get started! Otherwise, please file a new issue and assign yourself to it.
Another great way to start contributing is by writing tests. Tests are really important because they help prevent developers from accidentally breaking existing code, allowing them to build cool things faster.
That being said, we want to mention that we are very hesitant about adding new requirements to our projects. If you intend to do this, please state this in an issue and get a verification from the maintainer.
This including property.
All types must be convertable from and to the REST API with the help of attrs modoule for implementing object protocols and cattrs module for structuring and unstructuring data.
Using attr.dataclass
as decorator for class. If the type is immutable, please enable slots for performance improvement.
Notes on converting data from REST API to python type
.id
property will be changed toid
- All property with
-
will be replaced with_
Notes on converting data from python type to REST API
id
property will ble changed to.id
- All property with
-
will be replaced with_
Base (ros._base
) usage
This class have implementtation for .print and .set methods for implementing specific command that only return single object, such as /ip/cloud
.
from ros._base import BaseProp
class Cloud:
ddns_enabled: bool
# ...
ip_cloud = BaseProp(ros, "/ip/cloud", Cloud)
ip_cloud.print()
This class have implementtation for .add, .delete, .disable, .enable, .print, .remove, .set, and .unset methods for implementing specific command that return multiple objects, such as /queue/simple
.
from ros._base import BaseProps
class QueueSimple:
name: str
# ...
ip_cloud = BaseProps(ros, "/queue/simple", QueueSimple)
ip_cloud.print()
Not yet a priority, but we welcome pull request.