From 1cc5af2d40810c3ecdbcf0a4ea65e445dd7c9c56 Mon Sep 17 00:00:00 2001 From: Michael Bargury <11074433+mbrg@users.noreply.github.com> Date: Sat, 1 Jan 2022 07:31:33 +0200 Subject: [PATCH] chore: Python syntax highlighting A tiny edit to add syntax highlighting for Python in the main readme --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 89c1522..2f29f01 100644 --- a/README.md +++ b/README.md @@ -77,33 +77,33 @@ Pypi: ### API Usage - - from dbcat.api import open_catalog, add_postgresql_source - from piicatcher.api import scan_database - - # PIICatcher uses a catalog to store its state. - # The easiest option is to use a sqlite memory database. - # For production usage check, https://tokern.io/docs/data-catalog - catalog = open_catalog(app_dir='/tmp/.config/piicatcher', path=':memory:', secret='my_secret') - - with catalog.managed_session: - # Add a postgresql source - source = add_postgresql_source(catalog=catalog, name="pg_db", uri="127.0.0.1", username="piiuser", - password="p11secret", database="piidb") - output = scan_database(catalog=catalog, source=source) - - print(output) - - # Example Output - [['public', 'sample', 'gender', 'PiiTypes.GENDER'], - ['public', 'sample', 'maiden_name', 'PiiTypes.PERSON'], - ['public', 'sample', 'lname', 'PiiTypes.PERSON'], - ['public', 'sample', 'fname', 'PiiTypes.PERSON'], - ['public', 'sample', 'address', 'PiiTypes.ADDRESS'], - ['public', 'sample', 'city', 'PiiTypes.ADDRESS'], - ['public', 'sample', 'state', 'PiiTypes.ADDRESS'], - ['public', 'sample', 'email', 'PiiTypes.EMAIL']] - +```python3 +from dbcat.api import open_catalog, add_postgresql_source +from piicatcher.api import scan_database + +# PIICatcher uses a catalog to store its state. +# The easiest option is to use a sqlite memory database. +# For production usage check, https://tokern.io/docs/data-catalog +catalog = open_catalog(app_dir='/tmp/.config/piicatcher', path=':memory:', secret='my_secret') + +with catalog.managed_session: + # Add a postgresql source + source = add_postgresql_source(catalog=catalog, name="pg_db", uri="127.0.0.1", username="piiuser", + password="p11secret", database="piidb") + output = scan_database(catalog=catalog, source=source) + +print(output) + +# Example Output +[['public', 'sample', 'gender', 'PiiTypes.GENDER'], + ['public', 'sample', 'maiden_name', 'PiiTypes.PERSON'], + ['public', 'sample', 'lname', 'PiiTypes.PERSON'], + ['public', 'sample', 'fname', 'PiiTypes.PERSON'], + ['public', 'sample', 'address', 'PiiTypes.ADDRESS'], + ['public', 'sample', 'city', 'PiiTypes.ADDRESS'], + ['public', 'sample', 'state', 'PiiTypes.ADDRESS'], + ['public', 'sample', 'email', 'PiiTypes.EMAIL']] +``` ## Plugins