Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions datagouv/commands/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@app.command()
def display(id: str) -> None:
"""Human-friendlily display a dataset's attributes."""
"""Display the main attributes of a dataset in a human-friendly format. `id` required."""
client = Client(**load_config())
dataset = client.dataset(id)
for att in dataset._attributes:
Expand All @@ -19,7 +19,7 @@ def display(id: str) -> None:

@app.command()
def get(id: str) -> None:
"""Display a dataset's metadata in JSON."""
"""Display all attributes of a dataset in JSON (title, description, resources, ...). `id` required."""
client = Client(**load_config())
dataset = client.dataset(id, fetch=False)
display_json(dataset)
Expand Down Expand Up @@ -58,7 +58,7 @@ def update(
id: str,
set: list[str] = typer.Option([], "--set"),
) -> None:
"""Update a dataset. Each `--set` option is expected as `<key>=<new_value>`."""
"""Update a dataset by `id`. Each `--set` option is expected as `<key>=<new_value>`."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it weird to have this syntax here while we have "id required" above, maybe we'd rather standardize that too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i prefer the 'by id' version here, but i didn't know how to translate that in 'Display the main attributes of a dataset in a human-friendly format. id required.'

Maybe 'Display the main attributes of a dataset, looked up by id, in a human-friendly format.' but heavy

client = Client(**load_config())
payload = {}
for item in set:
Expand All @@ -83,7 +83,7 @@ def sort_resources(

@app.command()
def delete(id: str) -> None:
"""Delete a dataset."""
"""Delete a dataset by `id`."""
client = Client(**load_config())
client.dataset(id, fetch=False).delete()
typer.echo("Dataset deleted successfully ✓")
8 changes: 4 additions & 4 deletions datagouv/commands/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@app.command()
def display(id: str) -> None:
"""Human-friendlily display an organization's attributes."""
"""Display an organization's main attributes in a human-friendly format. `id` required."""
client = Client(**load_config())
orga = client.organization(id)
for att in orga._attributes:
Expand All @@ -19,7 +19,7 @@ def display(id: str) -> None:

@app.command()
def get(id: str) -> None:
"""Display an organization's metadata in JSON."""
"""Display all of an organization's attributes in JSON. `id` required."""
client = Client(**load_config())
organization = client.organization(id, fetch=False)
display_json(organization)
Expand Down Expand Up @@ -47,7 +47,7 @@ def update(
id: str,
set: list[str] = typer.Option([], "--set"),
) -> None:
"""Update an organization. Each `--set` option is expected as `<key>=<new_value>`."""
"""Update an organization by `id`. Each `--set` option is expected as `<key>=<new_value>`."""
client = Client(**load_config())
payload = {}
for item in set:
Expand All @@ -60,7 +60,7 @@ def update(

@app.command()
def delete(id: str) -> None:
"""Delete an organization."""
"""Delete an organization by `id`."""
client = Client(**load_config())
client.organization(id, fetch=False).delete()
typer.echo("Organization deleted successfully ✓")
10 changes: 5 additions & 5 deletions datagouv/commands/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@app.command()
def display(id: str) -> None:
"""Human-friendlily display a resource's attributes."""
"""Display a resource's main attributes in a human-friendly format. `id` required."""
client = Client(**load_config())
resource = client.resource(id)
for att in resource._attributes:
Expand All @@ -19,7 +19,7 @@ def display(id: str) -> None:

@app.command()
def get(id: str) -> None:
"""Display a resource's metadata in JSON."""
"""Display all of a resource's attributes in JSON (title, description, download URL, ...). `id` required."""
client = Client(**load_config())
resource = client.resource(id, fetch=False)
display_json(resource)
Expand Down Expand Up @@ -62,7 +62,7 @@ def update(
id: str,
set: list[str] = typer.Option([], "--set"),
) -> None:
"""Update a resource. Each `--set` option is expected as `<key>=<new_value>`."""
"""Update a resource by `id`. Each `--set` option is expected as `<key>=<new_value>`."""
client = Client(**load_config())
payload = {}
for item in set:
Expand All @@ -75,15 +75,15 @@ def update(

@app.command()
def download(id: str, path: str) -> None:
"""Download a resource to a given path."""
"""Download a resource by `id` to a given `path`."""
client = Client(**load_config())
client.resource(id).download(path)
typer.echo(f"Resource downloaded successfully at {path} ✓")


@app.command()
def delete(id: str) -> None:
"""Delete a resource."""
"""Delete a resource by `id`."""
client = Client(**load_config())
client.resource(id, fetch=False).delete()
typer.echo("Resource deleted successfully ✓")
8 changes: 4 additions & 4 deletions datagouv/commands/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@app.command()
def display(id: str) -> None:
"""Human-friendlily display a topic's attributes."""
"""Display a topic's attributes in a human-friendly format. `id` required."""
client = Client(**load_config())
topic = client.topic(id)
for att in topic._attributes:
Expand All @@ -19,7 +19,7 @@ def display(id: str) -> None:

@app.command()
def get(id: str) -> None:
"""Display a topic's metadata in JSON."""
"""Display all of a topic's attributes in JSON. `id` required."""
client = Client(**load_config())
topic = client.topic(id, fetch=False)
display_json(topic)
Expand Down Expand Up @@ -57,7 +57,7 @@ def update(
id: str,
set: list[str] = typer.Option([], "--set"),
) -> None:
"""Update a topic. Each `--set` option is expected as `<key>=<new_value>`."""
"""Update a topic by `id`. Each `--set` option is expected as `<key>=<new_value>`."""
client = Client(**load_config())
payload = {}
for item in set:
Expand All @@ -70,7 +70,7 @@ def update(

@app.command()
def delete(id: str) -> None:
"""Delete a topic."""
"""Delete a topic by `id`."""
client = Client(**load_config())
client.topic(id, fetch=False).delete()
typer.echo("Topic deleted successfully ✓")