Skip to content

Commit

Permalink
doc: update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
msto committed Apr 13, 2024
1 parent d1b7536 commit c0cf209
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dataclass_io/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ def __init__(
Args:
path: Path to the file to write.
dataclass_type: Dataclass type.
mode: Either `"write"` or `"append"`.
If `"write"`, the specified file `path` must not already exist unless
`overwrite=True` is specified.
If `"append"`, the specified file `path` must already exist and contain a header row
matching the specified dataclass and any specified `include_fields` or
`exclude_fields`.
delimiter: The output file delimiter.
overwrite: If `True`, and `mode="write"`, the file specified at `path` will be
overwritten if it exists.
include_fields: If specified, only the listed fieldnames will be included when writing
records to file. Fields will be written in the order provided.
May not be used together with `exclude_fields`.
exclude_fields: If specified, any listed fieldnames will be excluded when writing
records to file.
May not be used together with `include_fields`.
Raises:
FileNotFoundError: If the input file does not exist.
Expand Down

0 comments on commit c0cf209

Please sign in to comment.