battfeed 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. battfeed/__init__.py +53 -0
  2. battfeed/cli.py +670 -0
  3. battfeed/config.py +415 -0
  4. battfeed/harvester.py +285 -0
  5. battfeed/importer.py +298 -0
  6. battfeed/ingest_state.py +381 -0
  7. battfeed/protocols.py +162 -0
  8. battfeed/registry.py +81 -0
  9. battfeed/sinks/__init__.py +16 -0
  10. battfeed/sinks/bdf_csv.py +270 -0
  11. battfeed/sinks/http_push.py +385 -0
  12. battfeed/sinks/parquet.py +190 -0
  13. battfeed/sinks/routing.py +412 -0
  14. battfeed/sources/__init__.py +22 -0
  15. battfeed/sources/android/__init__.py +10 -0
  16. battfeed/sources/android/adb.py +135 -0
  17. battfeed/sources/android/parser.py +267 -0
  18. battfeed/sources/android/source.py +291 -0
  19. battfeed/sources/csvtail.py +125 -0
  20. battfeed/sources/dji/__init__.py +12 -0
  21. battfeed/sources/dji/gate.py +354 -0
  22. battfeed/sources/dji/parser.py +183 -0
  23. battfeed/sources/dji/source.py +322 -0
  24. battfeed/sources/mc3000/__init__.py +13 -0
  25. battfeed/sources/mc3000/protocol.py +331 -0
  26. battfeed/sources/mc3000/reader.py +71 -0
  27. battfeed/sources/mc3000/source.py +250 -0
  28. battfeed/sources/mc3000/transports/__init__.py +32 -0
  29. battfeed/sources/mc3000/transports/base.py +48 -0
  30. battfeed/sources/mc3000/transports/ble.py +231 -0
  31. battfeed/sources/mc3000/transports/mock.py +181 -0
  32. battfeed/sources/mc3000/transports/usb.py +88 -0
  33. battfeed/sources/simulator.py +82 -0
  34. battfeed/sources/streaming.py +420 -0
  35. battfeed/sources/wmi_battery.py +86 -0
  36. battfeed/testing/__init__.py +22 -0
  37. battfeed/testing/contract.py +221 -0
  38. battfeed/testing/replay.py +322 -0
  39. battfeed-0.5.0.dist-info/METADATA +564 -0
  40. battfeed-0.5.0.dist-info/RECORD +45 -0
  41. battfeed-0.5.0.dist-info/WHEEL +5 -0
  42. battfeed-0.5.0.dist-info/entry_points.txt +10 -0
  43. battfeed-0.5.0.dist-info/licenses/LICENSE +201 -0
  44. battfeed-0.5.0.dist-info/licenses/NOTICE +5 -0
  45. battfeed-0.5.0.dist-info/top_level.txt +1 -0
battfeed/__init__.py ADDED
@@ -0,0 +1,53 @@
1
+ """battfeed turns live battery data sources into BDF (Battery Data Format) feeds.
2
+
3
+ Acquisition layer of the open battery-data stack: implement a
4
+ :class:`DataSource`, point a :class:`Harvester` at it, and get conforming
5
+ ``.bdf.csv`` files out. Normalisation of exported vendor files is the job
6
+ of the ``batterydf`` package (Battery Data Alliance), not of battfeed.
7
+ """
8
+
9
+ from importlib.metadata import PackageNotFoundError, version
10
+
11
+ try:
12
+ __version__ = version("battfeed")
13
+ except PackageNotFoundError: # running from a source tree without installation
14
+ __version__ = "0.5.0"
15
+
16
+ from .config import Config, ConfigError, load_config
17
+ from .harvester import CollectStats, ErrorPolicy, Harvester, SourceFailure
18
+ from .importer import ImportStats, run_import
19
+ from .ingest_state import ImportLedger
20
+ from .protocols import RESERVED_KEYS, DataSource, Sample, SampleValue, Sink
21
+ from .registry import available_sources, create_source
22
+ from .sinks.bdf_csv import BdfCsvSink
23
+ from .sinks.http_push import HttpPushSink
24
+ from .sinks.parquet import ParquetSink
25
+ from .sinks.routing import RoutingSink
26
+ from .sources.streaming import DeadReaderError, StreamingSource
27
+
28
+ __all__ = [
29
+ "DataSource",
30
+ "Sink",
31
+ "Sample",
32
+ "SampleValue",
33
+ "RESERVED_KEYS",
34
+ "Config",
35
+ "ConfigError",
36
+ "load_config",
37
+ "Harvester",
38
+ "CollectStats",
39
+ "ErrorPolicy",
40
+ "SourceFailure",
41
+ "ImportLedger",
42
+ "ImportStats",
43
+ "run_import",
44
+ "StreamingSource",
45
+ "DeadReaderError",
46
+ "BdfCsvSink",
47
+ "RoutingSink",
48
+ "HttpPushSink",
49
+ "ParquetSink",
50
+ "available_sources",
51
+ "create_source",
52
+ "__version__",
53
+ ]