The xlsx modul¶
gamslib.objectcsv.xlsx
¶
Utilities to convert object and datastream CSV files to XLSX format and back.
Provides functions to read CSV files, convert them to XLSX spreadsheets with separate sheets, and split XLSX files back into object and datastream CSV files.
read_csv
¶
csv_to_xlsx
¶
Convert object and datastream CSV files to a single XLSX file.
| PARAMETER | DESCRIPTION |
|---|---|
object_csv
|
Path to the object metadata CSV file.
TYPE:
|
ds_csv
|
Path to the datastream metadata CSV file.
TYPE:
|
output_file
|
Path for the output XLSX file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
Path to the created XLSX file.
TYPE:
|
Notes
- Object metadata is written to the "Object Metadata" sheet.
- Datastream metadata is written to the "Datastream Metadata" sheet.
xlsx_to_csv
¶
Convert a XLSX metadata file to two CSV files: object.csv and datastreams.csv.
| PARAMETER | DESCRIPTION |
|---|---|
xlsx_path
|
Path to the XLSX file containing metadata.
TYPE:
|
obj_csv_path
|
Path for the output object metadata CSV file.
TYPE:
|
ds_csv_path
|
Path for the output datastream metadata CSV file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[Path, Path]
|
tuple[Path, Path]: Paths to the created object and datastream CSV files. |
Notes
- Reads "Object Metadata" and "Datastream Metadata" sheets from the XLSX file.
- Writes each sheet to its respective CSV file.