Python Startkladde Command Line Tool

Python script for command line access to the Startkladde database. The script is a wrapper for several tools. The following tools are currently supported:

Synopsis

usage: sk.py [-h] [-u USER] [-p [PASSWORD]] [-d DATABASE] [-v VERBOSE]
             {import-flights,stats,help,set-pilot-email,create-users} ...
sk.py: error: too few arguments

Program terminated abnormally!
tool

Tool to invoke

Display statistics

usage: sk.py [-h] [-t TIME] [registrations [registrations ...]]

Calculate statistics for a given plane

positional arguments:
  registrations

optional arguments:
  -h, --help
  -t TIME, --time TIME  Single date or date range. Format isYYYY-MM-DD for a
                        single date and <begin>:<end> for a range.

global arguments:
  -h, --help
  -u USER, --user USER  Specify database username and hostname. Format
                        <user>[@<host>]
  -p [PASSWORD], --password [PASSWORD]
                        Specify password. If no argument is provided, user is
                        prompted.
  -d DATABASE, --database DATABASE
                        Specify name of startkladde database
  -v VERBOSE, --verbose VERBOSE
                        verbose mode setting

Allowed commands are:
  import-flights: Import flights into database from csv file(s)
  stats: Calculate statistics for a given plane
  help: Describe the usage of this program or its subcommands
  set-pilot-email: Set email of pilots
Reads the email address of pilots from a html filein RESI format and adds them to the database
  create-users: Creates a user account for each pilot in databaseOne input file containing the message to be sent to each user shallbe provided. To personalise the message, the fields ${first_name}, ${last_name}, ${email}, ${username} and ${password} can be used.


Program terminated successfully!

Set Email Adress for Pilots

usage: sk.py [-h] [-c CLUB] [inputFiles [inputFiles ...]]

Set email of pilots Reads the email address of pilots from a html filein RESI
format and adds them to the database

positional arguments:
  inputFiles

optional arguments:
  -h, --help
  -c CLUB, --club CLUB  Restrict records to pilots belonging to the given club

global arguments:
  -h, --help
  -u USER, --user USER  Specify database username and hostname. Format
                        <user>[@<host>]
  -p [PASSWORD], --password [PASSWORD]
                        Specify password. If no argument is provided, user is
                        prompted.
  -d DATABASE, --database DATABASE
                        Specify name of startkladde database
  -v VERBOSE, --verbose VERBOSE
                        verbose mode setting

Allowed commands are:
  import-flights: Import flights into database from csv file(s)
  stats: Calculate statistics for a given plane
  help: Describe the usage of this program or its subcommands
  set-pilot-email: Set email of pilots
Reads the email address of pilots from a html filein RESI format and adds them to the database
  create-users: Creates a user account for each pilot in databaseOne input file containing the message to be sent to each user shallbe provided. To personalise the message, the fields ${first_name}, ${last_name}, ${email}, ${username} and ${password} can be used.


Program terminated successfully!