Welcome to nem’s documentation!¶
This is an example on how to use the nem module to read data from AEMO.
import nem
for document in nem.current.DispatchIS:
for data in document.filter("PRICE"):
if data["REGIONID"] == "VIC1":
print(data["RRP"])
# prints out the RRP for VIC
print(nem.generators()["GSTONE1"]["Fuel Source - Primary"])
# 'Fossil'
# prints out the primary fuel source for gstone
-
nem.archive= <nem.importer.importer object>¶ Provides a
nem.importerfor archive data
-
nem.current= <nem.importer.importer object>¶ Provides a
nem.importerfor current data
-
nem.direct¶ Provides a
nem.importer.documentfor single use file extractionalias of
document
-
nem.generators¶ Dictonary of generators and their data from the partipants list
alias of
stationdata
-
nem.historical= <nem.importer.importer object>¶ Provides a
nem.importerfor historical data (10+ years)
-
class
nem.importer.document(url)¶ Bases:
objectLists all the documents avaliable for parsing by this module
Parameters: url ( string) – URL to parse-
clean_data¶ Provides a dictonary of all the datasets
Return type: object Returns: {“dataset1”:[{“header1”:”value”}]}
-
data¶ Provides the raw data from the file
Return type: list Returns: Array of raw lines of data
-
datasets¶ Provides lists of datasets in the file
Return type: list Returns: Array of datasets avaliable
-
dateTime= None¶ Provides a datetime object for the file based on the timestamp in the filename
Return type: datetime
-
filter(dataSet)¶ Filters out data to a specific dataset and return that set
Return type: [{“header1”:”data1”}]
-
-
class
nem.importer.files(baseUrl, historical)¶ Bases:
listLists all the documents avaliable for parsing by this module
Parameters: - baseUrl (
string) – URL to list files for - historical (
string) – Enables generating a list of files for every year, requires being set to the filename requested (eg PUBLIC_DVD_P5MIN_REGIONSOLUTION)
Returns: Returns an array of documents
Return type: [document]- baseUrl (
-
class
nem.importer.importer(url='http://www.nemweb.com.au/Reports/CURRENT/', historical=False)¶ Bases:
objectImpoter class allows downloading data from AEMO NEM site
Parameters: - url (
string) – URL to the NEM server - historical (
boolean) – Access to historical data using the MMSDM data
Returns: Returns an array of documents
Return type: [document]- url (