This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
from pynt import task | |
from pyntcontrib import safe_cd, execute | |
MODULE_PATH = os.path.abspath(__file__) | |
PROJECT_ROOT = os.path.dirname(MODULE_PATH) | |
REQUIREMENTS_PATH = os.path.join(PROJECT_ROOT, 'requirements.txt') | |
VENV_PATH = os.path.join(PROJECT_ROOT, 'venv') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Using "requests" to access Google Analytics Realtime Reporting API from python service | |
NOTE on google docs: The realtime reporting docs have samples for google-api-python-client. | |
**They do not work** at the time of this writing. The GA docs sample seems to refer to features that don't actually exist. | |
In any case, the new RR API is restfull and requests is a pleasent library so here is how to use it instead. | |
pip requirements: oauth2client, requests | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AssertionError: '{"body": {"city": "Someplace", "progress_patient_id": "someid", "name": "Pharmacy", "max_record_count": 1, "functions": [], "specialties": [], "ncpdpid": "?", "state_code": "SD", "zip_code": "43333"}, "site_user_id": "somegal", "originated_timestamp": "2013-1-1T00:00:00+05:00", "message_type": "pharmacysearch", "site_id": "SD001", "message_id": "totally_unique_d00d"}' != '{"body": {"city": "Someplace", "functions": [], "specialties": [], "name": "Pharmacy", "progress_patient_id": "someid", "max_record_count": 1, "state_code": "SD", "zip_code": "43333", "ncpdpid": "?"}, "site_user_id": "somegal", "originated_timestamp": "2013-1-1T00:00:00+05:00", "message_type": "pharmacysearch", "site_id": "SD001", "message_id": "totally_unique_d00d"}' |