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. my
                        sql+mysqldb://root:password@127.0.0.1:3306/test?charse
                        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: /home/rudolf/Documents/co
                        de/crate/crate_anon/testdocs_for_text_extraction/docte
                        st.doc)
  --doctest_docx DOCTEST_DOCX
                        Test file for .DOCX (default: /home/rudolf/Documents/c
                        ode/crate/crate_anon/testdocs_for_text_extraction/doct
                        est.docx)
  --doctest_odt DOCTEST_ODT
                        Test file for .ODT (default: /home/rudolf/Documents/co
                        de/crate/crate_anon/testdocs_for_text_extraction/docte
                        st.odt)
  --doctest_pdf DOCTEST_PDF
                        Test file for .PDF (default: /home/rudolf/Documents/co
                        de/crate/crate_anon/testdocs_for_text_extraction/docte
                        st.pdf)

# Generated at 2019-10-10 10:23:20

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

optional arguments:
  -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)

# Generated at 2019-10-10 10:23:23

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

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:
                        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)

# Generated at 2019-10-10 10:23:22

10.5. crate_estimate_mysql_memory_usage

Options:

usage: crate_estimate_mysql_memory_usage [-h] [--mysql MYSQL] [--host HOST]
                                         [--port PORT] [--user USER]

optional arguments:
  -h, --help     show this help message and exit
  --mysql MYSQL  MySQL program (default=mysql)
  --host HOST    MySQL server/host (prefer '127.0.0.1' to 'localhost')
  --port PORT    MySQL port (default=3306)
  --user USER    MySQL user (default=root)

# Generated at 2019-10-10 10:23:19

10.5.1. crate_email_rdbm

E-mails the RDBM.

The command is a shortcut to crate_django_manage email_rdbm.