def metadata(contest: Union[int, str]) -> Dict[str, Union[str, int]]:
"""
Parameters
----------
contest : int, str
Argument to :py:func:`summary`. See :py:func:`summary_ids`.
Returns
-------
info : dict
Dictionary with keys
* ``comic``: A URL to the comi
* ``num_responses``, ``num_captions``: an integer with the number of
responses and captions respectively
* ``funniest_caption``: the funniest caption, as rated by users.
* ``example_query``: an example query. For certain contest
(519, 550, 587 and 588) this key is not present.
"""
c = contest if isinstance(contest, int) else int(contest.split("_")[0])
df = summary(contest)
base = "https://github.com/nextml/caption-contest-data/raw/master/contests/info"
top = df["rank"].idxmin()
d = {
"comic": base + f"/{c}/{c}.jpg",
"num_responses": df["count"].sum(),
"num_captions": len(df["caption"]),
"funniest_caption": df.loc[top, "caption"],
}
if c not in {519, 550, 587, 588}:
d.update({"example_query": base + f"/{c}/example_query.png"})
return d
base url should change to caption-contest-data-api and I think num_responses should also change
in _api.py, there is a function named metadata
base url should change to caption-contest-data-api and I think num_responses should also change