iode.Comments
- class iode.Comments(filepath: str = None)[source]
IODE Comments database.
- Parameters:
- filepath: str, optional
file containing the IODE comments to load.
- Attributes:
- filename: str
- description: str
Methods
clear()Delete all objects from the current database.
compare(filepath[, ...])The objects of the current database are compared with those stored in the file filepath.
convert_file(input_file, input_format, ...)Convert an external file representing IODE comments to an IODE comments file (.cmt).
copy([pattern])Create a new database instance in which each object is a copy of the original object from the global IODE database.
copy_from(input_files[, names])Copy (a subset of) comments from the input file(s) 'input_files' into the current database.
from_series(s)Copy the pandas Series s into the IODE Comments database.
get_name(pos)Return the name of the IODE object at position pos in the database.
get_names([pattern, filepath])Returns the list of objects names given a pattern.
get_names_from_pattern(list_name, pattern, xdim)Generate an IODE list containing the names of objects that match a given pattern.
index(name)Return the position of the IODE object with name name in the database.
load(filepath)Load objects stored in file 'filepath' into the current database.
merge(other[, overwrite])Merge the content of the 'other' database into the current database.
merge_from(input_file)Merge all objects stored in the input file 'input_file' into the current database.
Create a new empty detached database.
print_to_file(filepath[, names, format])Print the list comments defined by names to the file filepath using the format format.
remove(names)Delete the object(s) named 'names' from the current database.
rename(old_name, new_name[, overwrite])Rename an object of the database.
save(filepath[, compress])Save objects of the current database into the file 'filepath'.
search(pattern[, word, case_sensitive, ...])Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...
subset(pattern, copy)Create a subset of the database filtered by a name pattern.
Create a pandas Series from the current Comments database.
from_cython_obj
get_instance
- Returns:
- Comments
Examples
>>> from iode import comments, SAMPLE_DATA_DIR >>> comments.load(f"{SAMPLE_DATA_DIR}/fun.cmt") Loading .../fun.cmt 317 objects loaded >>> len(comments) 317 >>> comments Workspace: Comments nb comments: 317 filename: ...\tests\data\fun.cmt name comments ACAF Ondernemingen: ontvangen kapitaaloverdrachten. ACAG Totale overheid: netto ontvangen kapitaaloverdrachten. AOUC Kost per eenheid produkt. AQC Kost per eenheid produkt: kapitaal en arbeid. BENEF Ondernemingen: niet-uitgekeerde winsten. ... ... ZF Indexeringscoëfficiënt voor de lonen in de private sector. ZJ Indexeringscoëfficiënt voor de sociale uitkeringen, vertraagd in de periode 1984-1988, voor de verrekening van de indexsprongen bij de vervangingsinkomens (1984, 1985, 1987). ZKF Bezettingsgraad van de produktiecapaciteit. ZX Saut d'index (correction en %) ZZ_ Marktsector (ondernemingen en zelfstandigen): loonquote (gemiddelde 1954-94).
Methods
__init__([filepath])clear()Delete all objects from the current database.
compare(filepath[, ...])The objects of the current database are compared with those stored in the file filepath.
convert_file(input_file, input_format, ...)Convert an external file representing IODE comments to an IODE comments file (.cmt).
copy([pattern])Create a new database instance in which each object is a copy of the original object from the global IODE database.
copy_from(input_files[, names])Copy (a subset of) comments from the input file(s) 'input_files' into the current database.
from_cython_obj(obj)from_series(s)Copy the pandas Series s into the IODE Comments database.
get_instance()get_name(pos)Return the name of the IODE object at position pos in the database.
get_names([pattern, filepath])Returns the list of objects names given a pattern.
get_names_from_pattern(list_name, pattern, xdim)Generate an IODE list containing the names of objects that match a given pattern.
index(name)Return the position of the IODE object with name name in the database.
load(filepath)Load objects stored in file 'filepath' into the current database.
merge(other[, overwrite])Merge the content of the 'other' database into the current database.
merge_from(input_file)Merge all objects stored in the input file 'input_file' into the current database.
Create a new empty detached database.
print_to_file(filepath[, names, format])Print the list comments defined by names to the file filepath using the format format.
remove(names)Delete the object(s) named 'names' from the current database.
rename(old_name, new_name[, overwrite])Rename an object of the database.
save(filepath[, compress])Save objects of the current database into the file 'filepath'.
search(pattern[, word, case_sensitive, ...])Return a list of all objects from the current database having a specific pattern in their names or LEC expression, comment...
subset(pattern, copy)Create a subset of the database filtered by a name pattern.
Create a pandas Series from the current Comments database.
Attributes
Description of the current database.
Return the filepath associated with the current database.
Allow to select the ith comment in the database.
Return the object type of the current database.
Whether or not any change made on the present database or subset will modify the global IODE workspace.
Whether or not the present database represents the global IODE workspace.
List of names of all objects in the current database.
Create a pandas Series from the current Comments database.