Comments (8)
Related: https://github.com/mapbox/mapbox-data-cli
from mapbox-cli-py.
@emilymcafee - that looks great, we'll probably follow the design of mapbox-data-cli
pretty closely for this tool.
from mapbox-cli-py.
@perrygeo as per discussion yesterday, I think mapbox datasets action-resource
will be a fine pattern.
There's a bug in our Datasets API documention. It says
Using the dataset API involves interacting with two types of resources: a dataset, which is a collection of features.
But there are actually four types of resources in /datasets/v1/{account}/{dataset}/features/{feature}
:
- The datasets container
/datasets/v1/{account}
. - The dataset
/datasets/v1/{account}/{dataset}
. - The dataset's feature container
/datasets/v1/{account}/{dataset}/features
. - The feature
/datasets/v1/{account}/{dataset}/features/{feature}
.
GETs on these 4 different URLs give 4 different responses. 4 different kinds of resources.
So, I propose we change your sketch above to
mapbox datasets list
mapbox datasets create [args]
mapbox datasets read-dataset DSNAME [args]
mapbox datasets update-dataset DSNAME [args]
mapbox datasets delete-dataset DSNAME [args]
mapbox datasets list-features DSNAME [args]
mapbox datasets batch-update-features DSNAME [args]
mapbox datasets read-feature DSNAME FNAME [args]
mapbox datasets update-feature DSNAME FNAME [args]
mapbox datasets delete-feature DSNAME FNAME [args]
Worth combining the DSNAME and FNAME into one argument? Something like DSNAME:FNAME
?
from mapbox-cli-py.
👏 that's clarifies things immensely! Thanks @sgillies - maybe once we're done here we can suggest some api documentation changes.
I like separate args for easier composibility.
In terms of DSNAME
and FNAME
, are you refering to the id
or actual names (feature name not being standard unless we require a properties.name which is icky)
from mapbox-cli-py.
I'm using name and id interchangeably. Separate args works for me.
from mapbox-cli-py.
there are actually four types of resources
Hmm. I didn't consider the list of datasets as a distinct resource, but I see your point. If you think its confusing I'm happy to update the docs.
I can jump on this doc + CLI task as soon as @sgillies' work on the sdk wraps up.
from mapbox-cli-py.
I've started putting this together, and I'm getting to the batch_update_features
function, which is always the problematic one.
From the CLI perspective, the goal in mapbox-data-cli was basically to expose three subcommands:
- mapbox dataset put-features: insert or update a set of features, performing as many backend requests as needed to get through the feature set
- mapbox dataset delete-features: delete a set of features, performing as many backend requests as needed to get through the id set
- mapbox dataset replace-dataset: list the ids in the dataset, delete them all and/or replace them with the features provided
Hidden here is a more generic question about how we want to handle "higher-level" commands that might result in multiple API requests.
from mapbox-cli-py.
Closed via #32.
from mapbox-cli-py.
Related Issues (20)
- Seems to be an off-by-one error in mapbox staticimage HOT 4
- Tileset info incorrect when uploading data files in parallel HOT 2
- Update Directions CLI HOT 5
- python MapboxDeprecationWarning: The distance module will be removed in the next version. Use the matrix module instead. "Use the matrix module instead.", MapboxDeprecationWarning) HOT 3
- Add mapbox-matrix HOT 2
- Homebrew tap: error & fix HOT 1
- 0.8.0 release
- address Homebrew formula warning HOT 1
- TypeError: request() got an unexpected keyword argument 'json'
- Remove deprecated Distance API
- Remove surface command HOT 1
- Gracefully error when tileset name not specified HOT 2
- Usage of `datasets create-tileset` HOT 1
- Retreiving tilesets HOT 1
- pip install --user mapboxcli doesn't actually install properly on debian 10 (buster) HOT 1
- Update mapbox dependency to support Python 3.9
- error while installing using homebrew HOT 9
- Install Fails on Windows
- Latest version on pypi is no longer installing properly
- Is this project abandoned?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-cli-py.