I am trying to save an environment variable that Python can read as a dictionary. If this is a bad idea, please let me know your suggestions, I really want to study. I worry that if I store data as many environment variables, it can become difficult to handle.
I programmed Raspberry Pi to unlock a door based on caller ID of incoming phone calls to Twilio number, it works fine. I want to share my code on Github for feedback, but I don't want to share the list of phone numbers with the world, so I'm trying to save it as an environment variable, and then let Python read it.
Phone numbers are in the Python dictionary like this.
building_admins = { "+27792955555": "De Wet", "+27722855555": "Marysol", "+27878085555": "Blomerus", }
I try to save it as an environment variable, as on Ubuntu 14.04
export BUILDING_ADMINS='{ "+27792955555": "De Wet", "+27722855555": "Marysol", "+27878085555": "Blomerus", }'
1) I can not get Linux to save the environment variable, is there something I could do to make it work?
2) I feel that there should be a better way to do this, and I am going in the wrong direction, but nothing that I seem to have found on Google is a solution to the problem I am facing. Please point me in the right direction.
dewet source share