How do I keep a json file private without having to by the premium plan.
I'm new here to repl.it and I have been coding in python for a bit. I'm trying to connect my python code with my google API and spreadsheets but I also have a JSON file I need to use for that. I'm pretty sure I have to keep that private but I'm not sure how. Please help this is putting a stop to something I've been working on for a long time.
I've also tried to use google spreadsheets on repl. Sadly there is no way to conceal a JSON file. What you could do is find some components of the JSON file that you could put in a .env for later use. Another way to do it is obfuscation, which means you could encrypt it (https://qvault.io/2020/02/06/aes-256-cipher-python-cryptography-examples/) and store the encryption in a .env file. Then you can decrypt it when you need to use it. Any methods using a .env cannot be used by other people unless they are in a multiplayer.
You can use first turn the json into one line, and then paste it into a key, like this:
then when you access it, all you have to do is:
import json import os print(json.loads(os.getenv("KEY")))