<jupyter_start><jupyter_text>Analytics FeedsThis notebook maintains a list of analytics feeds used in this repository.<jupyter_code>subscriptions = [
    {
        'id': '9db92275-1d89-4d3b-a0b6-68abd2e94142',
        'used_by': ['analytics/02_fetching_feed_results']
    },
    {
        'id': 'cda3398b-1283-4ad9-87a6-e25796b5ca80',
        'used_by': ['analytics/03_visualizing_raster_results']
    },
    {
        'id': '02c4f912-090f-45aa-a18b-ac4a55e4b9ba',
        'used_by': ['analytics-snippets/building_footprints_as_vector']
    },
    {
        'id': 'f184516c-b948-406f-b257-deaa66c3f38a',
        'used_by': ['analytics-snippets/roads_as_vector']
    },
]<jupyter_output><empty_output><jupyter_text>Get feeds from subscription ids<jupyter_code>from pprint import pprint
import os

from planet import api
# if your Planet API Key is not set as an environment variable, you can paste it below
API_KEY = os.environ.get('PL_API_KEY', 'PASTE_YOUR_KEY_HERE')

analytics_client = api.ClientV1(api_key=API_KEY)
def get_sub_info(subscription_id):
    return analytics_client.get_subscription_info(subscription_id).get()

def get_sub_title(subscription_id):
    return get_sub_info(subscription_id)['title']

def get_feed_id(subscription_id):
    return get_sub_info(subscription_id)['feedID']

def get_feed_info(feed_id):
    return analytics_client.get_feed_info(feed_id).get()

def get_feed_title(feed_id):
    return get_feed_info(feed_id)['title']
    

titles = [get_sub_title(s['id']) for s in subscriptions]
print(titles)

feed_ids = [get_feed_id(s['id']) for s in subscriptions]
print(feed_ids)

feed_titles = [get_feed_title(fid) for fid in feed_ids]
print(feed_titles)<jupyter_output>['Port of Oakland, USA', 'Hefei, China', 'Sazgin, Turkey', 'Kirazli, Turkey']
['1b4c9ee2-699b-4621-bb4f-934eda8090b5', '36d9d1b0-dcd4-40bc-b411-5eb8e06062a2', 'b442c53b-fc72-4bee-bab4-0b7aa318ccd9', '36d9d1b0-dcd4-40bc-b411-5eb8e06062a2']
['Ship Detections', 'Roads (v7)', 'Buildings (v7)', 'Roads (v7)']
{'fraction_non_alphanumeric': 0.13073852295409183, 'fraction_numerical': 0.08033932135728543, 'mean_word_length': 5.285266457680251, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '94363', 'license': 'Apache-2.0', 'n_tokens_mistral': 892, 'n_tokens_neox': 823, 'n_words': 127, 'path': 'dev/analytics_feeds.ipynb', 'repo_name': 'mapninja/notebooks', 'size': '2004'}