跳转到主要内容

为服务intake目录的xpublish插件

项目描述

xpublish-intake

xpublish提供服务的插件

为什么?

随着数据访问服务从自定义API转移到xpublish插件,数据用户需要一种方式来发现这些新插件,而无需更改他们的分析代码。对于可以通过intake加载的数据集,标准化数据集访问的一种方法是为插件的端点提供intake目录。

想法

此插件目前支持 xpublish.plugins.included.zarr.ZarrPlugin 插件(兼容 intake)。将来,如果这个库不需要理解每个兼容 intake 的插件,而是将添加 intake 目录支持的任务留给插件作者在他们适用的访问服务中完成,那就更好了。这个库可以为 xpublish 插件提供一个混入,以用于以标准方式注册他们的端点,以便在 intake 目录中进行宣传。

安装

对于 conda 用户,您可以

conda install --channel conda-forge xpublish_intake

或者,如果您是 pip 用户

pip install xpublish_intake

设置

如果已安装该库,intake 插件将由 xpublish 自动发现。如果您不需要自定义端点,这将对大多数用户有效。

如果您手动指定插件,则需要将 IntakePlugin 添加到 xpublish.Restplugins 参数中,或显式注册 IntakePlugin

from xpublish_intake.plugins import IntakePlugin

# Included in the `plugins` map
rest = Rest(
    ...
    plugins={
        ...
        'intake': IntakePlugin()
    }
)

# Registered explicitly
rest = Rest(...)
rest.register_plugin(IntakePlugin())

用法

intake 插件默认配置为

  • app_router_prefix='/intake',这将创建一个根 intake 目录的 /intake.yaml 路由,其中包含 xpublish.Rest 实例中的所有数据集。默认情况下,该路由在 http://.../intake.yaml 可用。

  • dataset_router_prefix='',这将创建一个 /datasets/[name]/catalog.yaml 路由,用于 xpublish.Rest 实例中的所有数据集。默认情况下,这些路由在 http://.../datasets/[name]/catalog.yaml 可用。

联系

GitHub 上报告错误、建议功能或查看源代码。

许可和版权

xpublish_intake 采用 MIT 许可。

开发在 GitHub 上进行,请访问 https://github.com/axiom-data-science/xpublish-intake

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。

源代码分发

xpublish-intake-1.0.0.tar.gz (8.6 kB 查看哈希值

上传时间

构建分发

xpublish_intake-1.0.0-py3-none-any.whl (8.3 kB 查看哈希值

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面