1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
============
Save a table
============
To a CSV
========
.. code-block:: python
table.to_csv('filename.csv')
To JSON
=======
.. code-block:: python
table.to_json('filename.json')
To newline-delimited JSON
=========================
.. code-block:: python
table.to_json('filename.json', newline=True)
To a SQL database
=================
Use the `agate-sql <https://agate-sql.readthedocs.org/>`_ extension.
.. code-block:: python
import agatesql
table.to_sql('postgresql:///database', 'output_table')
|