Skip to content

Commit

Permalink
clarify resource identifier docs
Browse files Browse the repository at this point in the history
Fixes: #dandi#1435
  • Loading branch information
asmacdo committed Apr 26, 2024
1 parent 15196a9 commit 9637d0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dandi/cli/cmd_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
help=f"""\
Download files or entire folders from DANDI.
\b
{_dandi_url_parser.resource_identifier_primer}
\b
{_dandi_url_parser.known_patterns}
"""
Expand Down
2 changes: 2 additions & 0 deletions dandi/cli/cmd_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
The arguments may be either resource identifiers or paths to local
files/directories.
\b
{_dandi_url_parser.resource_identifier_primer}
\b
{_dandi_url_parser.known_patterns}
"""
Expand Down
9 changes: 9 additions & 0 deletions dandi/dandiarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,15 @@ class _dandi_url_parser:
"https://<server>/...",
),
]
resource_identifier_primer = """dandi commands and accept URLs and URL-like identifiers called
<resource ids> in the following formats for identifying Dandisets, assets, and asset
collections.
Text in [brackets] is optional. A server field is a base API or GUI URL
for a DANDI Archive instance. If an optional ``version`` field is omitted from
a URL, the given Dandiset's most recent published version will be used if it
has one, and its draft version will be used otherwise.
"""
known_patterns = "Accepted resource identifier patterns:" + "\n - ".join(
[""] + [display for _, _, display in known_urls]
)
Expand Down

0 comments on commit 9637d0e

Please sign in to comment.