Quickly search the GDPR for keywords.
The GDPR is a pretty new piece of legislation, and merits dipping in and out of. Not only that, but (for better or worse) a lot of the interpretation can be found in the recitals.
The script lets you quickly dip in to the GDPR and pull out all the articles and recitals containing a search term of your choice. Finally, it prompts you to generate a report which will be saved and opened for printing / reference.
- Write a python script to search the GDPR
- Run the script and enter the search term
- Generate a report for printing / saving if desired
1. Write the script
This step is as simple as pasting the code below into a new python file.
Make a new file called gdprsearch.py. In the terminal you can quickly create it with:
$ touch gdprsearch.py
Once the file is open in your text editor, enter the following program:
2. Run the script and enter search term
We've got our script, and now it is time to run it.
Open your terminal, and go to the directory you saved gdprsearch.py in (your text reports will also be saved here). Use the "cd" command to change directories, for example, if I saved this in a folder named "gdprfolder" in my home directory, I could access it from anywhere with:
$ cd ~/gdprfolder
Check the script is indeed in your current director by entering
ls -l and ensuring the filename is listed there.
Now run the script by entering the following:
$ python3 gdprsearch.py
If you entered the script correctly, you should see it prompt you for a search term (or enter 'q' to quit). Enter your search term, and hit return.
You should see the results printed out in your terminal, followed by another prompt.
3. Generate report
It's not always useful to have the text in a terminal, so let's generate a file with the results of the search.
In the prompt, enter 'y' to generate a report (anything else skips the step and goes back to the start of the program).
A report should open up automatically in your default application (usually a text editor or browser).
Save this or print it in the usual way!
Once you've closed the file, the program will start again.