From 49f3e1f098717c3bac3146ff42aa0760454cf347 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 9 Nov 2018 00:32:30 -0600 Subject: [PATCH] Better way of storing passwords/keys --- .gitignore | 3 ++- ctabus.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8efb089..68a6255 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ __pycache__ *_out.json *.pdf *.bat -stderr.log \ No newline at end of file +stderr.log +sensitive.py \ No newline at end of file diff --git a/ctabus.py b/ctabus.py index 1e2b88b..e1de5c9 100644 --- a/ctabus.py +++ b/ctabus.py @@ -2,9 +2,7 @@ from urllib.parse import urlencode from urllib.request import urlopen import json import os.path as osp -with open(osp.join(osp.dirname(__file__),'cta_api_key')) as file: - api = file.read() - +from sensitive import api def get_data(type,api_key = api,**args): base_url = "http://www.ctabustracker.com/bustime/api/v2/{type}?{query}" args['key'] = api_key