跳转到主要内容

LF View API的Python客户端

项目描述

https://img.shields.io/pypi/v/lfview-api-client.svg https://readthedocs.org/projects/lfview/badge/ https://travis-ci.cn/seequent/lfview-api-client.svg?branch=master https://codecov.io/gh/seequent/lfview-api-client/branch/master/graph/badge.svg https://img.shields.io/badge/license-MIT-blue.svg

什么是lfview-api-client?

此库用于在Python环境中登录并交互LF View API。它简化了上传和下载API资源类型,包括

安装

您可以使用 pip 安装此库

pip install lfview-api-client

或从 Github

git clone https://github.com/seequent/lfview-api-client.git
cd lfview-api-client
pip install -e .

快速入门

安装后,您可以在Python中构建LF View空间资源

from lfview.resources import files, spatial

point_set = spatial.ElementPointSet(
    name='Example PointSet Element',
    vertices=files.Array([
        [0., 0, 0],
        [1, 1, 1],
        [2, 2, 2],
    ]),
    data=[
        spatial.DataBasic(
            name='Example PointSet Attribute',
            array=files.Array([-10., 0, 10]),
            location='nodes',
        ),
    ]
)

然后,使用您的资源,创建一个视图

from lfview.resources import manifests

view = manifests.View(
    name='Example View',
    elements=[
        point_set,
    ],
)

接下来,如果您还没有账户,请在 LF View 上注册。注册后,请 生成API密钥。使用您的API密钥登录并上传您的视图。

from lfview.client import Session

session = Session('your-api-key')
session.upload(view)

项目详情


下载文件

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

源代码分发

lfview-api-client-0.1.2.tar.gz (16.7 kB 查看哈希值)

上传时间 源代码

构建分发

lfview_api_client-0.1.2-py3-none-any.whl (19.3 kB 查看哈希值)

上传时间 Python 3

由以下组织支持