Input Output core module

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

FileObjectModelProtocol

Bases: Protocol

is_valid() -> bool

Verifies if the current object is valid for import / export.

Returns:
  • bool( bool ) –

    Result of the validation.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatExporterProtocol

Bases: Protocol

export(**kwargs) -> None

Exports an object model into a concrete file format.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatImporterProtocol

Bases: Protocol

import_from(from_path: Path) -> DataObjectModelProtocol | list[DataObjectModelProtocol]

Generates a valid instance of a DataObjectModelProtocol based on the contents from the provided path.

Parameters:
  • from_path (Path) –

    Path containing data to be read (file or directory).

Returns:
            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatReaderProtocol

Bases: Protocol

read(file_path: Path) -> FileObjectModelProtocol

Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.

Parameters:
  • file_path (Path) –

    Path to a file that should be imported.

Returns:

supports_file(file_path: Path) -> bool

Validates whether the current reader is capable of importing data from the provided file.

Parameters:
  • file_path (Path) –

    Path to a file that should be imported.

Returns:
  • bool( bool ) –

    Result of validation.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatWriterProtocol

Bases: Protocol

write(fom_instance: FileObjectModelProtocol, to_path: Path) -> None

Writes the data from the instance of a FileObjectModelProtocol to the to_path.

Parameters:
  • fom_instance (FileObjectModelProtocol) –

    Instance with data to write.

  • to_path (Path) –

    Path to file (or directory) where to write the data.

CSV module

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatCsvFomProtocol

Bases: FileObjectModelProtocol, Protocol

is_valid() -> bool

Validates the current structure of this KoswatCsvFomProtocol instance.

Returns:
  • bool( bool ) –

    True when is a valid FOM.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

JSON module

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatJsonFomProtocol

Bases: FileObjectModelProtocol, Protocol

is_valid() -> bool

Validates the current structure of this KoswatJsonFomProtocol instance.

Returns:
  • bool( bool ) –

    True when is a valid FOM.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

TXT module

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

KoswatTxtFomProtocol

Bases: FileObjectModelProtocol, Protocol

from_text(file_text: str) -> KoswatTxtFomProtocol classmethod

Imports all the data stored in text form.

Parameters:
  • file_text (str) –

    Raw data in string format.

Returns:
  • KoswatTxtFomProtocol( KoswatTxtFomProtocol ) –

    Valid instance of a KoswatTxtFomProtocol with the provided values.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 Stichting Deltares

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.