<jupyter_start><jupyter_text>Pulling the centroid photos After taking photos and adding them to my Flickr page, I use this script to pull location information, title, and URL from my photos. From there, I create a .csv of the photo information. Then, using ArcGIS Online, I create a shapefile of the picture locations. Once added to the map, I pull the photos' locations using the URL atribute to present the photograph in the intereactive pop-up window.<jupyter_code>#import the flickrapi library
import flickrapi
#sign up for Flickr access: https://www.flickr.com/services/apps/create/apply/?

api_key = api_key  #enter your API key here. DO NOT SAVE KEY IF STORE PUBLICLY
api_secret = api_secret #enter your API secret here. DO NOT SAVE IF STORED PUBLICLY
user_id = user_idea
#Instantiate Flickr API using your key
flickr = flickrapi.FlickrAPI(api_key, api_secret,format='etree')

#Build a method name for Albums
sets = flickr.photosets.getList(user_id=user_id)
#Determine the possible sets available for use
for set in sets.getchildren()[0]:
    title = set.getchildren()[0].text
    print (("id: %s setname: %s photos: %s") %(set.get('id'), title, set.get('photos')))
#set the set_ID you want from the output above using the title as a guide
set_id = set_id


#Use .walk_set to go through the photos in a set, pull information into a dataframe, and combine each dataframe into a sgin

#create empty list
listing = []

for photo in flickr.walk_set(set_id,extras='geo,url_o'):
    
    #pull items for DataFrame
    id_ = (photo.get('id'))
    title = (photo.get('title'))
    latitude = (photo.get('latitude'))
    longitude = (photo.get('longitude'))
    url_ = (photo.get('url_o'))
    
    #create DataFrame for each photo
    frame = pd.DataFrame({'Neighborhood':title,'latitude':latitude,'longitude':longitude,'URL':url_},index=[id_])
    
    #Append list with new DataFrame
    listing.append(frame)
    
    #Combine each DataFrame into a single frame
    centroid_photos = pd.concat(listing)
#save as .csv
centroid_photos.to_csv('flickr_updated.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09842331581462016, 'fraction_numerical': 0.0009555661729574773, 'mean_word_length': 4.554376657824934, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '265633', 'license': 'MIT', 'n_tokens_mistral': 673, 'n_tokens_neox': 646, 'n_words': 240, 'path': 'Notebooks/pulling the centroid photos from Flickr.ipynb', 'repo_name': 'igotcharts/neighborhood_centroid', 'size': '2093'}