#Datastore Client
Project TCT图像与信息存储数据库 Datastore python版Client
##示例
if __name__ == "__main__":
#test code
#this test code shows that:
# crate a lot of raw datas
# upload them to datastore
# gather them togher to create a dataset name 'L-in-H'
# and query them out in tow style
log.getLogger().setLevel(log.INFO)
#DataStore Client, next coming: DataStore Command Line Tools
client = Client(
graphql_entrance = 'http://127.0.0.1:8080',
minio_entrance = '127.0.0.1:9001',
graphql_path="/v1/graphql/",
minio_secure=False,
download_path='./test_data'
)
for i in range(20):
with open('./test_data/test{}.txt'.format(i), 'w+') as f:
import random
f.write(str('hi'))
raws = client.raw.create('./test_data/', metadata={
'bucket': 'raws', #the name of the bucket
'source': 'tell me more detail where this object come from!',
'class_tree': {
'big_image': 'HSIL',
'cell': 'LSIL',
'instance': 'independent'
},
'hi':'this is a test, you can add any key you want',
'but': 'every resources has a prototype keys that you must contains'
}
)
err, dataset = client.dataset.create(name='L-in-H', metadata={
"note": 'this dataset contains all the LSIL cell from HSIL big image'
})
err, dataset_with_raws = client.dataset.add_raws(
dataset=dataset,
resources=raws
)
err, raws = client.raw.query("""
{
dataset_id: {
_eq: 1
}
}
""")
err, res = client.queryer.query(
"""
{
data_raw(where: {metadata: {_contains: {class_tree: {cell: "LSIL"}}}, tag: {_eq: "latest"}}, distinct_on: id) {
id
metadata
tag
version
url
name
}
}
"""
)
raws = res['data']['data_raw']
print(client.downloader.download(raws))
for i in range(20):
os.remove('test_data/test{}.txt'.format(i))
##Package Document
使用python函数 help(object)查看文档
##Datastore API Reference
请参阅在线文档
Metadata
Release files for DatastoreClient 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| DatastoreClient-0.0.9.tar.gz | 9.4 kB | Without provenance | Details for DatastoreClient-0.0.9.tar.gz |
Release files / DatastoreClient-0.0.9.tar.gz
| Download URL | DatastoreClient-0.0.9.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f385000c9b2c98d5328b543e59ead9d383b96deb35f5c77c3ea09c92b886a92c
|
|
BLAKE2b-256 checksum How to use checksums |
af281236ff0c8bc706056c73723fbcdd22dbc23f5fd397b549febe292761ad3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for DatastoreClient 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.