10. Ancillary tools

10.1. crate_help

Launches this documentation via your web browser.

10.2. crate_make_demo_database

Options:

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]
                                url

POSITIONAL ARGUMENTS:
  url                   SQLAlchemy database URL. Append ?charset=utf8, e.g.
                        mysql+mysqldb://root:password@127.0.0.1:3306/test?char
                        set=utf8 . WARNING: If you get the error 'MySQL has
                        gone away', increase the max_allowed_packet parameter
                        in my.cnf (e.g. to 32M).

OPTIONS:
  -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:
                        /path/to/test_docs/doctest.doc)
  --doctest_docx DOCTEST_DOCX
                        Test file for .DOCX (default:
                        /path/to/test_docs/doctest.docx)
  --doctest_odt DOCTEST_ODT
                        Test file for .ODT (default:
                        /path/to/test_docs/doctest.odt)
  --doctest_pdf DOCTEST_PDF
                        Test file for .PDF (default:
                        /path/to/test_docs/doctest.pdf)

10.3. crate_test_extract_text

Options:

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

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

OPTIONS:
  -h, --help           show this help message and exit
  --plain              Use plainest format (re e.g. table layouts) (default:
                       False)
  --semiplain          Use semi-plain format (re e.g. table layouts) (default:
                       False)
  --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:
                       False)
  --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

Options:

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

OPTIONS:
  -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:
                        anon)
  --resultsfile RESULTSFILE
                        Results output CSV file name (default:
                        testanon_results.csv)
  --scrubfile SCRUBFILE
                        Scrubbing information text file name (default:
                        testanon_scrubber.txt)
  --verbose, -v         Be verbose (default: False)
  --pkfromsrc           Fetch PKs (document IDs) from source (default)
                        (default: True)
  --pkfromdest          Fetch PKs (document IDs) from destination (default:
                        True)
  --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.