You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The website napari-hub.org has an API which can be used to list all napari plugins, e.g. like this:
def get_all_plugin_data():
url = 'https://api.napari-hub.org/plugins/index'
json_url = urllib.request.urlopen(url)
data = json.loads(json_url.read())
return data
def get_plugin_index():
data = get_all_plugin_data()
return list([x['name'] for x in data])
all_plugins = get_plugin_index()`
Furthermore, it should be possible to determine the corresponding github repository urls from these plugins, preferably using the pypi API (all napari plugins are on pypi).
git-bob think about code to list urls of github repositories of all napari plugins.
The text was updated successfully, but these errors were encountered:
This message was generated by git-bob (version: 0.14.0, model: github_models:gpt-4o, log), an experimental AI-based assistant. It can make mistakes and has limitations. Check its messages carefully.
To list GitHub repository URLs for all Napari plugins, you can extend the existing code. Here's a proposal:
importurllib.requestimportjsondefget_all_plugin_data():
url='https://api.napari-hub.org/plugins/index'json_url=urllib.request.urlopen(url)
data=json.loads(json_url.read())
returndatadefget_plugin_index():
data=get_all_plugin_data()
returnlist([x['name'] forxindata])
defget_github_urls():
plugin_names=get_plugin_index()
github_urls= []
forplugininplugin_names:
try:
url=f'https://pypi.org/pypi/{plugin}/json'response=urllib.request.urlopen(url)
plugin_data=json.loads(response.read())
project_urls=plugin_data['info']['project_urls']
github_url=project_urls.get('Source') orproject_urls.get('Homepage')
ifgithub_urland'github.com'ingithub_url:
github_urls.append(github_url)
exceptExceptionase:
print(f"Failed to get data for {plugin}: {e}")
returngithub_urlsall_github_urls=get_github_urls()
This code retrieves the GitHub URLs of Napari plugins using the PyPI API.
The website napari-hub.org has an API which can be used to list all napari plugins, e.g. like this:
Furthermore, it should be possible to determine the corresponding github repository urls from these plugins, preferably using the pypi API (all napari plugins are on pypi).
git-bob think about code to list urls of github repositories of all napari plugins.
The text was updated successfully, but these errors were encountered: