Skip to content

Commit a768d05

Browse files
Update README.md
1 parent 2bcead6 commit a768d05

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Provides a simple Python API and CLI, supports running multiple sensors in paral
99

1010
## Installation
1111

12+
From PyPI (recommended):
13+
1214
```bash
13-
pip install -e .
14-
# for development:
15-
pip install -r requirements.txt
15+
pip install dummysensors
1616
```
1717

1818
## Quick Start (API)
@@ -28,6 +28,34 @@ print(temp.read()) # e.g. 21.3
2828
print(vib.read(t_s=0.123)) # sinusoidal signal with noise
2929
```
3030

31+
## Config file
32+
33+
Instead of passing long `--spec` strings, you can define your setup in a YAML file.
34+
By default, `dummy-sensors run --config config.sensors.yaml` will look for a file named `config.sensors.yaml` in the current directory.
35+
36+
### Example `config.sensors.yaml`
37+
38+
```yaml
39+
rate: 2
40+
count: 5
41+
partition_by: type
42+
43+
outputs:
44+
- type: jsonl
45+
for: temp
46+
path: out/temp.jsonl
47+
- type: csv
48+
for: vibration
49+
path: out/vibration.csv
50+
51+
devices:
52+
- id: engine-A
53+
sensors:
54+
- kind: temp
55+
count: 1
56+
- kind: vibration
57+
count: 1
58+
3159
## Quick Start (CLI)
3260

3361
Generate a single temperature stream to JSONL:
@@ -76,7 +104,8 @@ Examples:
76104
- `device=A: temp*3` — device A with three temperature sensors
77105
- `device=eng: temp*1,vibration*2; device=room: temp*2`
78106

79-
> As of `v0.2`, supported sensor types: `temp`, `vibration`. More sensors and YAML configs coming soon.
107+
> As of `v0.2`, supported sensor types: `temp`, `vibration`.
108+
> You can define setups either with `--spec` (quick inline config) or using a YAML file (`--config config.sensors.yaml`) for more complex scenarios.
80109

81110
## Python API
82111

@@ -117,7 +146,7 @@ JSON Lines (one record per line):
117146
}
118147
```
119148

120-
Planned: CSV, Kafka, Redis Stream, WebSocket.
149+
> Planned: CSV, Kafka, Redis Stream, WebSocket.
121150

122151
## Makefile
123152

@@ -140,6 +169,13 @@ head -n 3 demo_out/vibration.jsonl
140169

141170
## Development
142171

172+
```bash
173+
git clone https://github.com/SculptTechProject/dummysensors
174+
cd dummysensors
175+
pip install -e .
176+
pip install -r requirements.txt
177+
```
178+
143179
- Project layout: **src-layout**
144180
- Tests: `pytest -q`
145181
- Lint/format: `ruff check src tests` and `ruff format`
@@ -156,7 +192,7 @@ Pull Requests welcome. Guidelines:
156192

157193
## Roadmap
158194

159-
- `v0.2`
195+
- `v0.2`
160196
- CSV writer
161197
- `partition_by=device`
162198
- YAML config (`--config config.yaml`)

0 commit comments

Comments
 (0)