Все программы и ос храниться на hdd
import csv, io, json
data = '''X Y
1 1
2 2
3 3
4 4
5 5'''
f = io.StringIO(data)
reader = csv.DictReader(f, delimiter=' ')
json.dumps(list(reader))
# '[{"X": "1", "Y": "1"}, {"X": "2", "Y": "2"}, {"X": "3", "Y": "3"}, {"X": "4", "Y": "4"}, {"X": "5", "Y": "5"}]'
import requests
r = requests.get("http://search.maps.sputnik.ru/search/addr?format=json&lat&q=Песочная+аллея,+дом+1")
print(r.json()['result']['address'][0]['features'][0]['geometry']['geometries'][0]['coordinates'])
# [37.674698, 55.79341]
coordinates = []
def search_key(data, key):
if isinstance(data, list):
for x in data:
search_key(x, key)
if isinstance(data, dict):
for x in data.keys():
if x == key:
coordinates.append(data[x])
else:
search_key(data[x], key)
search_key(r.json(), 'coordinates')
print(coordinates)
# [[37.674698, 55.79341]]
data1 = {'key': '1', 'phone': '2'}
data2 = {'key': '3', 'telephone': '4'}
data3 = {'key': '5', 'telePhone': '6'}
data4 = {'key': '7', 'PHONE': '8'}
data5 = {'key': '9', 'Телефон': '10'}
PATTERNS = ['phone', 'телефон'] # тут перечислить подстроки
getphone = lambda data:next(filter(lambda x: any([y in x.lower() for y in PATTERNS]), data.keys()))
print(data1[getphone(data1)])
print(data2[getphone(data2)])
print(data3[getphone(data3)])
print(data4[getphone(data4)])
print(data5[getphone(data5)])
# 2
# 4
# 6
# 8
# 10