datumaro.cli.util.project#
Functions
|
If basedir does not contain basename, returns basename, otherwise generates a name by appending sep to the basename and the number, next to the last used number in the basedir for files with basename prefix. |
|
load a Project. |
|
Parses Dataset paths. The syntax is: |
|
revpath - either a Dataset path or a Revision path. |
|
Parses Revision paths. The syntax is: |
|
Splits the given string into revpath components. |
Classes
|
An enumeration. |
- datumaro.cli.util.project.generate_next_file_name(basename, basedir='.', sep='.', ext='')[source]#
If basedir does not contain basename, returns basename, otherwise generates a name by appending sep to the basename and the number, next to the last used number in the basedir for files with basename prefix. Optionally, appends ext.
- datumaro.cli.util.project.parse_dataset_pathspec(s: str, env: Environment | None = None) Dataset [source]#
- Parses Dataset paths. The syntax is:
<dataset path>[ :<format> ]
Returns: a dataset from the parsed path
- datumaro.cli.util.project.parse_revspec(s: str, ctx_project: Project | None = None) Tuple[Dataset, Project] [source]#
- Parses Revision paths. The syntax is:
<project path> [ @<rev> ] [ :<target> ]
<rev> [ :<target> ]
<target>
The second and the third forms assume an existing “current” project.
- Returns: the dataset and the project from the parsed path.
The project is only returned when specified in the revpath.
- datumaro.cli.util.project.parse_full_revpath(s: str, ctx_project: Project | None = None) Tuple[Dataset, Project | None] [source]#
revpath - either a Dataset path or a Revision path.
- Returns: the dataset and the project from the parsed path
The project is only returned when specified in the revpath.
- datumaro.cli.util.project.split_local_revpath(revpath: str) Tuple[Revision, str] [source]#
Splits the given string into revpath components.
A local revpath is a path to a revision withing the current project. The syntax is:
[ <revision> : ] [ <target> ]
At least one part must be present.
Returns: (revision, build target)