datasette-mask-columns by simonw

70 downloads this week        Star

README source code


PyPI Changelog Tests License

Datasette plugin that masks specified database columns


pip install datasette-mask-columns

This depends on plugin hook changes in a not-yet released branch of Datasette. See issue #678 for details.


In your metadata.json file add a section like this describing the database and table in which you wish to mask columns:

    "databases": {
        "my-database": {
            "plugins": {
                "datasette-mask-columns": {
                    "users": ["password"]

All SQL queries against the users table in my-database.db will now return null for the password column, no matter what value that column actually holds.

The table page for users will display the text REDACTED in the masked column. This visual hint will only be available on the table page; it will not display his text for arbitrary queries against the table.