pudl.extract.csv
¶
Extractor for CSV data.
Module Contents¶
Classes¶
Class for extracting dataframes from CSV files. |
Attributes¶
- class pudl.extract.csv.CsvExtractor(ds)[source]¶
Bases:
pudl.extract.extractor.GenericExtractor
Class for extracting dataframes from CSV files.
The extraction logic is invoked by calling extract() method of this class.
- source_filename(page: str, **partition: pudl.extract.extractor.PartitionSelection) str [source]¶
Produce the source CSV file name as it will appear in the archive.
- Parameters:
page – pudl name for the dataset contents, eg “boiler_generator_assn” or “data”
partition – partition to load. Examples: {‘year’: 2009} {‘year_month’: ‘2020-08’}
- Returns:
string name of the CSV file
- load_source(page: str, **partition: pudl.extract.extractor.PartitionSelection) pandas.DataFrame [source]¶
Produce the dataframe object for the given partition.
- Parameters:
page – pudl name for the dataset contents, eg “boiler_generator_assn” or “data”
partition – partition to load. Examples: {‘year’: 2009} {‘year_month’: ‘2020-08’}
- Returns:
pd.DataFrame instance containing CSV data