autopew.io

File operations for autopew. Contains a class to provide an generalized interface to a series of file types/instruments which can be built upon to add and register new IO capability.

class autopew.io.PewIOSpecification(*args, **kwargs)[source]

Template for input and output file handlers for autopew.

These handers specify functions to import files to pandas DataFrames and the export of these filetypes from pandas DataFrames.

extension = None
type = None
classmethod validate_dataframe(df)[source]

Validate the output of a file reader against the minimum requirements for autopew.

Parameters:df (pandas.DataFrame) – Dataframe to validate.
class autopew.io.PewCSV(*args, **kwargs)[source]
extension = '.csv'
classmethod read(filepath, **kwargs)[source]
classmethod write(df, filepath, **kwargs)[source]
class autopew.io.PewSCANCSV(*args, **kwargs)[source]
extension = '.scancsv'
classmethod read(filepath)[source]
classmethod write(df, filepath, **kwargs)[source]
class autopew.io.PewJEOLpos(*args, **kwargs)[source]
extension = '.pos'
classmethod write(df, filepath, **kwargs)[source]
autopew.io.registered_extensions()[source]

Get a dictionary of registered extensions mapping the relevant IO specifications.

Returns:
Return type:dict