You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ## Dora Node Hub
  2. This hub contains useful pre-built nodes for Dora.
  3. # Structure
  4. The structure of the node hub is as follows (please use the same structure if you need to add a new node):
  5. ```
  6. node-hub/
  7. └── your-node/
  8. ├── main.py
  9. ├── README.mdr
  10. └── pyproject.toml
  11. ```
  12. The idea is to make a `pyproject.toml` file that will install the required dependencies for the node **and** attach main
  13. function of the node inside a callable script in your environment.
  14. To do so, you will need to add a `main` function inside the `main.py` file.
  15. ```python
  16. def main():
  17. pass
  18. ```
  19. And then you will need to adapt the following `pyproject.toml` file:
  20. ```toml
  21. [tool.poetry]
  22. name = "[name of the node e.g. video-encoder, with '-' to replace spaces]"
  23. version = "0.1"
  24. authors = ["[Pseudo/Name] <[email]>"]
  25. description = "Dora Node for []"
  26. readme = "README.md"
  27. packages = [
  28. { include = "main.py", to = "[name of the node with '_' to replace spaces]" }
  29. ]
  30. [tool.poetry.dependencies]
  31. python = "^3.11"
  32. dora-rs = "0.3.5"
  33. ... [add your dependencies here] ...
  34. [tool.poetry.scripts]
  35. [name of the node with '-' to replace spaces] = "[name of the node with '_' to replace spaces].main:main"
  36. [build-system]
  37. requires = ["poetry-core>=1.0.0"]
  38. build-backend = "poetry.core.masonry.api"
  39. ```
  40. Finally, the README.md file should explicit all inputs/outputs of the node and how to configure it in the YAML file.
  41. # Example
  42. ```toml
  43. [tool.poetry]
  44. name = "opencv-plot"
  45. version = "0.1"
  46. authors = [
  47. "Haixuan Xavier Tao <tao.xavier@outlook.com>",
  48. "Enzo Le Van <dev@enzo-le-van.fr>"
  49. ]
  50. description = "Dora Node for plotting data with OpenCV"
  51. readme = "README.md"
  52. packages = [
  53. { include = "main.py", to = "opencv_plot" }
  54. ]
  55. [tool.poetry.dependencies]
  56. python = "^3.11"
  57. dora-rs = "^0.3.5"
  58. opencv-python = "^4.10.0.84"
  59. [tool.poetry.scripts]
  60. opencv-plot = "opencv_plot.main:main"
  61. [build-system]
  62. requires = ["poetry-core>=1.0.0"]
  63. build-backend = "poetry.core.masonry.api"
  64. ```
  65. ## License
  66. This project is licensed under Apache-2.0. Check out [NOTICE.md](../NOTICE.md) for more information.