Add CLI for Analytics API
amishas157 opened this issue · 3 comments
Based on Analytics SDK, add support for Analytics API
mapbox analytics [args]
-- resource_type
-- username
-- id
-- start
-- end
-- MAPBOX_ACCESS_TOKEN
In general, let's try to be compatible with the GNU standards for command line options here: https://www.gnu.org/prep/standards/html_node/Option-Table.html#Option-Table. What you've sketched will be fine with one change: --resource-type
for --resource_type
. We've got precedent in mapbox geocode
for -t
as a short name for --place-type
and so we can use -t
here as a shortcut for --resource-type
.
Commands get their access token from their "context" like this: https://github.com/mapbox/mapbox-cli-py/blob/master/mapboxcli/scripts/geocoding.py#L97. You won't have to write any other code to get it from the command line.
Looks like the Analytics API was deprecated
Yes, thanks @andrewharvey 👍