跳转到主要内容

NERSC SF API的Python客户端

项目描述

欢迎使用sfapi_client

sfapi_client是NERSC的超级设施API的Python 3客户端。


使用pip安装sfapi_client

$ pip install sfapi_client

让我们先检查perlmutter的状态开始吧

>>> from sfapi_client import Client
>>> from sfapi_client.compute import Machine
>>> with Client() as client:
...     status = client.compute(Machine.perlmutter)
...
>>> status
Compute(name='perlmutter', full_name='Perlmutter', description='System Degraded', system_type='compute', notes=['2023-04-26 18:16 -- 2023-04-28 09:30 PDT, System Degraded, Rolling reboots are complete, a final reboot is scheduled for 0930 PDT'], status=<StatusValue.degraded: 'degraded'>, updated_at=datetime.datetime(2023, 4, 26, 18, 16, tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=61200))), client=<sfapi_client._sync.client.Client object at 0x102c871c0>)

功能

  • async接口和标准同步接口。
  • 完全类型注解。

文档

对于基础知识,请访问快速入门。我们还有Jupyter Notebook 示例

更深入的开发者文档可以在API参考中找到。

依赖项

sfapi_client项目依赖于以下库

  • httpx - HTTP支持。
  • authlib - OAuth 2.0认证。
  • pydantic - 数据模型。
  • tenacity - 重试。
  • datamodel-code-generator - 从Open API规范生成数据模型。
  • unasync - 从异步实现生成同步接口。

安装

使用pip安装

$ pip install sfapi_client

项目详情


下载文件

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

源分布

sfapi_client-0.3.1.tar.gz (56.1 kB 查看哈希值)

上传时间 源码

构建分发

sfapi_client-0.3.1-py3-none-any.whl (44.5 kB 查看哈希值)

上传时间 Python 3

支持