Skip to content

CSV

Parameters

Required parameters are in red and Optional parameters are in blue.


  • directory, the folder location to write CSV files to

  • delimiter, a one-character string used to separate fields
    default: |

  • escape_character, a one-character string used to escape the delimiter
    default: \\ ( if the escape character is itself, it must be escaped as well )

  • empty_as_null, whether or not to convert empty strings to the None sentinel
    default: false ( allowed: true, false )

  • quoting, how to quote individual cell values
    default: MINIMAL ( allowed: ALL, MINIMAL )

  • date_time_format, the string representation of date times
    default: %Y-%m-%d %H:%M:%S ( use the strftime.org cheatsheet as a guide )

  • header, whether or not to write the column headers as the first row
    default: true ( allowed: true, false )

  • save_strategy, how to save new data into an existing directory
    default: OVERWRITE ( allowed: APPEND, OVERWRITE )
How do I use the Syncer in commands?

CS Tools accepts syncer definitions in either declarative or configuration file form.

Find the copy button to the right of the code block.

Simply write the parameters out alongside the command.

cs_tools tools searchable metadata --syncer "csv://directory=.&delimiter=|" --config dogfood

* when declaring multiple parameters inline, you should wrap the enter value in quotes.

  1. Create a file with the .toml extension.

    syncer-overwrite.toml

    [configuration]
    directory = "."
    delimiter = "|"
    escape_character = "\\"
    empty_as_null = true
    quoting = "ALL"
    date_time_format = "%Y-%m-%dT%H:%M:%S%z"
    header = false
    save_strategy = "APPEND"
    
    * this is a complete example, not all parameters are required.

  2. Write the filename in your command in place of the parameters.

    cs_tools tools searchable metadata --syncer csv://syncer-overwrite.toml --config dogfood