GithubHelp home page GithubHelp logo

Dataset API about mapbox-cli-py HOT 8 CLOSED

mapbox avatar mapbox commented on June 19, 2024
Dataset API

from mapbox-cli-py.

Comments (8)

emilymcafee avatar emilymcafee commented on June 19, 2024

Related: https://github.com/mapbox/mapbox-data-cli

from mapbox-cli-py.

perrygeo avatar perrygeo commented on June 19, 2024

@emilymcafee - that looks great, we'll probably follow the design of mapbox-data-cli pretty closely for this tool.

from mapbox-cli-py.

sgillies avatar sgillies commented on June 19, 2024

@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}:

  1. The datasets container /datasets/v1/{account}.
  2. The dataset /datasets/v1/{account}/{dataset}.
  3. The dataset's feature container /datasets/v1/{account}/{dataset}/features.
  4. 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.

perrygeo avatar perrygeo commented on June 19, 2024

👏 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.

sgillies avatar sgillies commented on June 19, 2024

I'm using name and id interchangeably. Separate args works for me.

from mapbox-cli-py.

rclark avatar rclark commented on June 19, 2024

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.

rclark avatar rclark commented on June 19, 2024

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.

sgillies avatar sgillies commented on June 19, 2024

Closed via #32.

from mapbox-cli-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.