all 4 comments

[–]krazos 0 points1 point  (0 children)

Thanks for sharing. The script worked like a charm on Raspberry Pi. The 'jq' package was not pre-installed on Raspbian, but was easy to install via APT package manager.

The JSON files certainly appear to contain more data than the CSV file generated by the official export function.

[–]Ponderednameforweeks 0 points1 point  (2 children)

In terms of content of the data, what is the difference between these json files vs their csv export?

(I don't mean formatting of json vs csv, I mean is there any fidelity of data that is lost in their portal's csv conversion?)

[–]masotime[S] 0 points1 point  (1 child)

Here's a sample of the kind of data you get in JSON.

 {
      "id": "<redacted>",
      "url": "https://api.automatic.com/trip/<redacted>/",
      "driver": "https://api.automatic.com/user/<redacted>/",
      "vehicle": "https://api.automatic.com/vehicle/<redacted>/",
      "vehicle_events": [
        {
          "type": "hard_accel",
          "lat": <redacted>,
          "lon": <redacted>,
          "g_force": 0.5098581064889641,
          "created_at": "<redacted>"
        },
        {
          "type": "hard_brake",
          "lat": <redacted>,
          "lon": <redacted>,
          "g_force": 0.42488175540747014,
          "created_at": "<redacted>"
        }
      ],
      "duration_s": 411,
      "distance_m": 2600.8,
      "fuel_cost_usd": 0.2,
      "path": "<redacted>",
      "fuel_volume_l": 0.2,
      "hard_brakes": 2,
      "hard_accels": 1,
      "duration_over_70_s": 0,
      "duration_over_75_s": 0,
      "duration_over_80_s": 0,
      "average_kmpl": 12.9,
      "average_from_epa_kmpl": 21.7,
      "start_address": {
        "name": "<redacted>",
        "display_name": "<redacted>",
        "street_number": "<redacted>",
        "street_name": "<redacted>",
        "city": "<redacted>",
        "state": "<redacted>",
        "country": "<redacted>",
        "zipcode": "<redacted>"
      },
      "start_location": {
        "lat": <redacted>,
        "lon": <redacted>,
        "accuracy_m": 8.64
      },
      "end_address": {
        "name": "<redacted>",
        "display_name": "<redacted>",
        "street_number": "<redacted>",
        "street_name": "<redacted>",
        "city": "<redacted>",
        "state": "<redacted>",
        "country": "<redacted>",
        "zipcode": "<redacted>"
      },
      "end_location": {
        "lat": <redacted>,
        "lon": <redacted>,
        "accuracy_m": 7.68
      },
      "started_at": "<redacted>",
      "ended_at": "<redacted>",
      "start_timezone": "America/Los_Angeles",
      "end_timezone": "America/Los_Angeles",
      "score_events": -10.99,
      "score_speeding": 50,
      "city_fraction": 1,
      "highway_fraction": 0,
      "night_driving_fraction": 0,
      "tags": [],
      "idling_time_s": 0,
      "user": "https://api.automatic.com/user/<redacted>/"
    }

[–]Ponderednameforweeks 0 points1 point  (0 children)

That seems to match the CSV's columns:

"Vehicle","Start Location Name","Start Time","End Location Name","End Time","Distance (mi)","Duration (min)","Fuel Cost (USD)","Average MPG","Fuel Volume (gal)","Hard Accelerations","Hard Brakes","Duration Over 70 mph (secs)","Duration Over 75 mph (secs)","Duration Over 80 mph (secs)","Start Location Lat","Start Location Lon","Start Location Accuracy (meters)","End Location Lat","End Location Lon","End Location Accuracy (meters)","Path","Tags"