As you've figured out, you need to access the members of the return value of boxplot.
Namely, e.g. if your return value is stored in bp
bp['medians'][0].get_ydata()
>> array([ 2.5, 2.5])
As the boxplot is vertical, and the median line is therefore a horizontal line, you only need to focus on one of the y-values; i.e. the median is 2.5 for my sample data.
For each "key" in the dictionary, the value will be a list to handle for multiple boxes. If you have just one boxplot, the list will only have one element, hence my use of bp['medians']
[0] above.
If you have multiple boxes in your boxplot, you will need to iterate over them using e.g.
for medline in bp['medians']:
linedata = medline.get_ydata()
median = linedata[0]
CT Zhu's answer doesn't work unfortunately, as the different elements behave differently. Also e.g. there's only one median, but two whiskers...therefore it's safest to manually treat each quantity as outlined above.
NB the closest you can come is the following;
res = {}
for key, value in bp.items():
res[key] = [v.get_data() for v in value]
or equivalently
res = {key : [v.get_data() for v in value] for key, value in bp.items()}