官网文档地址:http://docs.minio.org.cn/docs/master/python-client-api-reference

初使化MinIO Client对象

from minio import Minio
from minio.error import ResponseError # ResponseError换成S3Error了,以下示例仍保持使用ResponseError,但是实际使用的时候需要换成S3Error minioClient = Minio('play.min.io',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
secure=True)
操作存储桶 操作对象 Presigned操作 存储桶策略/通知
make_bucket get_object presigned_get_object get_bucket_policy
list_buckets put_object presigned_put_object set_bucket_policy
bucket_exists copy_object presigned_post_policy get_bucket_notification
remove_bucket stat_object set_bucket_notification
list_objects remove_object remove_all_bucket_notification
list_objects_v2 remove_objects listen_bucket_notification
list_incomplete_uploads remove_incomplete_upload
fput_object
fget_object
get_partial_object

1. 构造函数

初始化一个新的client对象。

Minio(endpoint, access_key=None, secret_key=None, secure=True, region=None, http_client=None)

参数

参数 类型 描述
endpoint string S3兼容对象存储服务endpoint。
access_key string 对象存储的Access key。(如果是匿名访问则可以为空)。
secret_key string 对象存储的Secret key。(如果是匿名访问则可以为空)。
secure bool 设为True代表启用HTTPS。 (默认是True)。
region string 设置该值以覆盖自动发现存储桶region。 (可选,默认值是None)。
http_client urllib3.poolmanager.PoolManager 设置该值以使用自定义的http client,而不是默认的http client。(可选,默认值是None)。

示例:

from minio import Minio
from minio.error import ResponseError minioClient = Minio('play.min.io',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG')
from minio import Minio
from minio.error import S3Error
import urllib3 httpClient = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', ca_certs='./certs/public.crt') minioClient = Minio(
"192.168.20.102:9000",
access_key="admin",
secret_key="12345678",
secure=True,
http_client=httpClient
)

2. 操作存储桶

创建一个存储桶。

make_bucket(bucket_name, location='us-east-1')

参数

参数 类型 描述
bucket_name string 存储桶名称。
location string 存储桶被创建的region(地区),默认是us-east-1(美国东一区),下面列举的是其它合法的值:
us-east-1
us-west-1
us-west-2
eu-west-1
eu-central-1
ap-southeast-1
ap-northeast-1
ap-southeast-2
sa-east-1
cn-north-1

示例:

try:
minioClient.make_bucket("mybucket", location="us-east-1")
except ResponseError as err:
print(err)
list_buckets()

列出所有的存储桶。

