数年前に通信制大学の授業でつくったデータ可視化スクリプト
昨年まで、通信制大学に通ってました、
8年かかったけど、無事に美術大学を卒業できました。
アイキャッチ画像は事業で作った作品です。
作品コンセプト_B162046石一智-1
ちなみに、卒論は、”「近現代の西洋絵画に見る自然科学者像」—科学の専門化・産業化を背景として—” でした。
アイキャッチ画像のスクリプトは以下です。
import json
import urllib3
import requests
import pandas as pd
api_key=”your key”
import requests
import json
#北海道
req1 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=1”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data1 = json.loads(req1._content.decode(‘UTF-8’))
print(json.dumps(data1, ensure_ascii=False, indent=2))
with open(‘mydata.json1′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data1, f, ensure_ascii=False, indent=2)
#青森
req2 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=2”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data2 = json.loads(req2._content.decode(‘UTF-8’))
print(json.dumps(data2, ensure_ascii=False, indent=2))
with open(‘mydata.json2′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data2, f, ensure_ascii=False, indent=2)
#岩手
req3 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=3”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data3 = json.loads(req3._content.decode(‘UTF-8’))
print(json.dumps(data3, ensure_ascii=False, indent=2))
with open(‘mydata.json3′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data3, f, ensure_ascii=False, indent=2)
#宮城
req4 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=4”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data4 = json.loads(req4._content.decode(‘UTF-8’))
print(json.dumps(data4, ensure_ascii=False, indent=2))
with open(‘mydata.json4′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data4, f, ensure_ascii=False, indent=2)
#秋田
req5 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=5”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data5 = json.loads(req5._content.decode(‘UTF-8’))
print(json.dumps(data5, ensure_ascii=False, indent=2))
with open(‘mydata.json5′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data5, f, ensure_ascii=False, indent=2)
#山形
req6 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=6”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data6 = json.loads(req6._content.decode(‘UTF-8’))
print(json.dumps(data6, ensure_ascii=False, indent=2))
with open(‘mydata.json6′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data6, f, ensure_ascii=False, indent=2)
#福島
req7 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=7”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data7= json.loads(req7._content.decode(‘UTF-8’))
print(json.dumps(data7, ensure_ascii=False, indent=2))
with open(‘mydata.json7′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data7, f, ensure_ascii=False, indent=2)
#茨城
req8= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=8”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data8= json.loads(req8._content.decode(‘UTF-8’))
print(json.dumps(data8, ensure_ascii=False, indent=2))
with open(‘mydata.json8′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data8, f, ensure_ascii=False, indent=2)
#栃木
req9= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=9”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data9= json.loads(req9._content.decode(‘UTF-8’))
print(json.dumps(data9, ensure_ascii=False, indent=2))
with open(‘mydata.json9′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data9, f, ensure_ascii=False, indent=2)
#群馬
req10= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=10”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data10= json.loads(req10._content.decode(‘UTF-8’))
print(json.dumps(data10, ensure_ascii=False, indent=2))
with open(‘mydata.json10′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data10, f, ensure_ascii=False, indent=2)
#埼玉
req11= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=11”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data11= json.loads(req11._content.decode(‘UTF-8’))
print(json.dumps(data11, ensure_ascii=False, indent=2))
with open(‘mydata.json11′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data11, f, ensure_ascii=False, indent=2)
#千葉
req12= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=12”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data12= json.loads(req12._content.decode(‘UTF-8’))
print(json.dumps(data12, ensure_ascii=False, indent=2))
with open(‘mydata.json12′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data12, f, ensure_ascii=False, indent=2)
#東京都
req13= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=13”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data13= json.loads(req13._content.decode(‘UTF-8’))
print(json.dumps(data13, ensure_ascii=False, indent=2))
with open(‘mydata.json13′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data13, f, ensure_ascii=False, indent=2)
#神奈川
req14= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=14”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data14= json.loads(req14._content.decode(‘UTF-8’))
print(json.dumps(data14, ensure_ascii=False, indent=2))
with open(‘mydata.json14′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data14, f, ensure_ascii=False, indent=2)
#新潟
req15= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=15”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data15= json.loads(req15._content.decode(‘UTF-8’))
print(json.dumps(data15, ensure_ascii=False, indent=2))
with open(‘mydata.json15′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data15, f, ensure_ascii=False, indent=2)
#富山
req16= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=16”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data16= json.loads(req16._content.decode(‘UTF-8’))
print(json.dumps(data16, ensure_ascii=False, indent=2))
with open(‘mydata.json16′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data16, f, ensure_ascii=False, indent=2)
#石川
req17= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=17”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data17= json.loads(req17._content.decode(‘UTF-8’))
print(json.dumps(data17, ensure_ascii=False, indent=2))
with open(‘mydata.json17′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data17, f, ensure_ascii=False, indent=2)
#福井
req18= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=18”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data18= json.loads(req18._content.decode(‘UTF-8’))
print(json.dumps(data18, ensure_ascii=False, indent=2))
with open(‘mydata.json18′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data18, f, ensure_ascii=False, indent=2)
#山梨
req19= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=19”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data19= json.loads(req19._content.decode(‘UTF-8’))
print(json.dumps(data19, ensure_ascii=False, indent=2))
with open(‘mydata.json19′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data19, f, ensure_ascii=False, indent=2)
#長野
req20= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=20”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data20= json.loads(req20._content.decode(‘UTF-8’))
print(json.dumps(data20, ensure_ascii=False, indent=2))
with open(‘mydata.json20′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data20, f, ensure_ascii=False, indent=2)
#岐阜
req21= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=21”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data21= json.loads(req21._content.decode(‘UTF-8’))
print(json.dumps(data21, ensure_ascii=False, indent=2))
with open(‘mydata.json21′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data21, f, ensure_ascii=False, indent=2)
#静岡
req22= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=22”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data22= json.loads(req22._content.decode(‘UTF-8’))
print(json.dumps(data22, ensure_ascii=False, indent=2))
with open(‘mydata.json22′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data22, f, ensure_ascii=False, indent=2)
#愛知
req23 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=23”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data23= json.loads(req23._content.decode(‘UTF-8’))
print(json.dumps(data23, ensure_ascii=False, indent=2))
with open(‘mydata.json23′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data23, f, ensure_ascii=False, indent=2)
#三重
req24= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=24”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data24= json.loads(req24._content.decode(‘UTF-8’))
print(json.dumps(data24, ensure_ascii=False, indent=2))
with open(‘mydata.json24′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data24, f, ensure_ascii=False, indent=2)
#滋賀
req25 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=25”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data25= json.loads(req25._content.decode(‘UTF-8’))
print(json.dumps(data25, ensure_ascii=False, indent=2))
with open(‘mydata.json25′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data25, f, ensure_ascii=False, indent=2)
#京都
req26= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=26”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data26= json.loads(req26._content.decode(‘UTF-8’))
print(json.dumps(data26, ensure_ascii=False, indent=2))
with open(‘mydata.json26′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data26, f, ensure_ascii=False, indent=2)
#大阪
req27= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=27”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data27= json.loads(req27._content.decode(‘UTF-8’))
print(json.dumps(data27, ensure_ascii=False, indent=2))
with open(‘mydata.json27′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data27, f, ensure_ascii=False, indent=2)
#兵庫
req28= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=28”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data28= json.loads(req28._content.decode(‘UTF-8’))
print(json.dumps(data28, ensure_ascii=False, indent=2))
with open(‘mydata.json28′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data28, f, ensure_ascii=False, indent=2)
#奈良
req29 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=29”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data29= json.loads(req29._content.decode(‘UTF-8’))
print(json.dumps(data29, ensure_ascii=False, indent=2))
with open(‘mydata.json29′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data29, f, ensure_ascii=False, indent=2)
#和歌山
req30 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=30”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data30= json.loads(req30._content.decode(‘UTF-8’))
print(json.dumps(data30, ensure_ascii=False, indent=2))
with open(‘mydata.json30′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data30, f, ensure_ascii=False, indent=2)
#鳥取
req31 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=31”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data31= json.loads(req31._content.decode(‘UTF-8’))
print(json.dumps(data31, ensure_ascii=False, indent=2))
with open(‘mydata.json31′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data31, f, ensure_ascii=False, indent=2)
#島根
req32 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=32”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data32= json.loads(req32._content.decode(‘UTF-8’))
print(json.dumps(data32, ensure_ascii=False, indent=2))
with open(‘mydata.json32′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data32, f, ensure_ascii=False, indent=2)
#岡山
req33 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=33”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data33= json.loads(req33._content.decode(‘UTF-8’))
print(json.dumps(data33, ensure_ascii=False, indent=2))
with open(‘mydata.json33′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data33, f, ensure_ascii=False, indent=2)
#広島
req34 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=34”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data34= json.loads(req34._content.decode(‘UTF-8’))
print(json.dumps(data34, ensure_ascii=False, indent=2))
with open(‘mydata.json34′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data34, f, ensure_ascii=False, indent=2)
#山口
req35 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=35”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data35= json.loads(req35._content.decode(‘UTF-8’))
print(json.dumps(data35, ensure_ascii=False, indent=2))
with open(‘mydata.json35′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data35, f, ensure_ascii=False, indent=2)
#徳島
req36 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=36”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data36= json.loads(req36._content.decode(‘UTF-8’))
print(json.dumps(data36, ensure_ascii=False, indent=2))
with open(‘mydata.json36′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data36, f, ensure_ascii=False, indent=2)
#香川
req37 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=37”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data37= json.loads(req37._content.decode(‘UTF-8’))
print(json.dumps(data37, ensure_ascii=False, indent=2))
with open(‘mydata.json37′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data37, f, ensure_ascii=False, indent=2)
#愛媛
req38 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=38”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data38= json.loads(req38._content.decode(‘UTF-8’))
print(json.dumps(data38, ensure_ascii=False, indent=2))
with open(‘mydata.json38′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data38, f, ensure_ascii=False, indent=2)
#高知
req39= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=39”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data39= json.loads(req39._content.decode(‘UTF-8’))
print(json.dumps(data39, ensure_ascii=False, indent=2))
with open(‘mydata.json39′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data39, f, ensure_ascii=False, indent=2)
#福岡
req40 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=40”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data40= json.loads(req40._content.decode(‘UTF-8’))
print(json.dumps(data40, ensure_ascii=False, indent=2))
with open(‘mydata.json40′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data40, f, ensure_ascii=False, indent=2)
#佐賀
req41 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=41”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data41= json.loads(req41._content.decode(‘UTF-8’))
print(json.dumps(data41, ensure_ascii=False, indent=2))
with open(‘mydata.json41′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data41, f, ensure_ascii=False, indent=2)
#長崎
req42 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=42”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data42= json.loads(req42._content.decode(‘UTF-8’))
print(json.dumps(data42, ensure_ascii=False, indent=2))
with open(‘mydata.json42′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data42, f, ensure_ascii=False, indent=2)
#熊本
req43= requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=43”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data43= json.loads(req43._content.decode(‘UTF-8’))
print(json.dumps(data43, ensure_ascii=False, indent=2))
with open(‘mydata.json43′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data43, f, ensure_ascii=False, indent=2)
#大分
req44 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=44”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data44= json.loads(req44._content.decode(‘UTF-8’))
print(json.dumps(data44, ensure_ascii=False, indent=2))
with open(‘mydata.json44′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data44, f, ensure_ascii=False, indent=2)
#宮崎
req45 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=45”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data45= json.loads(req45._content.decode(‘UTF-8’))
print(json.dumps(data45, ensure_ascii=False, indent=2))
with open(‘mydata.json45′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data45, f, ensure_ascii=False, indent=2)
#鹿児島
req46 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=46”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data46= json.loads(req46._content.decode(‘UTF-8’))
print(json.dumps(data46, ensure_ascii=False, indent=2))
with open(‘mydata.json46′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data46, f, ensure_ascii=False, indent=2)
#沖縄
req47 = requests.get(
“https://opendata.resas-portal.go.jp/api/v1/forestry/income/forStacked?cityCode?&prefCode=47”,
headers={
“Content-Type”: “application/json”,
“X-API-KEY”: api_key
}
)
data47= json.loads(req47._content.decode(‘UTF-8’))
print(json.dumps(data47, ensure_ascii=False, indent=2))
with open(‘mydata.json47′, mode=’wt’, encoding=’utf-8′) as f:
json.dump(data47, f, ensure_ascii=False, indent=2)