# pennprov
Habitat API
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: V1.0.0
- Package version: 2.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
For more information, please visit [https://bitbucket.org/penndb/hab-repo](https://bitbucket.org/penndb/hab-repo)
## Requirements.
Python 2.7 and 3.4+; Docker and Docker Compose, if setting up the server in a Docker container.
## Installation & Usage
### pip install
You can install with pip
```sh
pip install pennprov
```
(you may need to run `pip` with root permission: `sudo pip install pennprov`)
Then import the package:
```python
import pennprov
```
## Getting Started - Client
The following illustrates a simple use of the API to obtain a authentication token and then store and retrieve a node.
```python
"""Example usage of pennprov client"""
from __future__ import print_function
from pprint import pprint
import pennprov
from pennprov.rest import ApiException
def main():
"""Get a token and store a node"""
# create instances of the API classes
configuration = pennprov.configuration.Configuration()
auth_api = pennprov.AuthenticationApi()
prov_api = pennprov.ProvenanceApi()
username = "YOUR_USERNAME"
credentials = pennprov.UserCredentials(
"YOUR_PASSWORD")
graph_name = "my_graph"
try:
# One-time initialization of client with a JWT token for
# authentication.
web_token = auth_api.get_token_route(username, credentials)
token = web_token.token
print("Setting token %s\n" % token)
configuration.api_key["api_key"] = token
# Once api_key is set we can call services. For example,
# store_prov_node
prov_token_value = "my_prov_token"
stream = pennprov.IDModel("my_stream.0")
prov_location = pennprov.ProvLocationModel(
stream=stream,
field="my_source",
position=[1, 2])
data = [pennprov.FieldModel(
name="my_boolean_field", type="BOOLEAN", value="true")]
tuple_with_schema = pennprov.TupleWithSchemaModel(
schema_name="my_schema", tuple=data, lookup_keys=[])
body = pennprov.StoreNodeModel(
prov_specifier=prov_location, tuple_with_schema=tuple_with_schema)
prov_api.create_provenance_graph(graph_name)
prov_api.store_provenance_node(graph_name, prov_token_value, body)
# Retrieve the data from the node
response = prov_api.get_provenance_data(graph_name, prov_token_value)
pprint(response)
except ApiException as api_exception:
print("Exception when calling server: %s\n" % api_exception)
if __name__ == '__main__':
main()
```
## Getting Started - Docker
If you want to have a simple Docker container to test the above, do the following.
```bash
cd docker-container
docker-compose up
```
Then (after waiting some time!) open your Web browser to http://localhost:8088 and click on `Sign up`. Create a new user called `YOUR_USERNAME` with password `YOUR_PASSWORD`.
## Documentation for API Endpoints
All URIs are relative to *http://localhost:8088*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AuthenticationApi* | [**add_credential**](docs/AuthenticationApi.md#add_credential) | **POST** /auth/services/{service}/user/{username} | Adds a service credential for the user
*AuthenticationApi* | [**add_group**](docs/AuthenticationApi.md#add_group) | **POST** /auth/organizations/{organization}/group/{group} | Adds a permissions group to an organization
*AuthenticationApi* | [**add_organization**](docs/AuthenticationApi.md#add_organization) | **POST** /auth/organizations/{orgname} | Adds an organization
*AuthenticationApi* | [**add_subgroup_to_group**](docs/AuthenticationApi.md#add_subgroup_to_group) | **POST** /auth/groups/{groupname}/group/{subgroup} | Adds a subgroup to a group
*AuthenticationApi* | [**add_user_to_group**](docs/AuthenticationApi.md#add_user_to_group) | **POST** /auth/groups/{groupname}/user/{username} | Adds a user to a group
*AuthenticationApi* | [**add_user_to_organization**](docs/AuthenticationApi.md#add_user_to_organization) | **POST** /auth/organizations/{orgId}/user/{username} | Adds a user to an organization
*AuthenticationApi* | [**create_new_user**](docs/AuthenticationApi.md#create_new_user) | **POST** /auth/credentials/{username} | Creates a new user
*AuthenticationApi* | [**get_group_from_id**](docs/AuthenticationApi.md#get_group_from_id) | **GET** /auth/groups/id/{groupId} | Gets a group name from its integer ID
*AuthenticationApi* | [**get_group_id**](docs/AuthenticationApi.md#get_group_id) | **GET** /auth/groups/name/{groupName} | Gets a group's ID from its name
*AuthenticationApi* | [**get_group_ids_for_user**](docs/AuthenticationApi.md#get_group_ids_for_user) | **GET** /auth/credentials/{username}/groups/id | Gets the IDs of groups in which a user is directly a member
*AuthenticationApi* | [**get_groups_for_user**](docs/AuthenticationApi.md#get_groups_for_user) | **GET** /auth/credentials/{username}/groups | Gets the groups in which a user is directly a member
*AuthenticationApi* | [**get_organization_from_id**](docs/AuthenticationApi.md#get_organization_from_id) | **GET** /auth/organizations/id/{orgId} | Gets an organization name from its integer ID
*AuthenticationApi* | [**get_organization_id**](docs/AuthenticationApi.md#get_organization_id) | **GET** /auth/organizations/name/{orgName} | Gets an organization ID from its name
*AuthenticationApi* | [**get_parent_group_ids**](docs/AuthenticationApi.md#get_parent_group_ids) | **GET** /auth/groups/id/{groupId}/parents/id | Gets the IDs of parent groups
*AuthenticationApi* | [**get_parent_groups**](docs/AuthenticationApi.md#get_parent_groups) | **GET** /auth/groups/name/{groupName}/parents/name | Gets the groups in which a user is directly a member
*AuthenticationApi* | [**get_token_route**](docs/AuthenticationApi.md#get_token_route) | **POST** /auth/tokens/{username} | Requests a new token
*AuthenticationApi* | [**get_user_info**](docs/AuthenticationApi.md#get_user_info) | **GET** /auth/credentials/{username}/info | Gets a user's info
*AuthenticationApi* | [**is_registered**](docs/AuthenticationApi.md#is_registered) | **GET** /auth/services/{service}/user/{username} | Returns whether a user credential is valid for a service
*AuthenticationApi* | [**is_valid_credential**](docs/AuthenticationApi.md#is_valid_credential) | **POST** /auth/services/local/user/{username}/credential | Returns whether a local user credential is valid
*AuthenticationApi* | [**update_user**](docs/AuthenticationApi.md#update_user) | **PUT** /auth/credentials/{username} | Updates user properties
*PermissionApi* | [**add_permission**](docs/PermissionApi.md#add_permission) | **POST** /perms/types/{permname} | Adds a new labeled permission type
*PermissionApi* | [**get_group_permissions_on**](docs/PermissionApi.md#get_group_permissions_on) | **GET** /perms/objects/{object}/group/{groupName} | Gets the group's permissions on an object
*PermissionApi* | [**get_object_ids**](docs/PermissionApi.md#get_object_ids) | **GET** /perms/name/{permname}/user/{username} | Gets the object ids for which the user has the given permission
*PermissionApi* | [**get_permission_from_id**](docs/PermissionApi.md#get_permission_from_id) | **GET** /perms/id/{id}/name | Gets a permission's name from its integer ID
*PermissionApi* | [**get_permission_id**](docs/PermissionApi.md#get_permission_id) | **GET** /perms/name/{name}/id | Gets a permission's ID from its name
*PermissionApi* | [**get_user_permissions_on**](docs/PermissionApi.md#get_user_permissions_on) | **GET** /perms/objects/{object}/user/{username} | Gets the user's permissions on an object
*PermissionApi* | [**grant_group_permission_on**](docs/PermissionApi.md#
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共74个文件
py:66个
txt:4个
pkg-info:2个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
资源分类:Python库 所属语言:Python 资源全名:pennprov-2.0.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源详情
资源评论
资源推荐
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 74 条
- 1
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)
评论0