MCPcopy Create free account
hub / github.com/dbcli/mycli / pypi_api_fetch

Function pypi_api_fetch

mycli/main_modes/checkup.py:14–22  ·  view source on GitHub ↗
(fragment: str)

Source from the content-addressed store, hash-verified

12
13
14def pypi_api_fetch(fragment: str) -> dict:
15 fragment = fragment.lstrip('/')
16 url = f'{PYPI_API_BASE}/{fragment}'
17 try:
18 with urllib.request.urlopen(url, timeout=5) as response:
19 return json.loads(response.read().decode('utf8'))
20 except urllib.error.URLError:
21 print(f'Failed to connect to PyPi on {url}', file=sys.stderr)
22 return {}
23
24
25def _dependencies_checkup() -> None:

Callers 1

_dependencies_checkupFunction · 0.85

Calls 1

readMethod · 0.80

Tested by

no test coverage detected