Built-in Commands

Below are the subcommands which come with WuttaSync.

It is fairly simple to add more; see Custom Commands.

wutta import-csv

Import data from CSV file(s) to the Wutta app database.

This should be able to automatically target any table mapped in the 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: wuttasync.cli.import_csv

                                                                                
 Usage: wutta import-csv [OPTIONS] [MODELS]...                                  
                                                                                
 Import data from CSV file(s) to Wutta DB                                       
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│   models      [MODELS]...  Model(s) to process.  Can specify one or more, or │
│                            omit to process default models.                   │
│                            [default: None]                                   │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --list-models  -l                          List available target models and  │
│                                            exit.                             │
│ --create           --no-create             Allow new target records to be    │
│                                            created.  See aso --max-create.   │
│                                            [default: create]                 │
│ --update           --no-update             Allow existing target records to  │
│                                            be updated.  See also             │
│                                            --max-update.                     │
│                                            [default: update]                 │
│ --delete           --no-delete             Allow existing target records to  │
│                                            be deleted.  See also             │
│                                            --max-delete.                     │
│                                            [default: no-delete]              │
│ --fields                          TEXT     List of fields to process.  See   │
│                                            also --exclude and --key.         │
│                                            [default: None]                   │
│ --exclude                         TEXT     List of fields *not* to process.  │
│                                            See also --fields.                │
│                                            [default: None]                   │
│ --key,--keys                      TEXT     List of fields to use as record   │
│                                            key/identifier.  See also         │
│                                            --fields.                         │
│                                            [default: None]                   │
│ --max-create                      INTEGER  Max number of target records to   │
│                                            create (per model).  See also     │
│                                            --create.                         │
│                                            [default: None]                   │
│ --max-update                      INTEGER  Max number of target records to   │
│                                            update (per model).  See also     │
│                                            --update.                         │
│                                            [default: None]                   │
│ --max-delete                      INTEGER  Max number of target records to   │
│                                            delete (per model).  See also     │
│                                            --delete.                         │
│                                            [default: None]                   │
│ --max-total                       INTEGER  Max number of *any* target record │
│                                            changes which may occur (per      │
│                                            model).                           │
│                                            [default: None]                   │
│ --dry-run                                  Go through the motions, but       │
│                                            rollback the transaction.         │
│ --input-path                      PATH     Path to input file(s).  Can be a  │
│                                            folder if app logic can guess the │
│                                            filename(s); otherwise must be    │
│                                            complete file path.               │
│                                            [default: None]                   │
│ --help                                     Show this message and exit.       │
╰──────────────────────────────────────────────────────────────────────────────╯