fleetpull 0.1.0__tar.gz

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 (262) hide show
  1. fleetpull-0.1.0/LICENSE +202 -0
  2. fleetpull-0.1.0/PKG-INFO +248 -0
  3. fleetpull-0.1.0/README.md +210 -0
  4. fleetpull-0.1.0/pyproject.toml +323 -0
  5. fleetpull-0.1.0/setup.cfg +4 -0
  6. fleetpull-0.1.0/src/fleetpull/__init__.py +36 -0
  7. fleetpull-0.1.0/src/fleetpull/api/__init__.py +32 -0
  8. fleetpull-0.1.0/src/fleetpull/api/auth_ingress.py +216 -0
  9. fleetpull-0.1.0/src/fleetpull/api/catalog.py +139 -0
  10. fleetpull-0.1.0/src/fleetpull/api/fetch.py +229 -0
  11. fleetpull-0.1.0/src/fleetpull/api/identity.py +90 -0
  12. fleetpull-0.1.0/src/fleetpull/api/sync.py +735 -0
  13. fleetpull-0.1.0/src/fleetpull/cli.py +146 -0
  14. fleetpull-0.1.0/src/fleetpull/config/__init__.py +47 -0
  15. fleetpull-0.1.0/src/fleetpull/config/base.py +18 -0
  16. fleetpull-0.1.0/src/fleetpull/config/example.py +90 -0
  17. fleetpull-0.1.0/src/fleetpull/config/geotab.py +78 -0
  18. fleetpull-0.1.0/src/fleetpull/config/http.py +32 -0
  19. fleetpull-0.1.0/src/fleetpull/config/loading.py +195 -0
  20. fleetpull-0.1.0/src/fleetpull/config/logger.py +139 -0
  21. fleetpull-0.1.0/src/fleetpull/config/providers.py +520 -0
  22. fleetpull-0.1.0/src/fleetpull/config/rate_limit.py +50 -0
  23. fleetpull-0.1.0/src/fleetpull/config/resolution.py +156 -0
  24. fleetpull-0.1.0/src/fleetpull/config/retry.py +69 -0
  25. fleetpull-0.1.0/src/fleetpull/config/root.py +157 -0
  26. fleetpull-0.1.0/src/fleetpull/config/sections.py +146 -0
  27. fleetpull-0.1.0/src/fleetpull/endpoints/__init__.py +24 -0
  28. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/__init__.py +12 -0
  29. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/_requests.py +427 -0
  30. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/annotation_logs.py +73 -0
  31. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/audits.py +70 -0
  32. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/devices.py +79 -0
  33. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/driver_changes.py +73 -0
  34. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/duty_status_logs.py +75 -0
  35. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/dvir_logs.py +76 -0
  36. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/exception_events.py +119 -0
  37. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/fault_data.py +72 -0
  38. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/fill_ups.py +79 -0
  39. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/fuel_and_energy_used.py +74 -0
  40. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/fuel_tax_details.py +75 -0
  41. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/log_records.py +74 -0
  42. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/media_files.py +74 -0
  43. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/shipment_logs.py +71 -0
  44. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/status_data.py +71 -0
  45. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/text_messages.py +77 -0
  46. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/trips.py +102 -0
  47. fleetpull-0.1.0/src/fleetpull/endpoints/geotab/users.py +81 -0
  48. fleetpull-0.1.0/src/fleetpull/endpoints/motive/__init__.py +12 -0
  49. fleetpull-0.1.0/src/fleetpull/endpoints/motive/_spec_builders.py +94 -0
  50. fleetpull-0.1.0/src/fleetpull/endpoints/motive/driver_idle_rollups.py +113 -0
  51. fleetpull-0.1.0/src/fleetpull/endpoints/motive/driving_periods.py +85 -0
  52. fleetpull-0.1.0/src/fleetpull/endpoints/motive/groups.py +61 -0
  53. fleetpull-0.1.0/src/fleetpull/endpoints/motive/idle_events.py +94 -0
  54. fleetpull-0.1.0/src/fleetpull/endpoints/motive/users.py +64 -0
  55. fleetpull-0.1.0/src/fleetpull/endpoints/motive/vehicle_locations.py +170 -0
  56. fleetpull-0.1.0/src/fleetpull/endpoints/motive/vehicle_utilizations.py +122 -0
  57. fleetpull-0.1.0/src/fleetpull/endpoints/motive/vehicles.py +106 -0
  58. fleetpull-0.1.0/src/fleetpull/endpoints/registry.py +280 -0
  59. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/__init__.py +12 -0
  60. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/_spec_builders.py +202 -0
  61. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/addresses.py +77 -0
  62. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/asset_locations.py +217 -0
  63. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/driver_fuel_energy_reports.py +124 -0
  64. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/driver_vehicle_assignments.py +211 -0
  65. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/drivers.py +169 -0
  66. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/engine_states.py +114 -0
  67. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/gps_readings.py +113 -0
  68. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/idling_events.py +195 -0
  69. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/odometer_readings.py +116 -0
  70. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/trips.py +217 -0
  71. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/vehicle_fuel_energy_reports.py +139 -0
  72. fleetpull-0.1.0/src/fleetpull/endpoints/samsara/vehicles.py +121 -0
  73. fleetpull-0.1.0/src/fleetpull/endpoints/shared/__init__.py +57 -0
  74. fleetpull-0.1.0/src/fleetpull/endpoints/shared/base.py +529 -0
  75. fleetpull-0.1.0/src/fleetpull/endpoints/shared/request_shape.py +227 -0
  76. fleetpull-0.1.0/src/fleetpull/endpoints/shared/resume.py +74 -0
  77. fleetpull-0.1.0/src/fleetpull/endpoints/shared/spec_builders.py +59 -0
  78. fleetpull-0.1.0/src/fleetpull/endpoints/shared/sync_mode.py +159 -0
  79. fleetpull-0.1.0/src/fleetpull/endpoints/shared/url_paths.py +149 -0
  80. fleetpull-0.1.0/src/fleetpull/exceptions.py +320 -0
  81. fleetpull-0.1.0/src/fleetpull/incremental/__init__.py +27 -0
  82. fleetpull-0.1.0/src/fleetpull/incremental/cursor.py +66 -0
  83. fleetpull-0.1.0/src/fleetpull/incremental/resolution.py +152 -0
  84. fleetpull-0.1.0/src/fleetpull/incremental/seed.py +53 -0
  85. fleetpull-0.1.0/src/fleetpull/incremental/window.py +94 -0
  86. fleetpull-0.1.0/src/fleetpull/logger/__init__.py +5 -0
  87. fleetpull-0.1.0/src/fleetpull/logger/setup.py +145 -0
  88. fleetpull-0.1.0/src/fleetpull/model_contract/__init__.py +6 -0
  89. fleetpull-0.1.0/src/fleetpull/model_contract/coercions.py +33 -0
  90. fleetpull-0.1.0/src/fleetpull/model_contract/response.py +45 -0
  91. fleetpull-0.1.0/src/fleetpull/models/__init__.py +7 -0
  92. fleetpull-0.1.0/src/fleetpull/models/geotab/__init__.py +166 -0
  93. fleetpull-0.1.0/src/fleetpull/models/geotab/annotation_log.py +109 -0
  94. fleetpull-0.1.0/src/fleetpull/models/geotab/audit.py +56 -0
  95. fleetpull-0.1.0/src/fleetpull/models/geotab/device.py +217 -0
  96. fleetpull-0.1.0/src/fleetpull/models/geotab/driver_change.py +102 -0
  97. fleetpull-0.1.0/src/fleetpull/models/geotab/duty_status_log.py +200 -0
  98. fleetpull-0.1.0/src/fleetpull/models/geotab/dvir_log.py +184 -0
  99. fleetpull-0.1.0/src/fleetpull/models/geotab/exception_event.py +135 -0
  100. fleetpull-0.1.0/src/fleetpull/models/geotab/fault_data.py +168 -0
  101. fleetpull-0.1.0/src/fleetpull/models/geotab/fill_up.py +189 -0
  102. fleetpull-0.1.0/src/fleetpull/models/geotab/fuel_and_energy_used.py +81 -0
  103. fleetpull-0.1.0/src/fleetpull/models/geotab/fuel_tax_detail.py +150 -0
  104. fleetpull-0.1.0/src/fleetpull/models/geotab/log_record.py +68 -0
  105. fleetpull-0.1.0/src/fleetpull/models/geotab/media_file.py +133 -0
  106. fleetpull-0.1.0/src/fleetpull/models/geotab/shared.py +221 -0
  107. fleetpull-0.1.0/src/fleetpull/models/geotab/shipment_log.py +105 -0
  108. fleetpull-0.1.0/src/fleetpull/models/geotab/status_data.py +108 -0
  109. fleetpull-0.1.0/src/fleetpull/models/geotab/text_message.py +125 -0
  110. fleetpull-0.1.0/src/fleetpull/models/geotab/trip.py +162 -0
  111. fleetpull-0.1.0/src/fleetpull/models/geotab/user.py +187 -0
  112. fleetpull-0.1.0/src/fleetpull/models/motive/__init__.py +43 -0
  113. fleetpull-0.1.0/src/fleetpull/models/motive/driver_idle_rollup.py +109 -0
  114. fleetpull-0.1.0/src/fleetpull/models/motive/driving_period.py +82 -0
  115. fleetpull-0.1.0/src/fleetpull/models/motive/group.py +49 -0
  116. fleetpull-0.1.0/src/fleetpull/models/motive/idle_event.py +77 -0
  117. fleetpull-0.1.0/src/fleetpull/models/motive/shared.py +192 -0
  118. fleetpull-0.1.0/src/fleetpull/models/motive/user.py +217 -0
  119. fleetpull-0.1.0/src/fleetpull/models/motive/vehicle.py +162 -0
  120. fleetpull-0.1.0/src/fleetpull/models/motive/vehicle_location.py +127 -0
  121. fleetpull-0.1.0/src/fleetpull/models/motive/vehicle_utilization.py +128 -0
  122. fleetpull-0.1.0/src/fleetpull/models/samsara/__init__.py +108 -0
  123. fleetpull-0.1.0/src/fleetpull/models/samsara/address.py +149 -0
  124. fleetpull-0.1.0/src/fleetpull/models/samsara/asset_location.py +131 -0
  125. fleetpull-0.1.0/src/fleetpull/models/samsara/driver.py +232 -0
  126. fleetpull-0.1.0/src/fleetpull/models/samsara/driver_fuel_energy_report.py +153 -0
  127. fleetpull-0.1.0/src/fleetpull/models/samsara/driver_vehicle_assignment.py +168 -0
  128. fleetpull-0.1.0/src/fleetpull/models/samsara/engine_state.py +92 -0
  129. fleetpull-0.1.0/src/fleetpull/models/samsara/gps_reading.py +146 -0
  130. fleetpull-0.1.0/src/fleetpull/models/samsara/idling_event.py +174 -0
  131. fleetpull-0.1.0/src/fleetpull/models/samsara/odometer_reading.py +90 -0
  132. fleetpull-0.1.0/src/fleetpull/models/samsara/trip.py +199 -0
  133. fleetpull-0.1.0/src/fleetpull/models/samsara/vehicle.py +167 -0
  134. fleetpull-0.1.0/src/fleetpull/models/samsara/vehicle_fuel_energy_report.py +191 -0
  135. fleetpull-0.1.0/src/fleetpull/network/__init__.py +9 -0
  136. fleetpull-0.1.0/src/fleetpull/network/auth/__init__.py +15 -0
  137. fleetpull-0.1.0/src/fleetpull/network/auth/authenticate.py +271 -0
  138. fleetpull-0.1.0/src/fleetpull/network/auth/manager.py +223 -0
  139. fleetpull-0.1.0/src/fleetpull/network/auth/models.py +57 -0
  140. fleetpull-0.1.0/src/fleetpull/network/auth/strategies.py +169 -0
  141. fleetpull-0.1.0/src/fleetpull/network/classifiers/__init__.py +11 -0
  142. fleetpull-0.1.0/src/fleetpull/network/classifiers/geotab.py +145 -0
  143. fleetpull-0.1.0/src/fleetpull/network/classifiers/motive.py +79 -0
  144. fleetpull-0.1.0/src/fleetpull/network/classifiers/samsara.py +80 -0
  145. fleetpull-0.1.0/src/fleetpull/network/client/__init__.py +25 -0
  146. fleetpull-0.1.0/src/fleetpull/network/client/page.py +32 -0
  147. fleetpull-0.1.0/src/fleetpull/network/client/profile.py +27 -0
  148. fleetpull-0.1.0/src/fleetpull/network/client/registry.py +103 -0
  149. fleetpull-0.1.0/src/fleetpull/network/client/registry_base.py +150 -0
  150. fleetpull-0.1.0/src/fleetpull/network/client/runtime.py +44 -0
  151. fleetpull-0.1.0/src/fleetpull/network/client/transport.py +381 -0
  152. fleetpull-0.1.0/src/fleetpull/network/contract/__init__.py +50 -0
  153. fleetpull-0.1.0/src/fleetpull/network/contract/auth.py +48 -0
  154. fleetpull-0.1.0/src/fleetpull/network/contract/classifier.py +189 -0
  155. fleetpull-0.1.0/src/fleetpull/network/contract/envelope_fetcher.py +33 -0
  156. fleetpull-0.1.0/src/fleetpull/network/contract/envelopes.py +189 -0
  157. fleetpull-0.1.0/src/fleetpull/network/contract/outcome.py +43 -0
  158. fleetpull-0.1.0/src/fleetpull/network/contract/page_decoder.py +101 -0
  159. fleetpull-0.1.0/src/fleetpull/network/contract/request.py +97 -0
  160. fleetpull-0.1.0/src/fleetpull/network/decoders/__init__.py +40 -0
  161. fleetpull-0.1.0/src/fleetpull/network/decoders/_window_stamp.py +78 -0
  162. fleetpull-0.1.0/src/fleetpull/network/decoders/geotab.py +309 -0
  163. fleetpull-0.1.0/src/fleetpull/network/decoders/motive.py +204 -0
  164. fleetpull-0.1.0/src/fleetpull/network/decoders/motive_reports.py +114 -0
  165. fleetpull-0.1.0/src/fleetpull/network/decoders/samsara.py +343 -0
  166. fleetpull-0.1.0/src/fleetpull/network/decoders/samsara_reports.py +119 -0
  167. fleetpull-0.1.0/src/fleetpull/network/decoders/single_page.py +55 -0
  168. fleetpull-0.1.0/src/fleetpull/network/limits/__init__.py +13 -0
  169. fleetpull-0.1.0/src/fleetpull/network/limits/bucket_math.py +58 -0
  170. fleetpull-0.1.0/src/fleetpull/network/limits/limiter.py +153 -0
  171. fleetpull-0.1.0/src/fleetpull/network/limits/registry.py +96 -0
  172. fleetpull-0.1.0/src/fleetpull/network/posture/__init__.py +6 -0
  173. fleetpull-0.1.0/src/fleetpull/network/posture/client_options.py +96 -0
  174. fleetpull-0.1.0/src/fleetpull/network/retry/__init__.py +13 -0
  175. fleetpull-0.1.0/src/fleetpull/network/retry/decision.py +155 -0
  176. fleetpull-0.1.0/src/fleetpull/network/tls/__init__.py +5 -0
  177. fleetpull-0.1.0/src/fleetpull/network/tls/truststore_context.py +35 -0
  178. fleetpull-0.1.0/src/fleetpull/orchestrator/__init__.py +30 -0
  179. fleetpull-0.1.0/src/fleetpull/orchestrator/backfill.py +127 -0
  180. fleetpull-0.1.0/src/fleetpull/orchestrator/batch.py +155 -0
  181. fleetpull-0.1.0/src/fleetpull/orchestrator/bisection.py +271 -0
  182. fleetpull-0.1.0/src/fleetpull/orchestrator/drivers.py +350 -0
  183. fleetpull-0.1.0/src/fleetpull/orchestrator/entry.py +347 -0
  184. fleetpull-0.1.0/src/fleetpull/orchestrator/executors.py +128 -0
  185. fleetpull-0.1.0/src/fleetpull/orchestrator/fanout.py +163 -0
  186. fleetpull-0.1.0/src/fleetpull/orchestrator/feed_drive.py +266 -0
  187. fleetpull-0.1.0/src/fleetpull/orchestrator/metadata_projection.py +195 -0
  188. fleetpull-0.1.0/src/fleetpull/orchestrator/outcome.py +53 -0
  189. fleetpull-0.1.0/src/fleetpull/orchestrator/recording.py +85 -0
  190. fleetpull-0.1.0/src/fleetpull/orchestrator/resume.py +143 -0
  191. fleetpull-0.1.0/src/fleetpull/orchestrator/roster_harvest.py +108 -0
  192. fleetpull-0.1.0/src/fleetpull/orchestrator/roster_refresh.py +363 -0
  193. fleetpull-0.1.0/src/fleetpull/orchestrator/runner.py +262 -0
  194. fleetpull-0.1.0/src/fleetpull/orchestrator/shape_resolution.py +221 -0
  195. fleetpull-0.1.0/src/fleetpull/orchestrator/spine.py +166 -0
  196. fleetpull-0.1.0/src/fleetpull/orchestrator/streaming.py +153 -0
  197. fleetpull-0.1.0/src/fleetpull/orchestrator/unit_loop.py +273 -0
  198. fleetpull-0.1.0/src/fleetpull/orchestrator/watermark_drive.py +455 -0
  199. fleetpull-0.1.0/src/fleetpull/paths/__init__.py +13 -0
  200. fleetpull-0.1.0/src/fleetpull/paths/datasets.py +38 -0
  201. fleetpull-0.1.0/src/fleetpull/paths/partitions.py +41 -0
  202. fleetpull-0.1.0/src/fleetpull/paths/resolution.py +98 -0
  203. fleetpull-0.1.0/src/fleetpull/polars_typing/__init__.py +20 -0
  204. fleetpull-0.1.0/src/fleetpull/py.typed +0 -0
  205. fleetpull-0.1.0/src/fleetpull/records/__init__.py +19 -0
  206. fleetpull-0.1.0/src/fleetpull/records/convert.py +53 -0
  207. fleetpull-0.1.0/src/fleetpull/records/dataframe.py +63 -0
  208. fleetpull-0.1.0/src/fleetpull/records/event_time.py +70 -0
  209. fleetpull-0.1.0/src/fleetpull/records/fields.py +190 -0
  210. fleetpull-0.1.0/src/fleetpull/records/flatten.py +54 -0
  211. fleetpull-0.1.0/src/fleetpull/records/roster_members.py +74 -0
  212. fleetpull-0.1.0/src/fleetpull/records/schema.py +73 -0
  213. fleetpull-0.1.0/src/fleetpull/records/validation.py +62 -0
  214. fleetpull-0.1.0/src/fleetpull/resources/__init__.py +10 -0
  215. fleetpull-0.1.0/src/fleetpull/resources/config.example.yaml +222 -0
  216. fleetpull-0.1.0/src/fleetpull/roster/__init__.py +16 -0
  217. fleetpull-0.1.0/src/fleetpull/roster/definition.py +46 -0
  218. fleetpull-0.1.0/src/fleetpull/roster/key.py +40 -0
  219. fleetpull-0.1.0/src/fleetpull/roster/registry.py +93 -0
  220. fleetpull-0.1.0/src/fleetpull/state/__init__.py +36 -0
  221. fleetpull-0.1.0/src/fleetpull/state/cursors.py +417 -0
  222. fleetpull-0.1.0/src/fleetpull/state/database.py +463 -0
  223. fleetpull-0.1.0/src/fleetpull/state/migrations.py +430 -0
  224. fleetpull-0.1.0/src/fleetpull/state/reconcile.py +127 -0
  225. fleetpull-0.1.0/src/fleetpull/state/rosters.py +159 -0
  226. fleetpull-0.1.0/src/fleetpull/state/run_ledger.py +572 -0
  227. fleetpull-0.1.0/src/fleetpull/state/work_units.py +648 -0
  228. fleetpull-0.1.0/src/fleetpull/storage/__init__.py +30 -0
  229. fleetpull-0.1.0/src/fleetpull/storage/append.py +187 -0
  230. fleetpull-0.1.0/src/fleetpull/storage/atomic.py +161 -0
  231. fleetpull-0.1.0/src/fleetpull/storage/files.py +176 -0
  232. fleetpull-0.1.0/src/fleetpull/storage/frames.py +98 -0
  233. fleetpull-0.1.0/src/fleetpull/storage/metadata.py +161 -0
  234. fleetpull-0.1.0/src/fleetpull/storage/partitioned.py +205 -0
  235. fleetpull-0.1.0/src/fleetpull/storage/pruning.py +169 -0
  236. fleetpull-0.1.0/src/fleetpull/storage/read.py +35 -0
  237. fleetpull-0.1.0/src/fleetpull/storage/result.py +34 -0
  238. fleetpull-0.1.0/src/fleetpull/storage/single_file.py +130 -0
  239. fleetpull-0.1.0/src/fleetpull/storage/splitting.py +88 -0
  240. fleetpull-0.1.0/src/fleetpull/storage/staging.py +178 -0
  241. fleetpull-0.1.0/src/fleetpull/storage/writers.py +145 -0
  242. fleetpull-0.1.0/src/fleetpull/timing/__init__.py +21 -0
  243. fleetpull-0.1.0/src/fleetpull/timing/canon.py +92 -0
  244. fleetpull-0.1.0/src/fleetpull/timing/clock.py +192 -0
  245. fleetpull-0.1.0/src/fleetpull/timing/codec.py +122 -0
  246. fleetpull-0.1.0/src/fleetpull/timing/sleeper.py +65 -0
  247. fleetpull-0.1.0/src/fleetpull/vocabulary/__init__.py +16 -0
  248. fleetpull-0.1.0/src/fleetpull/vocabulary/json_types.py +20 -0
  249. fleetpull-0.1.0/src/fleetpull/vocabulary/provider.py +29 -0
  250. fleetpull-0.1.0/src/fleetpull/vocabulary/quota_scope.py +47 -0
  251. fleetpull-0.1.0/src/fleetpull/vocabulary/response_category.py +32 -0
  252. fleetpull-0.1.0/src/fleetpull.egg-info/PKG-INFO +248 -0
  253. fleetpull-0.1.0/src/fleetpull.egg-info/SOURCES.txt +260 -0
  254. fleetpull-0.1.0/src/fleetpull.egg-info/dependency_links.txt +1 -0
  255. fleetpull-0.1.0/src/fleetpull.egg-info/entry_points.txt +2 -0
  256. fleetpull-0.1.0/src/fleetpull.egg-info/requires.txt +14 -0
  257. fleetpull-0.1.0/src/fleetpull.egg-info/top_level.txt +1 -0
  258. fleetpull-0.1.0/tests/test_cli.py +103 -0
  259. fleetpull-0.1.0/tests/test_exceptions.py +141 -0
  260. fleetpull-0.1.0/tests/test_import_discipline.py +127 -0
  261. fleetpull-0.1.0/tests/test_temporal_discipline.py +136 -0
  262. fleetpull-0.1.0/tests/test_typing_discipline.py +217 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Andrew Jordan
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.4
2
+ Name: fleetpull
3
+ Version: 0.1.0
4
+ Summary: Pull fleet telematics data from provider APIs (Motive, Samsara, GeoTab) into typed polars DataFrames and parquet: retrieval, dtype coercion, and light structural normalization — no assumed end use.
5
+ Author-email: Andrew Jordan <andrewjordan3@gmail.com>
6
+ Maintainer-email: Andrew Jordan <andrewjordan3@gmail.com>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/andrewjordan3/fleetpull
9
+ Project-URL: Repository, https://github.com/andrewjordan3/fleetpull
10
+ Project-URL: Issues, https://github.com/andrewjordan3/fleetpull/issues
11
+ Keywords: telematics,fleet,motive,samsara,geotab,polars,api-client
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: httpx>=0.27.0
25
+ Requires-Dist: polars>=1.0.0
26
+ Requires-Dist: pydantic>=2.7.0
27
+ Requires-Dist: pyyaml>=6.0.0
28
+ Requires-Dist: truststore>=0.9.0
29
+ Requires-Dist: tzdata>=2025.2
30
+ Provides-Extra: dev
31
+ Requires-Dist: ruff>=0.5.0; extra == "dev"
32
+ Requires-Dist: mypy>=1.10.0; extra == "dev"
33
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
35
+ Requires-Dist: import-linter>=2.0; extra == "dev"
36
+ Requires-Dist: types-pyyaml; extra == "dev"
37
+ Dynamic: license-file
38
+
39
+ # fleetpull
40
+
41
+ fleetpull pulls fleet telematics data from provider APIs — **Motive**,
42
+ **Samsara**, and **GeoTab** — and delivers it as typed, dtype-coerced,
43
+ lightly normalized tabular output: Polars DataFrames in memory, parquet on
44
+ disk, staying as close to the raw API responses as is reasonable.
45
+
46
+ It is deliberately narrow. fleetpull does no cross-endpoint merging, builds
47
+ no unified cross-provider schema, performs no semantic deduplication, loads
48
+ no warehouse, and assumes no end use — downstream processing is the
49
+ consumer's concern. What it does instead is be rigorous about retrieval:
50
+ probed (never merely documented) provider behavior, crash-safe incremental
51
+ state, token-bucket rate limiting at the transport boundary, and one
52
+ explicit schema per (provider, endpoint).
53
+
54
+ **Status:** alpha. The two public verbs below are settled, and coverage is
55
+ broad — the Motive and Samsara endpoint inventories and the GeoTab `Get` and
56
+ feed surfaces are all shipped (see [ENDPOINTS.md](ENDPOINTS.md)). Pre-1.0,
57
+ the internals are still free to improve.
58
+
59
+ ## Install
60
+
61
+ ```bash
62
+ pip install fleetpull
63
+ # or
64
+ uv add fleetpull
65
+ ```
66
+
67
+ The latest development version, straight from source:
68
+
69
+ ```bash
70
+ pip install git+https://github.com/andrewjordan3/fleetpull
71
+ ```
72
+
73
+ Python ≥ 3.12. Core dependencies: `httpx`, `polars`, `pydantic` 2.x,
74
+ `pyyaml`, `truststore`, `tzdata`.
75
+
76
+ To scaffold a starter config for the `sync` verb below, run
77
+ `fleetpull init-config` — it writes an annotated `fleetpull_config.yaml`
78
+ you edit and point `sync` at.
79
+
80
+ ## The two verbs
81
+
82
+ ### `fetch` — one snapshot, in memory
83
+
84
+ The programmatic convenience verb: one endpoint's full current listing as an
85
+ eager, typed Polars DataFrame. No disk, no state, no configuration file.
86
+
87
+ ```python
88
+ from fleetpull import Endpoints, fetch
89
+
90
+ vehicles = fetch(Endpoints.Motive.vehicles, auth='your-api-key')
91
+ devices = fetch(
92
+ Endpoints.Geotab.devices,
93
+ auth={'username': '...', 'password': '...', 'database': '...'},
94
+ )
95
+ ```
96
+
97
+ - `auth` is a bare API-key string for Motive/Samsara and named fields (a
98
+ mapping or `GeotabAuthConfig`) for GeoTab. Credentials are wrapped in
99
+ `SecretStr` at the boundary and never appear in errors or logs.
100
+ - Behind a TLS-intercepting corporate proxy (Zscaler-class), pass
101
+ `use_truststore=True` to build TLS contexts from the OS trust store.
102
+ - `fetch` exposes **snapshot endpoints only** — a snapshot is bounded by
103
+ entity count, so the in-memory contract stays honest. Windowed history is
104
+ `sync` territory, and the type checker (plus a runtime guard) enforces the
105
+ split.
106
+ - An empty result is a zero-row frame carrying the full typed schema, never
107
+ `None`.
108
+
109
+ ### `Sync` — config-driven incremental pipeline
110
+
111
+ The pipeline verb: a YAML config selects providers and endpoints; each run
112
+ fetches incrementally, writes parquet, and commits its resume state.
113
+ `fleetpull init-config` writes a documented starter config to edit.
114
+
115
+ ```python
116
+ from fleetpull import Sync
117
+
118
+ Sync('fleetpull_config.yaml').run()
119
+ ```
120
+
121
+ ```yaml
122
+ sync:
123
+ default_start_date: 2025-01-01 # cold-start backfill anchor
124
+
125
+ storage:
126
+ dataset_root: /data/fleet # parquet lands here
127
+
128
+ logging:
129
+ console_level: INFO
130
+
131
+ providers:
132
+ motive:
133
+ endpoints: [vehicles, vehicle_locations, driving_periods]
134
+ # api_key: falls back to the MOTIVE_API_KEY environment variable
135
+ samsara:
136
+ endpoints: [vehicles]
137
+ # api_key: falls back to SAMSARA_API_KEY
138
+ geotab:
139
+ auth:
140
+ username: user@example.com
141
+ database: my_database
142
+ # password: falls back to GEOTAB_PASSWORD
143
+ endpoints: [devices, users, trips]
144
+ lookback_days: 7 # late-arrival refetch margin
145
+ ```
146
+
147
+ The same run is available from the shell: `fleetpull sync fleetpull_config.yaml`.
148
+
149
+ Endpoints run and commit independently — one endpoint's failure never halts
150
+ its siblings; a run with failures ends by raising `SyncFailuresError`
151
+ carrying every failure (queue order within each provider — feeders then
152
+ consumers, config order within each — providers in config order).
153
+
154
+ Output is one folder per endpoint under `dataset_root`:
155
+
156
+ ```
157
+ data/
158
+ motive/
159
+ vehicles/ # snapshot: one file, replaced each run
160
+ data.parquet
161
+ metadata.json # human-readable run summary — never read by the program
162
+ driving_periods/ # windowed: hive date partitions
163
+ date=2026-07-15/part.parquet
164
+ date=2026-07-16/part.parquet
165
+ metadata.json
166
+ ```
167
+
168
+ Hive `date=YYYY-MM-DD` layout is read natively by `pl.scan_parquet` and
169
+ BigQuery external tables. Operational state (watermarks, run ledger, backfill
170
+ work units) lives in SQLite at `<dataset_root>/.fleetpull/state.sqlite3`;
171
+ crash-safety ordering (parquet first, cursor second) plus delete-by-window
172
+ merge makes interrupted runs refetch idempotently — at-least-once fetching,
173
+ exactly-once data.
174
+
175
+ ## Output contract
176
+
177
+ - **One schema per (provider, endpoint).** Column dtypes derive from each
178
+ endpoint's Pydantic response model; nested objects flatten to
179
+ double-underscore-joined columns (`driver__id`). No cross-endpoint or
180
+ cross-provider unification, ever.
181
+ - **Event timestamps are timezone-aware UTC** end to end.
182
+ - **Exact-duplicate rows** (artifacts of pagination and crash refetch) are
183
+ dropped at write time; same-id-different-payload reconciliation belongs to
184
+ consumers.
185
+ - Values arrive as the provider sent them — no unit conversion, no semantic
186
+ cleanup. Provider quirks worth knowing (GeoTab's seconds-despite-the-name
187
+ `engineHours`, sentinel dates, per-endpoint window anchoring) are recorded
188
+ in [ENDPOINTS.md](ENDPOINTS.md) and DESIGN §8.
189
+
190
+ ## Errors
191
+
192
+ Consumers catch `FleetpullError` or its five public subclasses:
193
+
194
+ | Exception | When | Reasonable reaction |
195
+ |---|---|---|
196
+ | `ConfigurationError` | Bad config or wiring | Fix config, rerun |
197
+ | `AuthenticationError` | Rejected credentials | Fix credentials |
198
+ | `ProviderResponseError` | Non-retryable or contract-violating response | Investigate before rerunning |
199
+ | `RetriesExhaustedError` | Transient/rate-limit budget ran out | Rerun later |
200
+ | `SyncFailuresError` | One or more endpoints failed inside a sync run | Inspect `failures`, act per member |
201
+
202
+ Everything else is internal. Rate limits are respected automatically — a
203
+ shared token-bucket limiter sits at the transport boundary and a 429's
204
+ `Retry-After` pauses the whole quota scope.
205
+
206
+ ## Documentation
207
+
208
+ - [ENDPOINTS.md](ENDPOINTS.md) — every shipped endpoint, its mechanics, and
209
+ the port queue.
210
+ - [DESIGN.md](DESIGN.md) — the design of record: architecture, invariants,
211
+ and the probe-captured provider behaviors every binding encodes.
212
+ - [CLAUDE.md](CLAUDE.md) — engineering standards and verification gates.
213
+
214
+ ## Contributing
215
+
216
+ Contributions are welcome and encouraged — a new endpoint, a bug fix, a
217
+ sharper docstring, or a provider quirk you've hit in the wild. Start with
218
+ [CONTRIBUTING.md](CONTRIBUTING.md); the short version:
219
+
220
+ ```bash
221
+ uv sync --group dev
222
+ uv run ruff format . && uv run ruff check . \
223
+ && uv run mypy src/ tests/ \
224
+ && uv run lint-imports \
225
+ && uv run pytest
226
+ ```
227
+
228
+ These five gates are exactly what CI runs on every pull request, so a green
229
+ local run is a green CI run. Tests never hit real provider APIs; new
230
+ endpoints are built probe-first from live captures — the port discipline is
231
+ in [ENDPOINTS.md](ENDPOINTS.md), and the engineering standards are in
232
+ [CLAUDE.md](CLAUDE.md).
233
+
234
+ ## Acknowledgements
235
+
236
+ Built on [Polars](https://pola.rs), [Pydantic](https://pydantic.dev),
237
+ [httpx](https://www.python-httpx.org), and
238
+ [truststore](https://truststore.readthedocs.io) — fleetpull is a thin, rigorous
239
+ layer over their work.
240
+
241
+ ## Author
242
+
243
+ By Andrew Jordan. Questions, bugs, and endpoint requests are best raised as
244
+ [GitHub issues](https://github.com/andrewjordan3/fleetpull/issues).
245
+
246
+ ## License
247
+
248
+ [Apache License 2.0](LICENSE).
@@ -0,0 +1,210 @@
1
+ # fleetpull
2
+
3
+ fleetpull pulls fleet telematics data from provider APIs — **Motive**,
4
+ **Samsara**, and **GeoTab** — and delivers it as typed, dtype-coerced,
5
+ lightly normalized tabular output: Polars DataFrames in memory, parquet on
6
+ disk, staying as close to the raw API responses as is reasonable.
7
+
8
+ It is deliberately narrow. fleetpull does no cross-endpoint merging, builds
9
+ no unified cross-provider schema, performs no semantic deduplication, loads
10
+ no warehouse, and assumes no end use — downstream processing is the
11
+ consumer's concern. What it does instead is be rigorous about retrieval:
12
+ probed (never merely documented) provider behavior, crash-safe incremental
13
+ state, token-bucket rate limiting at the transport boundary, and one
14
+ explicit schema per (provider, endpoint).
15
+
16
+ **Status:** alpha. The two public verbs below are settled, and coverage is
17
+ broad — the Motive and Samsara endpoint inventories and the GeoTab `Get` and
18
+ feed surfaces are all shipped (see [ENDPOINTS.md](ENDPOINTS.md)). Pre-1.0,
19
+ the internals are still free to improve.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ pip install fleetpull
25
+ # or
26
+ uv add fleetpull
27
+ ```
28
+
29
+ The latest development version, straight from source:
30
+
31
+ ```bash
32
+ pip install git+https://github.com/andrewjordan3/fleetpull
33
+ ```
34
+
35
+ Python ≥ 3.12. Core dependencies: `httpx`, `polars`, `pydantic` 2.x,
36
+ `pyyaml`, `truststore`, `tzdata`.
37
+
38
+ To scaffold a starter config for the `sync` verb below, run
39
+ `fleetpull init-config` — it writes an annotated `fleetpull_config.yaml`
40
+ you edit and point `sync` at.
41
+
42
+ ## The two verbs
43
+
44
+ ### `fetch` — one snapshot, in memory
45
+
46
+ The programmatic convenience verb: one endpoint's full current listing as an
47
+ eager, typed Polars DataFrame. No disk, no state, no configuration file.
48
+
49
+ ```python
50
+ from fleetpull import Endpoints, fetch
51
+
52
+ vehicles = fetch(Endpoints.Motive.vehicles, auth='your-api-key')
53
+ devices = fetch(
54
+ Endpoints.Geotab.devices,
55
+ auth={'username': '...', 'password': '...', 'database': '...'},
56
+ )
57
+ ```
58
+
59
+ - `auth` is a bare API-key string for Motive/Samsara and named fields (a
60
+ mapping or `GeotabAuthConfig`) for GeoTab. Credentials are wrapped in
61
+ `SecretStr` at the boundary and never appear in errors or logs.
62
+ - Behind a TLS-intercepting corporate proxy (Zscaler-class), pass
63
+ `use_truststore=True` to build TLS contexts from the OS trust store.
64
+ - `fetch` exposes **snapshot endpoints only** — a snapshot is bounded by
65
+ entity count, so the in-memory contract stays honest. Windowed history is
66
+ `sync` territory, and the type checker (plus a runtime guard) enforces the
67
+ split.
68
+ - An empty result is a zero-row frame carrying the full typed schema, never
69
+ `None`.
70
+
71
+ ### `Sync` — config-driven incremental pipeline
72
+
73
+ The pipeline verb: a YAML config selects providers and endpoints; each run
74
+ fetches incrementally, writes parquet, and commits its resume state.
75
+ `fleetpull init-config` writes a documented starter config to edit.
76
+
77
+ ```python
78
+ from fleetpull import Sync
79
+
80
+ Sync('fleetpull_config.yaml').run()
81
+ ```
82
+
83
+ ```yaml
84
+ sync:
85
+ default_start_date: 2025-01-01 # cold-start backfill anchor
86
+
87
+ storage:
88
+ dataset_root: /data/fleet # parquet lands here
89
+
90
+ logging:
91
+ console_level: INFO
92
+
93
+ providers:
94
+ motive:
95
+ endpoints: [vehicles, vehicle_locations, driving_periods]
96
+ # api_key: falls back to the MOTIVE_API_KEY environment variable
97
+ samsara:
98
+ endpoints: [vehicles]
99
+ # api_key: falls back to SAMSARA_API_KEY
100
+ geotab:
101
+ auth:
102
+ username: user@example.com
103
+ database: my_database
104
+ # password: falls back to GEOTAB_PASSWORD
105
+ endpoints: [devices, users, trips]
106
+ lookback_days: 7 # late-arrival refetch margin
107
+ ```
108
+
109
+ The same run is available from the shell: `fleetpull sync fleetpull_config.yaml`.
110
+
111
+ Endpoints run and commit independently — one endpoint's failure never halts
112
+ its siblings; a run with failures ends by raising `SyncFailuresError`
113
+ carrying every failure (queue order within each provider — feeders then
114
+ consumers, config order within each — providers in config order).
115
+
116
+ Output is one folder per endpoint under `dataset_root`:
117
+
118
+ ```
119
+ data/
120
+ motive/
121
+ vehicles/ # snapshot: one file, replaced each run
122
+ data.parquet
123
+ metadata.json # human-readable run summary — never read by the program
124
+ driving_periods/ # windowed: hive date partitions
125
+ date=2026-07-15/part.parquet
126
+ date=2026-07-16/part.parquet
127
+ metadata.json
128
+ ```
129
+
130
+ Hive `date=YYYY-MM-DD` layout is read natively by `pl.scan_parquet` and
131
+ BigQuery external tables. Operational state (watermarks, run ledger, backfill
132
+ work units) lives in SQLite at `<dataset_root>/.fleetpull/state.sqlite3`;
133
+ crash-safety ordering (parquet first, cursor second) plus delete-by-window
134
+ merge makes interrupted runs refetch idempotently — at-least-once fetching,
135
+ exactly-once data.
136
+
137
+ ## Output contract
138
+
139
+ - **One schema per (provider, endpoint).** Column dtypes derive from each
140
+ endpoint's Pydantic response model; nested objects flatten to
141
+ double-underscore-joined columns (`driver__id`). No cross-endpoint or
142
+ cross-provider unification, ever.
143
+ - **Event timestamps are timezone-aware UTC** end to end.
144
+ - **Exact-duplicate rows** (artifacts of pagination and crash refetch) are
145
+ dropped at write time; same-id-different-payload reconciliation belongs to
146
+ consumers.
147
+ - Values arrive as the provider sent them — no unit conversion, no semantic
148
+ cleanup. Provider quirks worth knowing (GeoTab's seconds-despite-the-name
149
+ `engineHours`, sentinel dates, per-endpoint window anchoring) are recorded
150
+ in [ENDPOINTS.md](ENDPOINTS.md) and DESIGN §8.
151
+
152
+ ## Errors
153
+
154
+ Consumers catch `FleetpullError` or its five public subclasses:
155
+
156
+ | Exception | When | Reasonable reaction |
157
+ |---|---|---|
158
+ | `ConfigurationError` | Bad config or wiring | Fix config, rerun |
159
+ | `AuthenticationError` | Rejected credentials | Fix credentials |
160
+ | `ProviderResponseError` | Non-retryable or contract-violating response | Investigate before rerunning |
161
+ | `RetriesExhaustedError` | Transient/rate-limit budget ran out | Rerun later |
162
+ | `SyncFailuresError` | One or more endpoints failed inside a sync run | Inspect `failures`, act per member |
163
+
164
+ Everything else is internal. Rate limits are respected automatically — a
165
+ shared token-bucket limiter sits at the transport boundary and a 429's
166
+ `Retry-After` pauses the whole quota scope.
167
+
168
+ ## Documentation
169
+
170
+ - [ENDPOINTS.md](ENDPOINTS.md) — every shipped endpoint, its mechanics, and
171
+ the port queue.
172
+ - [DESIGN.md](DESIGN.md) — the design of record: architecture, invariants,
173
+ and the probe-captured provider behaviors every binding encodes.
174
+ - [CLAUDE.md](CLAUDE.md) — engineering standards and verification gates.
175
+
176
+ ## Contributing
177
+
178
+ Contributions are welcome and encouraged — a new endpoint, a bug fix, a
179
+ sharper docstring, or a provider quirk you've hit in the wild. Start with
180
+ [CONTRIBUTING.md](CONTRIBUTING.md); the short version:
181
+
182
+ ```bash
183
+ uv sync --group dev
184
+ uv run ruff format . && uv run ruff check . \
185
+ && uv run mypy src/ tests/ \
186
+ && uv run lint-imports \
187
+ && uv run pytest
188
+ ```
189
+
190
+ These five gates are exactly what CI runs on every pull request, so a green
191
+ local run is a green CI run. Tests never hit real provider APIs; new
192
+ endpoints are built probe-first from live captures — the port discipline is
193
+ in [ENDPOINTS.md](ENDPOINTS.md), and the engineering standards are in
194
+ [CLAUDE.md](CLAUDE.md).
195
+
196
+ ## Acknowledgements
197
+
198
+ Built on [Polars](https://pola.rs), [Pydantic](https://pydantic.dev),
199
+ [httpx](https://www.python-httpx.org), and
200
+ [truststore](https://truststore.readthedocs.io) — fleetpull is a thin, rigorous
201
+ layer over their work.
202
+
203
+ ## Author
204
+
205
+ By Andrew Jordan. Questions, bugs, and endpoint requests are best raised as
206
+ [GitHub issues](https://github.com/andrewjordan3/fleetpull/issues).
207
+
208
+ ## License
209
+
210
+ [Apache License 2.0](LICENSE).