Skip to content

Commit

Permalink
starts adding documentation for digifeeds cli
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Oct 7, 2024
1 parent 2dd7009 commit a626c8c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
15 changes: 14 additions & 1 deletion aim/cli/digifeeds.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typer
from typing_extensions import Annotated
from aim.digifeeds.add_to_db import add_to_db as add_to_digifeeds_db
from aim.digifeeds.list_barcodes_in_bucket import list_barcodes_in_bucket
from aim.digifeeds.database import models, main
Expand All @@ -10,7 +11,19 @@


@app.command()
def add_to_db(barcode: str):
def add_to_db(
barcode: Annotated[
str,
typer.Argument(help="The barcode to be added to the database"),
],
):
"""
Add a barcode to the *Digifeeds Database* and then to the Alma Digifeeds Set
If the barcode is in the database fetch it and then try to add it to the
Digifeeds set in Alma. If the barcode isn't found in Alma, print an error.
Print whether or not the item is added to the digifeeds set.
"""
print(f'Adding barcode "{barcode}" to database')
item = add_to_digifeeds_db(barcode)
if item.has_status("not_found_in_alma"):
Expand Down
4 changes: 3 additions & 1 deletion aim/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import aim.cli.digifeeds as digifeeds

app = typer.Typer()
app.add_typer(digifeeds.app, name="digifeeds")
app.add_typer(
digifeeds.app, name="digifeeds", help="Commands related to the digifeeds process"
)


if __name__ == "__main__": # pragma: no cover
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a626c8c

Please sign in to comment.