参数
返回值 类型 描述
bucketList function 所有存储桶的list。
bucket.name string 存储桶名称。
bucket.creation_date time 存储桶的创建时间。 示例 buckets = minioClient.list_buckets()
for bucket in buckets:
print(bucket.name, bucket.creation_date) bucket_exists(bucket_name) 检查存储桶是否存在。 参数
参数 类型 描述
bucket_name string 存储桶名称。 示例 try:
print(minioClient.bucket_exists("mybucket"))
except ResponseError as err:
print(err) remove_bucket(bucket_name) 删除存储桶。 参数
参数 类型 描述
bucket_name string 存储桶名称。 示例 try:
minioClient.remove_bucket("mybucket")
except ResponseError as err:
print(err) list_objects(bucket_name, prefix=None, recursive=False) 列出存储桶中所有对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
prefix string 用于过滤的对象名称前缀。可选项,默认为None。
recursive | bool |True代表递归查找,False代表类似文件夹查找,以'/'分隔,不查子文件夹。(可选,默认值是False)。 返回值
参数 类型 描述
object Object 该存储桶中所有对象的Iterator,对象的格式如下:
参数 类型 描述
object.bucket_name string 对象所在存储桶的名称。
object.object_name string 对象的名称。
object.is_dir | bool | True代表列举的对象是文件夹(对象前缀), False与之相反。
object.size int 对象的大小。
object.etag string 对象的etag值。
object.last_modified datetime.datetime 最后修改时间。
object.content_type string 对象的content-type。
object.metadata dict 对象的其它元数据。 示例 # List all object paths in bucket that begin with my-prefixname.
objects = minioClient.list_objects('mybucket', prefix='my-prefixname',
recursive=True)
for obj in objects:
print(obj.bucket_name, obj.object_name.encode('utf-8'), obj.last_modified,
obj.etag, obj.size, obj.content_type) list_objects_v2(bucket_name, prefix=None, recursive=False) 使用V2版本API列出一个存储桶中的对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
prefix string 用于过滤的对象名称前缀。可选项,默认为None。
recursive | bool |True代表递归查找,False代表类似文件夹查找,以'/'分隔,不查子文件夹。(可选,默认值是False)。 返回值
参数 类型 描述
object Object 该存储桶中所有对象的Iterator,对象的格式如下:
参数 类型 描述
object.bucket_name string 对象所在存储桶的名称。
object.object_name string 对象的名称。
object.is_dir | bool | True代表列举的对象是文件夹(对象前缀), False与之相反。
object.size int 对象的大小。
object.etag string 对象的etag值。
object.last_modified datetime.datetime 最后修改时间。
object.content_type string 对象的content-type。
object.metadata dict 对象的其它元数据。 示例 # List all object paths in bucket that begin with my-prefixname.
objects = minioClient.list_objects_v2('mybucket', prefix='my-prefixname',
recursive=True)
for obj in objects:
print(obj.bucket_name, obj.object_name.encode('utf-8'), obj.last_modified,
obj.etag, obj.size, obj.content_type) list_incomplete_uploads(bucket_name, prefix, recursive=False) 列出存储桶中未完整上传的对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
prefix string 用于过滤的对象名称前缀。
recursive |bool |True代表递归查找,False代表类似文件夹查找,以'/'分隔,不查子文件夹。(可选,默认值是False)。 返回值
参数 类型 描述
multipart_obj Object multipart对象的Iterator,格式如下:
参数 类型 描述
multipart_obj.object_name string 未完整上传的对象的名称。
multipart_obj.upload_id string 未完整上传的对象的上传ID。
multipart_obj.size int 未完整上传的对象的大小。 示例 # List all object paths in bucket that begin with my-prefixname.
uploads = minioClient.list_incomplete_uploads('mybucket',
prefix='my-prefixname',
recursive=True)
for obj in uploads:
print(obj.bucket_name, obj.object_name, obj.upload_id, obj.size) get_bucket_policy(bucket_name, prefix) 获取存储桶的当前策略。 参数
参数 类型 描述
bucket_name string 存储桶名称。
prefix string 对象的名称前缀。 返回值
参数 类型 描述
Policy minio.policy.Policy Policy枚举:Policy.READ_ONLY,Policy.WRITE_ONLY,Policy.READ_WRITE或 Policy.NONE。 示例 # Get current policy of all object paths in bucket that begin with my-prefixname.
policy = minioClient.get_bucket_policy('mybucket',
'my-prefixname')
print(policy) set_bucket_policy(bucket_name, prefix, policy) 给指定的存储桶设置存储桶策略。如果prefix不为空,则该存储桶策略仅对匹配这个指定前缀的对象生效。 参数
参数 类型 描述
bucket_name string 存储桶名称。
prefix string 对象的名称前缀。
Policy minio.policy.Policy Policy枚举:Policy.READ_ONLY,Policy.WRITE_ONLY,Policy.READ_WRITE或 Policy.NONE。 示例 # Set policy Policy.READ_ONLY to all object paths in bucket that begin with my-prefixname.
minioClient.set_bucket_policy('mybucket',
'my-prefixname',
Policy.READ_ONLY) get_bucket_notification(bucket_name) 获取存储桶上的通知配置。 参数
参数 类型 描述
bucket_name string 存储桶名称。 返回值
参数 类型 描述
notification dict 如果没有通知配置,则返回一个空的dictionary,否则就和set_bucket_notification的参数结构一样。 示例 # Get the notifications configuration for a bucket.
notification = minioClient.get_bucket_notification('mybucket')
# If no notification is present on the bucket:
# notification == {} set_bucket_notification(bucket_name, notification) 给存储桶设置通知配置。 参数
参数 类型 描述
bucket_name string 存储桶名称。
notification dict 非空dictionary,内部结构格式如下: notification参数格式如下: (dict) --
TopicConfigurations (list) -- 服务配置项目的可选列表,指定了AWS SNS Topics做为通知的目标。
QueueConfigurations (list) -- 服务配置项目的可选列表,指定了AWS SQS Queues做为通知的目标。
CloudFunctionconfigurations (list) -- 服务配置项目的可选列表,指定了AWS Lambda Cloud functions做为通知的目标。 以上项目中至少有一项需要在notification参数中指定。 上面提到的“服务配置项目”具有以下结构: (dict) --
Id (string) -- 配置项的可选ID,如果不指定,服务器自动生成。
Arn (string) -- 指定特定的Topic/Queue/Cloud Function identifier。
Events (list) -- 一个含有事件类型字符串的非空列表,事件类型取值如下: 's3:ReducedRedundancyLostObject', 's3:ObjectCreated:*', 's3:ObjectCreated:Put', 's3:ObjectCreated:Post', 's3:ObjectCreated:', 's3:ObjectCreated:CompleteMultipartUpload', 's3:ObjectRemoved:*', 's3:ObjectRemoved:Delete', 's3:ObjectRemoved:DeleteMarkerCreated'
Filter (dict) -- 一个可选的dictionary容器,里面含有基于键名称过滤的规则的对象。
Key (dict) -- dictionary容器,里面含有基于键名称前缀和后缀过滤的规则的对象。
FilterRules (list) -- 指定过滤规则标准的容器列表。
(dict) -- 键值对的dictionary容器,指定单个的过滤规则。
Name (string) -- 对象的键名称,值为“前缀”或“后缀”。
Value (string) -- 指定规则适用的值。 没有返回值。如果目标服务报错,会抛出ResponseError。如果有验证错误,会抛出InvalidArgumentError或者TypeError。输入参数的configuration不能为空 - 为了删除存储桶上的通知配置,参考remove_all_bucket_notification() API。 示例 notification = {
'QueueConfigurations': [
{
'Id': '1',
'Arn': 'arn1',
'Events': ['s3:ObjectCreated:*'],
'Filter': {
'Key': {
'FilterRules': [
{
'Name': 'prefix',
'Value': 'abc'
}
]
}
}
}
],
'TopicConfigurations': [
{
'Arn': 'arn2',
'Events': ['s3:ObjectCreated:*'],
'Filter': {
'Key': {
'FilterRules': [
{
'Name': 'suffix',
'Value': '.jpg'
}
]
}
}
}
],
'CloudFunctionConfigurations': [
{
'Arn': 'arn3',
'Events': ['s3:ObjectRemoved:*'],
'Filter': {
'Key': {
'FilterRules': [
{
'Name': 'suffix',
'Value': '.jpg'
}
]
}
}
}
]
} try:
minioClient.set_bucket_notification('mybucket', notification)
except ResponseError as err:
# handle error response from service.
print(err)
except (ArgumentError, TypeError) as err:
# should happen only during development. Fix the notification argument
print(err) remove_all_bucket_notification(bucket_name) 删除存储桶上配置的所有通知。 参数
参数 类型 描述
bucket_name string 存储桶名称。 没有返回值,如果操作失败会抛出 ResponseError 异常。 示例 # Remove all the notifications config for a bucket.
minioClient.remove_all_bucket_notification('mybucket') listen_bucket_notification(bucket_name, prefix, suffix, events) 监听存储桶上的通知,可以额外提供前缀、后缀和时间类型来进行过滤。使用该API前不需要先设置存储桶通知。这是一个MinIO的扩展API,MinIO Server会基于过来的请求使用唯一标识符自动注册或者注销。 当通知发生时,产生事件,调用者需要遍历读取这些事件。 参数
参数 类型 描述
bucket_name string 监听事件通知的存储桶名称。
prefix string 过滤通知的对象名称前缀。
suffix string 过滤通知的对象名称后缀。
events list 启用特定事件类型的通知。 完整示例请看 这里。 # Put a file with default content-type.
events = minioClient.listen_bucket_notification('my-bucket', 'my-prefix/',
'.my-suffix',
['s3:ObjectCreated:*',
's3:ObjectRemoved:*',
's3:ObjectAccessed:*'])
for event in events:
print event 3. 操作对象 get_object(bucket_name, object_name, request_headers=None) 下载一个对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
request_headers dict 额外的请求头信息 (可选,默认为None)。 返回值
参数 类型 描述
object urllib3.response.HTTPResponse http streaming reader。 示例 # Get a full object.
try:
data = minioClient.get_object('mybucket', 'myobject')
with open('my-testfile', 'wb') as file_data:
for d in data.stream(32*1024):
file_data.write(d)
except ResponseError as err:
print(err) get_partial_object(bucket_name, object_name, offset=0, length=0, request_headers=None) 下载一个对象的指定区间的字节数组。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
offset |int |offset 是起始字节的位置
length |int |length是要读取的长度 (可选,如果无值则代表读到文件结尾)。
request_headers dict 额外的请求头信息 (可选,默认为None)。 返回值
参数 类型 描述
object urllib3.response.HTTPResponse http streaming reader。 示例 # Offset the download by 2 bytes and retrieve a total of 4 bytes.
try:
data = minioClient.get_partial_object('mybucket', 'myobject', 2, 4)
with open('my-testfile', 'wb') as file_data:
for d in data:
file_data.write(d)
except ResponseError as err:
print(err) fget_object(bucket_name, object_name, file_path, request_headers=None) 下载并将文件保存到本地。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
file_path dict 对象数据要写入的本地文件路径。
request_headers dict 额外的请求头信息 (可选,默认为None)。 返回值
参数 类型 描述
obj Object 对象的统计信息,格式如下:
参数 类型 描述
obj.size int 对象的大小。
obj.etag string 对象的etag值。
obj.content_type string 对象的Content-Type。
obj.last_modified time.time 最后修改时间。
obj.metadata dict 对象的其它元数据。 示例 # Get a full object and prints the original object stat information.
try:
print(minioClient.fget_object('mybucket', 'myobject', '/tmp/myobject'))
except ResponseError as err:
print(err) copy_object(bucket_name, object_name, object_source, copy_conditions=None, metadata=None) 拷贝对象存储服务上的源对象到一个新对象。 注意:本API支持的最大文件大小是5GB。 参数
参数 类型 描述
bucket_name string 新对象的存储桶名称。
object_name string 新对象的名称。
object_source string 要拷贝的源对象的存储桶名称+对象名称。
copy_conditions Conditions 拷贝操作需要满足的一些条件(可选,默认为None)。 示例 以下所有条件都是允许的,并且可以组合使用。 import time
from datetime import datetime
from minio import Conditions copy_conditions = Conditions()
# Set modified condition, copy object modified since 2014 April.
t = (2014, 4, 0, 0, 0, 0, 0, 0, 0)
mod_since = datetime.utcfromtimestamp(time.mktime(t))
copy_conditions.set_modified_since(mod_since) # Set unmodified condition, copy object unmodified since 2014 April.
copy_conditions.set_unmodified_since(mod_since) # Set matching ETag condition, copy object which matches the following ETag.
copy_conditions.set_match_etag("31624deb84149d2f8ef9c385918b653a") # Set matching ETag except condition, copy object which does not match the following ETag.
copy_conditions.set_match_etag_except("31624deb84149d2f8ef9c385918b653a") # Set metadata
metadata = {"test-key": "test-data"} try:
copy_result = minioClient.copy_object("mybucket", "myobject",
"/my-sourcebucketname/my-sourceobjectname",
copy_conditions,metadata=metadata)
print(copy_result)
except ResponseError as err:
print(err) put_object(bucket_name, object_name, data, length, content_type='application/octet-stream', metadata=None) 添加一个新的对象到对象存储服务。 注意:本API支持的最大文件大小是5TB。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
data io.RawIOBase 任何实现了io.RawIOBase的python对象。
length int 对象的总长度。
content_type string 对象的Content type。(可选,默认是“application/octet-stream”)。
metadata dict 其它元数据。(可选,默认是None)。 返回值
参数 类型 描述
etag string 对象的etag值。 示例 单个对象的最大大小限制在5TB。put_object在对象大于5MiB时,自动使用multiple parts方式上传。这样,当上传失败时,客户端只需要上传未成功的部分即可(类似断点上传)。上传的对象使用MD5SUM签名进行完整性验证。 import os
# Put a file with default content-type, upon success prints the etag identifier computed by server.
try:
with open('my-testfile', 'rb') as file_data:
file_stat = os.stat('my-testfile')
print(minioClient.put_object('mybucket', 'myobject',
file_data, file_stat.st_size))
except ResponseError as err:
print(err) # Put a file with 'application/csv'.
try:
with open('my-testfile.csv', 'rb') as file_data:
file_stat = os.stat('my-testfile.csv')
minioClient.put_object('mybucket', 'myobject.csv', file_data,
file_stat.st_size, content_type='application/csv')
except ResponseError as err:
print(err) fput_object(bucket_name, object_name, file_path, content_type='application/octet-stream', metadata=None) 通过文件上传到对象中。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
file_path string 本地文件的路径,会将该文件的内容上传到对象存储服务上。
content_type string 对象的Content type(可选,默认是“application/octet-stream”)。
metadata dict 其它元数据(可选,默认是None)。 返回值
参数 类型 描述
etag string 对象的etag值。 示例 单个对象的最大大小限制在5TB。fput_object在对象大于5MiB时,自动使用multiple parts方式上传。这样,当上传失败时,客户端只需要上传未成功的部分即可(类似断点上传)。上传的对象使用MD5SUM签名进行完整性验证。 # Put an object 'myobject' with contents from '/tmp/otherobject', upon success prints the etag identifier computed by server.
try:
print(minioClient.fput_object('mybucket', 'myobject', '/tmp/otherobject'))
except ResponseError as err:
print(err) # Put on object 'myobject.csv' with contents from
# '/tmp/otherobject.csv' as 'application/csv'.
try:
print(minioClient.fput_object('mybucket', 'myobject.csv',
'/tmp/otherobject.csv',
content_type='application/csv'))
except ResponseError as err:
print(err) stat_object(bucket_name, object_name) 获取对象的元数据。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 名称名称。 返回值
参数 类型 描述
obj Object 对象的统计信息,格式如下:
参数 类型 描述
obj.size int 对象的大小。
obj.etag string 对象的etag值。
obj.content_type string 对象的Content-Type。
obj.last_modified time.time UTC格式的最后修改时间。
obj.metadata dict 对象的其它元数据信息。 示例 # Fetch stats on your object.
try:
print(minioClient.stat_object('mybucket', 'myobject'))
except ResponseError as err:
print(err) remove_object(bucket_name, object_name) 删除一个对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。 示例 # Remove an object.
try:
minioClient.remove_object('mybucket', 'myobject')
except ResponseError as err:
print(err) remove_objects(bucket_name, objects_iter) 删除存储桶中的多个对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
objects_iter list , tuple or iterator 多个对象名称的列表数据。 返回值
参数 类型 描述
delete_error_iterator iterator of MultiDeleteError instances 删除失败的错误信息iterator,格式如下: 注意 由于上面的方法是延迟计算(lazy evaluation),默认是不计算的,所以上面返回的iterator必须被evaluated(比如:使用循环)。 该iterator只有在执行删除操作出现错误时才不为空,每一项都包含删除报错的对象的错误信息。 该iterator产生的每一个删除错误信息都有如下结构:
参数 类型 描述
MultiDeleteError.object_name string 删除报错的对象名称。
MultiDeleteError.error_code string 错误码。
MultiDeleteError.error_message string 错误信息。 示例 # Remove multiple objects in a single library call.
try:
objects_to_delete = ['myobject-1', 'myobject-2', 'myobject-3']
# force evaluation of the remove_objects() call by iterating over
# the returned value.
for del_err in minioClient.remove_objects('mybucket', objects_to_delete):
print("Deletion Error: {}".format(del_err))
except ResponseError as err:
print(err) remove_incomplete_upload(bucket_name, object_name) 删除一个未完整上传的对象。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。 示例 # Remove an partially uploaded object.
try:
minioClient.remove_incomplete_upload('mybucket', 'myobject')
except ResponseError as err:
print(err) 4. Presigned操作 presigned_get_object(bucket_name, object_name, expiry=timedelta(days=7)) 生成一个用于HTTP GET操作的presigned URL。浏览器/移动客户端可以在即使存储桶为私有的情况下也可以通过这个URL进行下载。这个presigned URL可以有一个过期时间,默认是7天。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
expiry datetime.datetime 过期时间,单位是秒,默认是7天。
response_headers | dictionary |额外的响应头 (比如:response-content-type、response-content-disposition)。 示例 from datetime import timedelta # presigned get object URL for object name, expires in 2 days.
try:
print(minioClient.presigned_get_object('mybucket', 'myobject', expires=timedelta(days=2)))
# Response error is still possible since internally presigned does get bucket location.
except ResponseError as err:
print(err) presigned_put_object(bucket_name, object_name, expires=timedelta(days=7)) 生成一个用于HTTP PUT操作的presigned URL。浏览器/移动客户端可以在即使存储桶为私有的情况下也可以通过这个URL进行上传。这个presigned URL可以有一个过期时间,默认是7天。 注意:你可以通过只指定对象名称上传到S3。 参数
参数 类型 描述
bucket_name string 存储桶名称。
object_name string 对象名称。
expiry datetime.datetime 过期时间,单位是秒,默认是7天。 示例 from datetime import timedelta # presigned Put object URL for an object name, expires in 3 days.
try:
print(minioClient.presigned_put_object('mybucket',
'myobject',
expires=timedelta(days=3)))
# Response error is still possible since internally presigned does get
# bucket location.
except ResponseError as err:
print(err) presigned_post_policy(PostPolicy) 允许给POST操作的presigned URL设置策略条件。这些策略包括比如,接收对象上传的存储桶名称,名称前缀,过期策略。 创建policy: from datetime import datetime, timedelta from minio import PostPolicy
post_policy = PostPolicy() # Apply upload policy restrictions: # set bucket name location for uploads.
post_policy.set_bucket_name('mybucket')
# set key prefix for all incoming uploads.
post_policy.set_key_startswith('myobject')
# set content length for incoming uploads.
post_policy.set_content_length_range(10, 1024)
# set content-type to allow only text
post_policy.set_content_type('text/plain') # set expiry 10 days into future.
expires_date = datetime.utcnow()+timedelta(days=10)
post_policy.set_expires(expires_date) 获得POST表单的键值对形式的对象: try:
signed_form_data = minioClient.presigned_post_policy(post_policy)
except ResponseError as err:
print(err) 使用curlPOST你的数据: curl_str = 'curl -X POST {0}'.format(signed_form_data[0])
curl_cmd = [curl_str]
for field in signed_form_data[1]:
curl_cmd.append('-F {0}={1}'.format(field, signed_form_data[1][field])) # print curl command to upload files.
curl_cmd.append('-F file=@<FILE>')
print(' '.join(curl_cmd))

