10. Ancillary tools

10.1. crate_help

Launches this documentation via your web browser.

10.2. crate_make_demo_database


usage: crate_make_demo_database [-h] [--size {0,1,2,3}] [--verbose] [--echo]
                                [--doctest_doc DOCTEST_DOC]
                                [--doctest_docx DOCTEST_DOCX]
                                [--doctest_odt DOCTEST_ODT]
                                [--doctest_pdf DOCTEST_PDF]

positional arguments:
  url                   SQLAlchemy database URL. Append ?charset=utf8, e.g. my
                        t=utf8 . WARNING: If you get the error 'MySQL has gone
                        away', increase the max_allowed_packet parameter in
                        my.cnf (e.g. to 32M).

optional arguments:
  -h, --help            show this help message and exit
  --size {0,1,2,3}      Make tiny (0), small (1), medium (2), or large (3)
                        database (default: 0)
  --verbose, -v         Be verbose (default: False)
  --echo                Echo SQL (default: False)
  --doctest_doc DOCTEST_DOC
                        Test file for .DOC (default:
  --doctest_docx DOCTEST_DOCX
                        Test file for .DOCX (default:
  --doctest_odt DOCTEST_ODT
                        Test file for .ODT (default:
  --doctest_pdf DOCTEST_PDF
                        Test file for .PDF (default:

10.3. crate_test_extract_text


usage: crate_test_extract_text [-h] [--plain] [--semiplain] [--width WIDTH]
                               [--rstrip] [--silent] [--outfile OUTFILE]
                               [--encoding ENCODING] [--verbose]

Test CRATE text extraction and/or detect text in files.

Exit codes:
- 0 for "text found"
- 1 for "no text found"
- 2 for "error" (e.g. file not found)

positional arguments:
  filename             File from which to extract text

optional arguments:
  -h, --help           show this help message and exit
  --plain              Use plainest format (re e.g. table layouts) (default:
  --semiplain          Use semi-plain format (re e.g. table layouts) (default:
  --width WIDTH        Width to word-wrap to (default: 80)
  --rstrip             Right-strip all lines (default: False)
  --silent             Don't print the text, just exit with a code (default:
  --outfile OUTFILE    Filename to which to write (rather than stdout)
                       (default: None)
  --encoding ENCODING  Encoding used for --outfile (default: utf-8)
  --verbose            Be verbose (default: False)

10.4. crate_test_anonymisation


usage: crate_test_anonymisation [-h] --config CONFIG --dsttable DSTTABLE
                                --dstfield DSTFIELD [--limit LIMIT]
                                [--rawdir RAWDIR] [--anondir ANONDIR]
                                [--resultsfile RESULTSFILE]
                                [--scrubfile SCRUBFILE] [--verbose]
                                [--pkfromsrc | --pkfromdest]
                                [--uniquepatients | --nonuniquepatients]

Test anonymisation

optional arguments:
  -h, --help            show this help message and exit
  --config CONFIG       Configuration file name (input) (default: None)
  --dsttable DSTTABLE   Destination table (default: None)
  --dstfield DSTFIELD   Destination column (default: None)
  --limit LIMIT         Limit on number of documents (default: 100)
  --rawdir RAWDIR       Directory for raw output text files (default: raw)
  --anondir ANONDIR     Directory for anonymised output text files (default:
  --resultsfile RESULTSFILE
                        Results output CSV file name (default:
  --scrubfile SCRUBFILE
                        Scrubbing information text file name (default:
  --verbose, -v         Be verbose (default: False)
  --pkfromsrc           Fetch PKs (document IDs) from source (default)
                        (default: True)
  --pkfromdest          Fetch PKs (document IDs) from destination (default:
  --uniquepatients      Only one document per patient (the first by PK)
                        (default) (default: True)
  --nonuniquepatients   Documents in sequence, with potentially >1
                        document/patient (default: True)

10.5. crate_email_rdbm

E-mails the RDBM.

The command is a shortcut to crate_django_manage email_rdbm.