Save a table - agate 1.13.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# Save a table

## To a CSV

    table.to_csv('filename.csv')

## To JSON

    table.to_json('filename.json')

## To newline-delimited JSON

    table.to_json('filename.json', newline=True)

## To a SQL database

Use the agate-sql extension.

    import agatesql

    table.to_sql('postgresql:///database', 'output_table')