The following EXIF tags are required:
-GPSLongitude
-GPSLatitude
-(GPSDateStamp and GPSTimeStamp) or DateTimeOriginal or DateTimeDigitized or DateTime
-Orientation

(assumes Python 2.x, for Python 3.x you need to change some module names)
'''

if __name__ == '__main__':
    '''
    Use from command line as: python add_mapillary_tag_from_exif.py root_path [sequence_uuid]
    '''

    # Fetch authentication info from env
    info = get_authentication_info()
    if info is not None:
        MAPILLARY_USERNAME, MAPILLARY_EMAIL, MAPILLARY_PASSWORD = info
    else:
        print("You are missing one of the environment variables MAPILLARY_USERNAME, MAPILLARY_EMAIL or MAPILLARY_PASSWORD. These are required.")
        sys.exit()

    upload_token = get_upload_token(MAPILLARY_EMAIL, MAPILLARY_PASSWORD)

    args = sys.argv

    if len(args) < 2 or len(args) > 3:
        sys.exit("Usage: python %s root_path [sequence_id]" % args[0])

    path = args[1]
    return p.parse_args()

if __name__ == '__main__':
    '''
    Use from command line as: python add_mapillary_tag_from_json.py image_path --json_path [json_path] --project [project]
    '''

    args = get_args()
    project_key = args.project
    image_path = args.file_path
    json_path = args.json_path if args.json_path is not None else os.path.join(image_path, "mapillary_tag.json")
    output_path = args.output_path

    if not args.skip_authentication:
        # Fetch authentication info from env
        info = get_authentication_info()
        if info is not None:
            MAPILLARY_USERNAME, MAPILLARY_EMAIL, MAPILLARY_PASSWORD = info
        else:
            print("You are missing one of the environment variables MAPILLARY_USERNAME, MAPILLARY_EMAIL or MAPILLARY_PASSWORD. These are required.")
            sys.exit()

        upload_token = get_upload_token(MAPILLARY_EMAIL, MAPILLARY_PASSWORD)
        project_key = get_project_key(project_key)
    else:
        MAPILLARY_USERNAME, MAPILLARY_EMAIL, MAPILLARY_PASSWORD = None, None, None
        upload_token = None

    with open(json_path, "rb") as f:
        metadata = json.loads(f.read())