Package: mms-monthly-cli
AEMO Monthly Data Archive ToolA CLI utility to find and obtain data made available through AEMO'sMMS Monthly Data Archive.NoteThis package and its CLI have some overlap withNEMOSISandNEMSEER.
However:NEMOSIS does not provide access to the monthly data archive, and does not allow a user to download certain
tables such as bid data tables (BIDPEROFFER).NEMSEER only handles PASA and pre-dispatch tables available in the monthly data archive, though it
provides a lot of useful utilities for handling these tablesInstallationRecommended that you usepipxto install the CLI as itprevents dependency conflicts.pipxinstallmms-monthly-cliHowever, you can still install viapipif you are only using the Python package:pipinstallmms-monthly-cliUsageYou can use this package as a module (source code functions withinmms_monthly.py) or as a CLI tool to:Inspect what data is availableDownload and unzip a table CSV for a particular period (i.e. a month within a year)Python moduleSimply importmms_monthly_clias follows:importmms_monthly_cli.mms_monthlyasmms_monthlyThis will expose the following functions (accessed usingmms_monthly.<func_name>):get_years_and_months()->Dict[int,List[int]]Years and months with data on NEMWeb MMSDM Historical Data Archive
Returns:
    Months mapped to each year. Data is available for each of these months.get_available_tables(year:int,month:int,data_dir:str)->List[str]Tables that can be requested from MMSDM Historical Data Archive for a
   particular month and year.
Args:
    year: Year
    month: Month
    data_dir: Directory within monthly archives

Returns:
    List of tables associated with that forecast type for that periodget_table_names_and_sizes(year:int,month:int,data_dir:str)->DictReturns table names and sizes from MMSDM Historical Data Archive page

For a year and month in the MMSDM Historical Data Archive, returns a list of
tuples each consisting of:-A table name (obtained via captured regex group)-The size of the associated zip file

Args:
    year: Year
    month: Month
    data_dir: Directory within monthly archives
Returns:
    Tuple of table names and file sizesget_and_unzip_table_csv(year:int,month:int,data_dir:str,table:str,cache:pathlib.Path)->NoneUnzipped (single) csv file downloaded from`url`to`cache`This function:1.Downloads zip file in chunks to limit memory use and enable progress bar2.Validates that the zip contains a single file that has the same name as the zip

Args:
    year: Year
    month: Month
    data_dir: Directory within monthly archives
    table: Table name
    cache: Path to save zip.
Returns:
    None. Extracts csv to`cache`CLI toolThe CLI tool usesTyper.GIF produced usingasciinemaandaggUsage is documented within the tool:mms-monthly-cli--help...which returns:Usage:mms-monthly-cli[OPTIONS]COMMAND[ARGS]...ACLIutilitytofindandobtaindatamadeavailablethroughAEMO'sMMSMonthlyDataArchive:http://www.nemweb.com.au/Data_Archive/Wholesale_Electricity/MMSDM/

╭─Options───────────────────────────────────────────────────────────────────────────────╮
│--install-completionInstallcompletionforthecurrentshell.│
│--show-completionShowcompletionforthecurrentshell,tocopyitor│
│customizetheinstallation.│
│--helpShowthismessageandexit.│
╰─────────────────────────────────────────────────────────────────────────────────────────╯
╭─Commands──────────────────────────────────────────────────────────────────────────────╮
│available-periodsDisplaysyearsandthemonthswithinthemforwhichdatais│
│available│
│available-tablesDisplaysavailabletablesforaperiod(i.e.suppliedmonthand│
│year)│
│get-tableDownloadandunzipmonthlydatazipfiletogetdatatableCSVin│
│cache.Toseeavailableperiods,usethe`available_periods`command│
│Toseeavailabletablesforagivenperiod,usethe│
│`available_tables`command│
╰─────────────────────────────────────────────────────────────────────────────────────────╯LicenseThis tool and associated source code (reused fromnemseer, which is licensed under GNU GPL-3.0-or-later) was created by Abhijith Prakash.This tool and its source code is licensed under the terms ofGNU GPL-3.0-or-later licences.