Python Client API文档的更多相关文章

  1. 使用sphinx快速生成Python API 文档

    一  简单介绍 不管是开源还是闭源,文档都是很重要的.当然理论上说,最好的文档就是代码本身,但是要让所有人都能读懂你的代码这太难了.所以我们要写文档.大部分情况,我们不希望维护一份代码再加上一份文档, ...

  2. 使用python编写量子线路打印的简单项目,并使用Sphinx自动化生成API文档

    技术背景 该文章一方面从量子线路的打印着手,介绍了一个简单的python量子线路工程.同时基于这个简单的小工程,我们顺带的介绍了python的API文档自动化生成工具Sphinx的基本使用方法. 量子 ...

  3. 利用sphinx为python项目生成API文档

    sphinx可以根据python的注释生成可以查找的api文档,简单记录了下步骤 1:安装 pip install -U Sphinx 2:在需要生成文档的.py文件目录下执行sphinx-apido ...

  4. 使用sphinx快速为你python注释生成API文档

    sphinx简介sphinx是一种基于Python的文档工具,它可以令人轻松的撰写出清晰且优美的文档,由Georg Brandl在BSD许可证下开发.新版的Python3文档就是由sphinx生成的, ...

  5. (转载)中文Appium API 文档

    该文档是Testerhome官方翻译的源地址:https://github.com/appium/appium/tree/master/docs/cn官方网站上的:http://appium.io/s ...

  6. 中文Appium API 文档

    该文档是Testerhome官方翻译的源地址:https://github.com/appium/appium/tree/master/docs/cn官方网站上的:http://appium.io/s ...

  7. Android多媒体--MediaCodec 中文API文档

    *由于工作需要,需要利用MediaCodec实现Playback及Transcode等功能,故在学习过程中翻译了Google官方的MediaCodec API文档,由于作者水平限制,文中难免有错误和不 ...

  8. FastDFS接口API文档说明

    FastDFS接口API文档说明 时间:2012-03-17 来源:R9IT 作者:R9传奇 一.命令行的上传: 上传命令1. /usr/local/bin/fdfs_upload_file conf ...

  9. python+selenium自动化软件测试(第12章):Python读写XML文档

    XML 即可扩展标记语言,它可以用来标记数据.定义数据类型,是一种允许用户对自己的标记语言进 行定义的源语言.xml 有如下特征: 首先,它是有标签对组成:<aa></aa> ...

