We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should improve the documentation in how to create custom providers and attach it into collectors. It should contain the following entries:
bdc-collectors
For example, consider an extension of current provider SciHub named MyProvider which uses different api location. You may have few ways to use this
SciHub
MyProvider
api_url
from bdc_collectors.scihub import SciHub catalog = SciHub(username="user", password="pass", api_url="https://my-url-provider-hub") catalog.search(...) # or # from bdc_collectors.ext import CollectorExtension # ext = CollectorExtension(app) # flask_app # catalog = ext.get_provider("SciHub")(username="user", password="pass", api_url="https://my-url-provider-hub")
bdc_collectors/my_provider/__init__.py
from typing import Type from ..base import BaseCollection from ..scihub import SciHub def init_provider(): return dict(MyProvider=MyProviderAPI) class MyProviderAPI(SciHub): def __init__(self, *args, **kwargs): kwargs.setdefault("api_url", "https://my-url-provider-hub") super(MyProviderAPI, self).__init__(*args, **kwargs) def get_collector(self, collection: str) -> Type[BaseCollection]: # ... logic for custom data collection return super().get_collector(collection) # optional
Register in setup.py the entrypoint for loading this provider:
setup.py
entry_points={ ..., 'bdc_collectors.providers': [ ... # other providers 'my_provider = bdc_collectors.my_provider' ] }
and use it with:
from bdc_collectors.ext import CollectorExtension ext = CollectorExtension(app) # flask_app catalog = ext.get_provider("MyProvider")(username="user", password="pass")
The text was updated successfully, but these errors were encountered:
raphaelrpl
No branches or pull requests
We should improve the documentation in how to create custom providers and attach it into collectors. It should contain the following entries:
bdc-collectors
For example, consider an extension of current provider
SciHub
namedMyProvider
which uses different api location. You may have few ways to use thisapi_url
:MyProvider
(in bdc-collectorsbdc_collectors/my_provider/__init__.py
or in other github repo):Register in
setup.py
the entrypoint for loading this provider:and use it with:
The text was updated successfully, but these errors were encountered: