Olá, Tenho o seguinte dicionário.
datas = {'records': [{'createdTime': '2018-02-20T21:56:20.288Z',
'fields': {'publicacao': '2018-01-22'},
'id': 'rec1c1c8qyIkdwyMD'},
{'createdTime': '2018-02-20T21:56:20.288Z',
'fields': {'publicacao': '2018-01-29'},
'id': 'rec2ZzEckjEvtHeL9'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-10-16'},
'id': 'rec2qlE8kVgjjJC5I'},
{'createdTime': '2018-02-20T22:17:46.301Z',
'fields': {'publicacao': '2018-02-05'},
'id': 'rec3RXluN3xw8MOf1'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-10-23'},
'id': 'rec5H0UvSqLdrGpl5'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-11-20'},
'id': 'rec83xBDXZ8Cne8H7'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-12-22'},
'id': 'recHhm6vB8TrHGy93'},
{'createdTime': '2018-02-20T21:56:20.288Z',
'fields': {'publicacao': '2018-01-15'},
'id': 'recHmVeJ5nkALuryh'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-11-27'},
'id': 'recOajfC1FGtPlmsn'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-11-06'},
'id': 'recUNJhuNDYOJ1eaj'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-11-13'},
'id': 'recWO44hmzjzhcLfm'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-12-19'},
'id': 'recXITnVKRsBPhxCb'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-12-11'},
'id': 'rece5u18FUTlCwnC7'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-12-04'},
'id': 'receT9LqJ8zFbkbVW'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-10-09'},
'id': 'rechssorYxXi8Grdp'},
{'createdTime': '2018-02-20T21:56:50.166Z',
'fields': {'publicacao': '2017-10-30'},
'id': 'recvdSdCxqXz4hbbh'}]}
Queria criar uma lista apenas com a data do fields. Tentei algo assim:
base_de_relatorio = []
for v in datas['records']:
base_de_relatorio.append(v['fields'])
O problema é que dessa forma o nome "publicacao vem junto ({'publicacao': '2018-01-22'}). Preciso apenas de uma lista com todas as datas.
Alguém sabe como resolver?
base_de_relatorio.append(v['fields']['publicacao'])