miranda.archive package#
Archive module.
- miranda.archive.group_by_deciphered_date(files: generator | list[str | pathlib.Path]) dict[str, list[pathlib.Path]] [source]#
Find a common date and groups files based on year and month.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
- Returns:
dict[str, list[pathlib.Path]]
- miranda.archive.group_by_length(files: generator | list[str | pathlib.Path], size: int = 10, sort: bool = False) list[list[pathlib.Path]] [source]#
Group files by an arbitrary number of file entries.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
size (int)
sort (bool)
- Returns:
list[list[pathlib.Path]]
- miranda.archive.group_by_size(files: generator | list[str | pathlib.Path], size: int = 10737418240) list[list[pathlib.Path]] [source]#
Group files up until a desired size and save it as a grouping within a list.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
size (int)
- Returns:
list[list[pathlib.Path]]
- miranda.archive.group_by_subdirectories(files: generator | list[str | pathlib.Path], within: Path | str | None = None) dict[str, list[pathlib.Path]] [source]#
Group files based on the parent folder that they are located within.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
within (str or pathlib.Path)
- Returns:
dict[str, list[pathlib.Path]]
- miranda.archive.select_by_date_modified(source: str | Path, year: int | None, month: int | None, day: int | None, *, suffixes: str = 'nc', date: datetime) list[pathlib.Path] [source]#
Select files by the date on which they were last modified.
- Parameters:
source (str or Path)
year (int)
month (int)
day (int)
suffixes (str)
date (datetime.date)
- Returns:
list of Path
Submodules#
miranda.archive._groupings module#
- miranda.archive._groupings.group_by_deciphered_date(files: generator | list[str | pathlib.Path]) dict[str, list[pathlib.Path]] [source]#
Find a common date and groups files based on year and month.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
- Returns:
dict[str, list[pathlib.Path]]
- miranda.archive._groupings.group_by_length(files: generator | list[str | pathlib.Path], size: int = 10, sort: bool = False) list[list[pathlib.Path]] [source]#
Group files by an arbitrary number of file entries.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
size (int)
sort (bool)
- Returns:
list[list[pathlib.Path]]
- miranda.archive._groupings.group_by_size(files: generator | list[str | pathlib.Path], size: int = 10737418240) list[list[pathlib.Path]] [source]#
Group files up until a desired size and save it as a grouping within a list.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
size (int)
- Returns:
list[list[pathlib.Path]]
- miranda.archive._groupings.group_by_subdirectories(files: generator | list[str | pathlib.Path], within: Path | str | None = None) dict[str, list[pathlib.Path]] [source]#
Group files based on the parent folder that they are located within.
- Parameters:
files (GeneratorType or list of str or pathlib.Path)
within (str or pathlib.Path)
- Returns:
dict[str, list[pathlib.Path]]
miranda.archive._selection module#
- miranda.archive._selection.select_by_date_modified(source: str | Path, year: int | None, month: int | None, day: int | None, *, suffixes: str = 'nc', date: datetime) list[pathlib.Path] [source]#
Select files by the date on which they were last modified.
- Parameters:
source (str or Path)
year (int)
month (int)
day (int)
suffixes (str)
date (datetime.date)
- Returns:
list of Path