feat: add wutta import-csv command

This commit is contained in:
Lance Edgar 2024-12-05 21:19:06 -06:00
parent 84a8beaf46
commit f43a066341
19 changed files with 500 additions and 15 deletions

View file

@ -0,0 +1,6 @@
``wuttasync.cli.base``
======================
.. automodule:: wuttasync.cli.base
:members:

View file

@ -0,0 +1,6 @@
``wuttasync.cli.import_csv``
============================
.. automodule:: wuttasync.cli.import_csv
:members:

View file

@ -0,0 +1,6 @@
``wuttasync.cli``
=================
.. automodule:: wuttasync.cli
:members:

View file

@ -22,6 +22,7 @@ extensions = [
'sphinx.ext.viewcode',
'sphinx.ext.todo',
'enum_tools.autoenum',
'sphinxcontrib.programoutput',
]
templates_path = ['_templates']

View file

@ -5,6 +5,15 @@ WuttaSync
This package adds data import/export and real-time sync utilities for
the `Wutta Framework <https://wuttaproject.org>`_.
The primary use cases here are:
* keep "operational" data in sync between e.g. various business systems
* import data from user-specified file
* export to file
This isn't really meant to replace typical ETL tools; it is smaller
scale and (hopefully) more flexible.
While it of course supports import/export to/from the Wutta :term:`app
database`, it may be used for any "source → target" data flow.
@ -14,12 +23,16 @@ database`, it may be used for any "source → target" data flow.
:caption: Documentation
narr/install
narr/cli
.. toctree::
:maxdepth: 1
:caption: API
api/wuttasync
api/wuttasync.cli
api/wuttasync.cli.base
api/wuttasync.cli.import_csv
api/wuttasync.importing
api/wuttasync.importing.base
api/wuttasync.importing.csv

25
docs/narr/cli.rst Normal file
View file

@ -0,0 +1,25 @@
Built-in Commands
=================
WuttaSync adds some built-in ``wutta`` :term:`subcommands <subcommand>`.
See also :doc:`wuttjamaican:narr/cli/index`.
.. _wutta-import-csv:
``wutta import-csv``
--------------------
Import data from CSV file(s) to the Wutta :term:`app database`.
This *should* be able to automatically target any table mapped in the
:term:`app model`. The only caveat is that it is "dumb" and does not
have any special field handling. This means the column headers in the
CSV file must be named the same as in the target table, and some data
types may not behave as expected etc.
Defined in: :mod:`wuttasync.cli.import_csv`
.. program-output:: wutta import-csv --help