随机推荐

  1. pytorch 基础内容

    一些基础的操作: import torch as th a=th.rand(3,4) #随机数,维度为3,4的tensor b=th.rand(4)print(a)print(b) a+b tenso ...

  2. JDBC:批处理

    1.批处理: 当要执行某条SQL语句很多次时.例如,批量添加数据:使用批处理的效率要高的多. 2.如何实现批处理 实践: package com.dgd.test; import java.io.Fi ...

  3. day11 - 多线程

    1内容 进程.线程介绍 Java中 线程的实现方式 Thread 类 Runnable 接口 Callable 接口 线程相关的方法 线程安全问题 - 同步技术 线程等待唤醒机制 进程(Process ...

  4. 万字干货|Java基础面试题(2022版)

    目录 概念常识 Java 语言有哪些特点? JVM.JRE和JDK的关系 什么是字节码? 为什么说 Java 语言是"编译与解释并存"? Oracle JDK 和OpenJDK的区 ...

  5. CA证书、自颁发证书、自签名证书联系

    一.理论基础 ssl:secure socket layer(安全套接层协议)的缩写,通过此协议可以保证两个应用通信的可靠性和保密性.openssl:是ssl协议的实现.提供了对称加密算法.非对称加密 ...

  6. day04 缓冲字符流__异常处理

    缓冲字符流 缓冲字符输入流:java.io.BufferedReader 是一个高级的字符流,特点是块读文本数据,并且可以按行读取字符串. package io; import java.io.*; ...

  7. Vue中关于this指向的问题

    由Vue管理的函数 例如: computed 计算属性 watch 监视属性 filters (Vue3中已弃用且不再支持) 过滤器 .... 上述属性里配置的函数不要采用箭头函数写法,因为箭头函数没 ...

  8. [HNOI2009]【一本通提高组合数学】有趣的数列

    [HNOI2009]有趣的数列 题目描述 我们称一个长度为 2 n 2n 2n 的数列是有趣的,当且仅当该数列满足以下三个条件: 它是从 1 ∼ 2 n 1 \sim 2n 1∼2n 共 2 n 2n ...

  9. Cow Picnic S

    题目描述: K(1≤K≤100)只奶牛分散在N(1≤N≤1000)个牧场.现在她们要集中起来进餐.牧场之间有M(1≤M≤10000)条有向路连接,而且不存在起点和终点相同的有向路.她们进餐的地点必须是 ...

  10. Matplotlib(基本用法)

    Matplotlib 是数据分析绘图的常见模块,可以算是 2D-绘图(Python)领域使用最广泛的套件,可以将数据图形化,并且提供多样化的输出格式,利于数据的显示并分析. 接下来展示的是Matplo ...