depozit 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
depozit/__init__.py ADDED
@@ -0,0 +1 @@
1
+ from depozit.client.client import *
depozit/aio.py ADDED
@@ -0,0 +1 @@
1
+ from depozit.aio_client.client import *
File without changes
@@ -0,0 +1,73 @@
1
+ from typing import Optional, Union
2
+ import grpc
3
+ from grpc import aio
4
+
5
+ import depozit.protobufs.files_pb2_grpc as pb2_grpc
6
+ from depozit.aio_client.files import Files
7
+ from depozit.aio_client.containers import Containers
8
+
9
+ global default_container
10
+ global stub
11
+ global files
12
+ global containers
13
+
14
+ async def connect(url: str, api_key: str, container: Optional[str] = "data"):
15
+ global default_container
16
+ global files
17
+ global containers
18
+ global stub
19
+
20
+ metadata = [('api-key', api_key)]
21
+ if container:
22
+ metadata.append(('container', container))
23
+
24
+ channel = aio.insecure_channel(url)
25
+ _stub = pb2_grpc.FilesServiceStub(channel)
26
+
27
+ stub = _stub
28
+
29
+ files = Files(stub, metadata)
30
+ containers = Containers(stub, metadata)
31
+
32
+ default_container = container
33
+
34
+ async def close():
35
+ global stub
36
+ if stub:
37
+ pass
38
+
39
+ async def upload(local_path: Union[str, bytes], remote_path: str, overwrite: bool = False):
40
+ global files
41
+ await files.upload(local_path, remote_path, overwrite)
42
+
43
+ async def upload_bytes(data: bytes, remote_path: str, overwrite: bool = False):
44
+ global files
45
+ await files.upload_bytes(data, remote_path, overwrite)
46
+
47
+ async def read(path: str):
48
+ global files
49
+ return await files.read(path)
50
+
51
+ async def delete(path: str):
52
+ global files
53
+ await files.delete(path)
54
+
55
+ async def find(prefix: Optional[str] = None):
56
+ global files
57
+ return await files.find(prefix)
58
+
59
+ async def rename(remote_path: str, new_name: str):
60
+ global files
61
+ await files.rename(remote_path, new_name)
62
+
63
+ async def create_container(name: str):
64
+ global containers
65
+ await containers.create_container(name)
66
+
67
+ async def delete_container(name: str):
68
+ global containers
69
+ await containers.delete_container(name)
70
+
71
+ async def rename_container(old_name: str, new_name: str):
72
+ global containers
73
+ await containers.rename_container(old_name, new_name)
@@ -0,0 +1,33 @@
1
+ import grpc
2
+ import depozit.protobufs.files_pb2 as pb2
3
+ from depozit.log import logger
4
+
5
+ class Containers:
6
+ def __init__(self, stub, metadata):
7
+ self.stub = stub
8
+ self.metadata = metadata
9
+
10
+ async def create_container(self, name: str) -> list[str]:
11
+ try:
12
+ await self.stub.CreateContainer(pb2.ContainerRequest(name=name), metadata=self.metadata)
13
+ except grpc.aio.AioRpcError as e:
14
+ logger.exception(e)
15
+ print(e.code())
16
+ print(e.details())
17
+
18
+ async def delete_container(self, name: str):
19
+ try:
20
+ await self.stub.DeleteContainer(pb2.ContainerRequest(name=name), metadata=self.metadata)
21
+ except grpc.aio.AioRpcError as e:
22
+ logger.exception(e)
23
+ print(e.code())
24
+ print(e.details())
25
+
26
+ async def rename_container(self, old_name: str, new_name: str):
27
+ try:
28
+ # Using RenameRequest as seen in protobufs
29
+ await self.stub.RenameContainer(pb2.RenameRequest(oldName=old_name, newName=new_name), metadata=self.metadata)
30
+ except grpc.aio.AioRpcError as e:
31
+ logger.exception(e)
32
+ print(e.code())
33
+ print(e.details())
@@ -0,0 +1,65 @@
1
+ import os
2
+ from typing import Optional, Union
3
+ import grpc
4
+ import depozit.protobufs.files_pb2 as pb2
5
+ from depozit.log import logger
6
+
7
+ class Files:
8
+ def __init__(self, stub, metadata):
9
+ self.stub = stub
10
+ self.metadata = metadata
11
+
12
+ async def upload_bytes(self, data: bytes, remote_path: str, overwrite: bool = False):
13
+ try:
14
+ await self.stub.UploadBinary(
15
+ pb2.UploadBinaryRequest(data=data, remotePath=remote_path, overwrite=overwrite),
16
+ metadata=self.metadata
17
+ )
18
+ except grpc.aio.AioRpcError as e:
19
+ logger.exception(e)
20
+ print(e.code())
21
+ print(e.details())
22
+
23
+ async def upload(self, local_path: Union[str, bytes], remote_path: str, overwrite: bool = False):
24
+ if isinstance(local_path, bytes):
25
+ await self.upload_bytes(local_path, remote_path, overwrite)
26
+ else:
27
+ if not os.path.exists(local_path):
28
+ raise FileNotFoundError(f"Local file not found: {local_path}")
29
+ with open(local_path, 'rb') as f:
30
+ data = f.read()
31
+ await self.upload_bytes(data, remote_path, overwrite)
32
+
33
+ async def delete(self, path: str):
34
+ try:
35
+ await self.stub.Delete(pb2.ReadDeleteRequest(remotePath=path), metadata=self.metadata)
36
+ except grpc.aio.AioRpcError as e:
37
+ logger.exception(e)
38
+ print(e.code())
39
+ print(e.details())
40
+
41
+ async def read(self, path: str) -> bytes:
42
+ try:
43
+ response = await self.stub.Read(pb2.ReadDeleteRequest(remotePath=path), metadata=self.metadata)
44
+ return response.data
45
+ except grpc.aio.AioRpcError as e:
46
+ logger.exception(e)
47
+ print(e.code())
48
+ print(e.details())
49
+
50
+ async def find(self, prefix: Optional[str] = None) -> list[str]:
51
+ try:
52
+ response = await self.stub.List(pb2.ListRequest(prefix=prefix), metadata=self.metadata)
53
+ return (item for item in response.remotePaths)
54
+ except grpc.aio.AioRpcError as e:
55
+ logger.exception(e)
56
+ print(e.code())
57
+ print(e.details())
58
+
59
+ async def rename(self, remote_path: str, new_name: str):
60
+ try:
61
+ await self.stub.Rename(pb2.RenameRequest(remotePath=remote_path, newName=new_name), metadata=self.metadata)
62
+ except grpc.aio.AioRpcError as e:
63
+ logger.exception(e)
64
+ print(e.code())
65
+ print(e.details())
File without changes
@@ -0,0 +1,72 @@
1
+ from typing import Optional, Union
2
+ import grpc
3
+
4
+ import depozit.protobufs.files_pb2_grpc as pb2_grpc
5
+ from depozit.client.files import Files
6
+ from depozit.client.containers import Containers
7
+
8
+ global default_container
9
+ global stub
10
+ global files
11
+ global containers
12
+
13
+ def connect(url: str, api_key: str, container: Optional[str] = "data"):
14
+ global default_container
15
+ global files
16
+ global containers
17
+ global stub
18
+
19
+ metadata = [('api-key', api_key)]
20
+ if container:
21
+ metadata.append(('container', container))
22
+
23
+ channel = grpc.insecure_channel(url)
24
+ _stub = pb2_grpc.FilesServiceStub(channel)
25
+
26
+ stub = _stub
27
+
28
+ files = Files(stub, metadata)
29
+ containers = Containers(stub, metadata)
30
+
31
+ default_container = container
32
+
33
+ def close():
34
+ global stub
35
+ if stub:
36
+ pass
37
+
38
+ def upload(local_path: Union[str, bytes], remote_path: str, overwrite: bool = False):
39
+ global files
40
+ files.upload(local_path, remote_path, overwrite)
41
+
42
+ def upload_bytes(data: bytes, remote_path: str, overwrite: bool = False):
43
+ global files
44
+ files.upload_bytes(data, remote_path, overwrite)
45
+
46
+ def read(path: str):
47
+ global files
48
+ return files.read(path)
49
+
50
+ def delete(path: str):
51
+ global files
52
+ files.delete(path)
53
+
54
+ def find(prefix: Optional[str] = None):
55
+ global files
56
+ return files.find(prefix)
57
+
58
+ def rename(remote_path: str, new_name: str):
59
+ global files
60
+ files.rename(remote_path, new_name)
61
+
62
+ def create_container(name: str):
63
+ global containers
64
+ containers.create_container(name)
65
+
66
+ def delete_container(name: str):
67
+ global containers
68
+ containers.delete_container(name)
69
+
70
+ def rename_container(old_name: str, new_name: str):
71
+ global containers
72
+ containers.rename_container(old_name, new_name)
@@ -0,0 +1,32 @@
1
+ import grpc
2
+ import depozit.protobufs.files_pb2 as pb2
3
+ from depozit.log import logger
4
+
5
+ class Containers:
6
+ def __init__(self, stub, metadata):
7
+ self.stub = stub
8
+ self.metadata = metadata
9
+
10
+ def create_container(self, name: str) -> list[str]:
11
+ try:
12
+ self.stub.CreateContainer(pb2.ContainerRequest(name=name), metadata=self.metadata)
13
+ except grpc.RpcError as e:
14
+ logger.exception(e)
15
+ print(e.code())
16
+ print(e.details())
17
+
18
+ def delete_container(self, name: str):
19
+ try:
20
+ self.stub.DeleteContainer(pb2.ContainerRequest(name=name), metadata=self.metadata)
21
+ except grpc.RpcError as e:
22
+ logger.exception(e)
23
+ print(e.code())
24
+ print(e.details())
25
+
26
+ def rename_container(self, old_name: str, new_name: str):
27
+ try:
28
+ self.stub.RenameContainer(pb2.RenameRequest(oldName=old_name, newName=new_name), metadata=self.metadata)
29
+ except grpc.RpcError as e:
30
+ logger.exception(e)
31
+ print(e.code())
32
+ print(e.details())
@@ -0,0 +1,65 @@
1
+ import os
2
+ from typing import Optional, Union
3
+ import grpc
4
+ import depozit.protobufs.files_pb2 as pb2
5
+ from depozit.log import logger
6
+
7
+ class Files:
8
+ def __init__(self, stub, metadata):
9
+ self.stub = stub
10
+ self.metadata = metadata
11
+
12
+ def upload_bytes(self, data: bytes, remote_path: str, overwrite: bool = False):
13
+ try:
14
+ self.stub.UploadBinary(
15
+ pb2.UploadBinaryRequest(data=data, remotePath=remote_path, overwrite=overwrite),
16
+ metadata=self.metadata
17
+ )
18
+ except grpc.RpcError as e:
19
+ logger.exception(e)
20
+ print(e.code())
21
+ print(e.details())
22
+
23
+ def upload(self, local_path: Union[str, bytes], remote_path: str, overwrite: bool = False):
24
+ if isinstance(local_path, bytes):
25
+ self.upload_bytes(local_path, remote_path, overwrite)
26
+ else:
27
+ if not os.path.exists(local_path):
28
+ raise FileNotFoundError(f"Local file not found: {local_path}")
29
+ with open(local_path, 'rb') as f:
30
+ data = f.read()
31
+ self.upload_bytes(data, remote_path, overwrite)
32
+
33
+ def delete(self, path: str):
34
+ try:
35
+ self.stub.Delete(pb2.ReadDeleteRequest(remotePath=path), metadata=self.metadata)
36
+ except grpc.RpcError as e:
37
+ logger.exception(e)
38
+ print(e.code())
39
+ print(e.details())
40
+
41
+ def read(self, path: str) -> bytes:
42
+ try:
43
+ response = self.stub.Read(pb2.ReadDeleteRequest(remotePath=path), metadata=self.metadata)
44
+ return response.data
45
+ except grpc.RpcError as e:
46
+ logger.exception(e)
47
+ print(e.code())
48
+ print(e.details())
49
+
50
+ def find(self, prefix: Optional[str] = None) -> list[str]:
51
+ try:
52
+ response = self.stub.List(pb2.ListRequest(prefix=prefix), metadata=self.metadata)
53
+ return (item for item in response.remotePaths)
54
+ except grpc.RpcError as e:
55
+ logger.exception(e)
56
+ print(e.code())
57
+ print(e.details())
58
+
59
+ def rename(self, remote_path: str, new_name: str):
60
+ try:
61
+ self.stub.Rename(pb2.RenameRequest(remotePath=remote_path, newName=new_name), metadata=self.metadata)
62
+ except grpc.RpcError as e:
63
+ logger.exception(e)
64
+ print(e.code())
65
+ print(e.details())
depozit/log.py ADDED
@@ -0,0 +1,4 @@
1
+ import logging
2
+
3
+
4
+ logger = logging.getLogger(__name__)
File without changes
@@ -0,0 +1,52 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: files.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'files.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x66iles.proto\x12\x05\x66iles\x1a\x1bgoogle/protobuf/empty.proto\"J\n\x13UploadBinaryRequest\x12\x12\n\nremotePath\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12\x11\n\toverwrite\x18\x03 \x01(\x08\"\x1c\n\x0cReadResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\"\'\n\x11ReadDeleteRequest\x12\x12\n\nremotePath\x18\x01 \x01(\t\"\x1d\n\x0bListRequest\x12\x0e\n\x06prefix\x18\x01 \x01(\t\"#\n\x0cListResponse\x12\x13\n\x0bremotePaths\x18\x01 \x03(\t\"4\n\rRenameRequest\x12\x12\n\nremotePath\x18\x01 \x01(\t\x12\x0f\n\x07newName\x18\x02 \x01(\t\" \n\x10\x43ontainerRequest\x12\x0c\n\x04name\x18\x01 \x01(\t2\x87\x04\n\x0c\x46ilesService\x12\x44\n\x0cUploadBinary\x12\x1a.files.UploadBinaryRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x37\n\x04Read\x12\x18.files.ReadDeleteRequest\x1a\x13.files.ReadResponse\"\x00\x12<\n\x06\x44\x65lete\x12\x18.files.ReadDeleteRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x31\n\x04List\x12\x12.files.ListRequest\x1a\x13.files.ListResponse\"\x00\x12\x38\n\x06Rename\x12\x14.files.RenameRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x0f\x43reateContainer\x12\x17.files.ContainerRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x41\n\x0fRenameContainer\x12\x14.files.RenameRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x0f\x44\x65leteContainer\x12\x17.files.ContainerRequest\x1a\x16.google.protobuf.Empty\"\x00\x42\x17Z\x15./protobufs;protobufsb\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'files_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'Z\025./protobufs;protobufs'
36
+ _globals['_UPLOADBINARYREQUEST']._serialized_start=51
37
+ _globals['_UPLOADBINARYREQUEST']._serialized_end=125
38
+ _globals['_READRESPONSE']._serialized_start=127
39
+ _globals['_READRESPONSE']._serialized_end=155
40
+ _globals['_READDELETEREQUEST']._serialized_start=157
41
+ _globals['_READDELETEREQUEST']._serialized_end=196
42
+ _globals['_LISTREQUEST']._serialized_start=198
43
+ _globals['_LISTREQUEST']._serialized_end=227
44
+ _globals['_LISTRESPONSE']._serialized_start=229
45
+ _globals['_LISTRESPONSE']._serialized_end=264
46
+ _globals['_RENAMEREQUEST']._serialized_start=266
47
+ _globals['_RENAMEREQUEST']._serialized_end=318
48
+ _globals['_CONTAINERREQUEST']._serialized_start=320
49
+ _globals['_CONTAINERREQUEST']._serialized_end=352
50
+ _globals['_FILESSERVICE']._serialized_start=355
51
+ _globals['_FILESSERVICE']._serialized_end=874
52
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,399 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ import depozit.protobufs.files_pb2 as files__pb2
7
+ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
8
+
9
+ GRPC_GENERATED_VERSION = '1.78.1'
10
+ GRPC_VERSION = grpc.__version__
11
+ _version_not_supported = False
12
+
13
+ try:
14
+ from grpc._utilities import first_version_is_lower
15
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
16
+ except ImportError:
17
+ _version_not_supported = True
18
+
19
+ if _version_not_supported:
20
+ raise RuntimeError(
21
+ f'The grpc package installed is at version {GRPC_VERSION},'
22
+ + ' but the generated code in files_pb2_grpc.py depends on'
23
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
24
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
25
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
26
+ )
27
+
28
+
29
+ class FilesServiceStub(object):
30
+ """Missing associated documentation comment in .proto file."""
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.UploadBinary = channel.unary_unary(
39
+ '/files.FilesService/UploadBinary',
40
+ request_serializer=files__pb2.UploadBinaryRequest.SerializeToString,
41
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
42
+ _registered_method=True)
43
+ self.Read = channel.unary_unary(
44
+ '/files.FilesService/Read',
45
+ request_serializer=files__pb2.ReadDeleteRequest.SerializeToString,
46
+ response_deserializer=files__pb2.ReadResponse.FromString,
47
+ _registered_method=True)
48
+ self.Delete = channel.unary_unary(
49
+ '/files.FilesService/Delete',
50
+ request_serializer=files__pb2.ReadDeleteRequest.SerializeToString,
51
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
52
+ _registered_method=True)
53
+ self.List = channel.unary_unary(
54
+ '/files.FilesService/List',
55
+ request_serializer=files__pb2.ListRequest.SerializeToString,
56
+ response_deserializer=files__pb2.ListResponse.FromString,
57
+ _registered_method=True)
58
+ self.Rename = channel.unary_unary(
59
+ '/files.FilesService/Rename',
60
+ request_serializer=files__pb2.RenameRequest.SerializeToString,
61
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
62
+ _registered_method=True)
63
+ self.CreateContainer = channel.unary_unary(
64
+ '/files.FilesService/CreateContainer',
65
+ request_serializer=files__pb2.ContainerRequest.SerializeToString,
66
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
67
+ _registered_method=True)
68
+ self.RenameContainer = channel.unary_unary(
69
+ '/files.FilesService/RenameContainer',
70
+ request_serializer=files__pb2.RenameRequest.SerializeToString,
71
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
72
+ _registered_method=True)
73
+ self.DeleteContainer = channel.unary_unary(
74
+ '/files.FilesService/DeleteContainer',
75
+ request_serializer=files__pb2.ContainerRequest.SerializeToString,
76
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
77
+ _registered_method=True)
78
+
79
+
80
+ class FilesServiceServicer(object):
81
+ """Missing associated documentation comment in .proto file."""
82
+
83
+ def UploadBinary(self, request, context):
84
+ """Missing associated documentation comment in .proto file."""
85
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
86
+ context.set_details('Method not implemented!')
87
+ raise NotImplementedError('Method not implemented!')
88
+
89
+ def Read(self, request, context):
90
+ """Missing associated documentation comment in .proto file."""
91
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
92
+ context.set_details('Method not implemented!')
93
+ raise NotImplementedError('Method not implemented!')
94
+
95
+ def Delete(self, request, context):
96
+ """Missing associated documentation comment in .proto file."""
97
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
98
+ context.set_details('Method not implemented!')
99
+ raise NotImplementedError('Method not implemented!')
100
+
101
+ def List(self, request, context):
102
+ """Missing associated documentation comment in .proto file."""
103
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
104
+ context.set_details('Method not implemented!')
105
+ raise NotImplementedError('Method not implemented!')
106
+
107
+ def Rename(self, request, context):
108
+ """Missing associated documentation comment in .proto file."""
109
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
110
+ context.set_details('Method not implemented!')
111
+ raise NotImplementedError('Method not implemented!')
112
+
113
+ def CreateContainer(self, request, context):
114
+ """Missing associated documentation comment in .proto file."""
115
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
116
+ context.set_details('Method not implemented!')
117
+ raise NotImplementedError('Method not implemented!')
118
+
119
+ def RenameContainer(self, request, context):
120
+ """Missing associated documentation comment in .proto file."""
121
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
122
+ context.set_details('Method not implemented!')
123
+ raise NotImplementedError('Method not implemented!')
124
+
125
+ def DeleteContainer(self, request, context):
126
+ """Missing associated documentation comment in .proto file."""
127
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
128
+ context.set_details('Method not implemented!')
129
+ raise NotImplementedError('Method not implemented!')
130
+
131
+
132
+ def add_FilesServiceServicer_to_server(servicer, server):
133
+ rpc_method_handlers = {
134
+ 'UploadBinary': grpc.unary_unary_rpc_method_handler(
135
+ servicer.UploadBinary,
136
+ request_deserializer=files__pb2.UploadBinaryRequest.FromString,
137
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
138
+ ),
139
+ 'Read': grpc.unary_unary_rpc_method_handler(
140
+ servicer.Read,
141
+ request_deserializer=files__pb2.ReadDeleteRequest.FromString,
142
+ response_serializer=files__pb2.ReadResponse.SerializeToString,
143
+ ),
144
+ 'Delete': grpc.unary_unary_rpc_method_handler(
145
+ servicer.Delete,
146
+ request_deserializer=files__pb2.ReadDeleteRequest.FromString,
147
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
148
+ ),
149
+ 'List': grpc.unary_unary_rpc_method_handler(
150
+ servicer.List,
151
+ request_deserializer=files__pb2.ListRequest.FromString,
152
+ response_serializer=files__pb2.ListResponse.SerializeToString,
153
+ ),
154
+ 'Rename': grpc.unary_unary_rpc_method_handler(
155
+ servicer.Rename,
156
+ request_deserializer=files__pb2.RenameRequest.FromString,
157
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
158
+ ),
159
+ 'CreateContainer': grpc.unary_unary_rpc_method_handler(
160
+ servicer.CreateContainer,
161
+ request_deserializer=files__pb2.ContainerRequest.FromString,
162
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
163
+ ),
164
+ 'RenameContainer': grpc.unary_unary_rpc_method_handler(
165
+ servicer.RenameContainer,
166
+ request_deserializer=files__pb2.RenameRequest.FromString,
167
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
168
+ ),
169
+ 'DeleteContainer': grpc.unary_unary_rpc_method_handler(
170
+ servicer.DeleteContainer,
171
+ request_deserializer=files__pb2.ContainerRequest.FromString,
172
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
173
+ ),
174
+ }
175
+ generic_handler = grpc.method_handlers_generic_handler(
176
+ 'files.FilesService', rpc_method_handlers)
177
+ server.add_generic_rpc_handlers((generic_handler,))
178
+ server.add_registered_method_handlers('files.FilesService', rpc_method_handlers)
179
+
180
+
181
+ # This class is part of an EXPERIMENTAL API.
182
+ class FilesService(object):
183
+ """Missing associated documentation comment in .proto file."""
184
+
185
+ @staticmethod
186
+ def UploadBinary(request,
187
+ target,
188
+ options=(),
189
+ channel_credentials=None,
190
+ call_credentials=None,
191
+ insecure=False,
192
+ compression=None,
193
+ wait_for_ready=None,
194
+ timeout=None,
195
+ metadata=None):
196
+ return grpc.experimental.unary_unary(
197
+ request,
198
+ target,
199
+ '/files.FilesService/UploadBinary',
200
+ files__pb2.UploadBinaryRequest.SerializeToString,
201
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
202
+ options,
203
+ channel_credentials,
204
+ insecure,
205
+ call_credentials,
206
+ compression,
207
+ wait_for_ready,
208
+ timeout,
209
+ metadata,
210
+ _registered_method=True)
211
+
212
+ @staticmethod
213
+ def Read(request,
214
+ target,
215
+ options=(),
216
+ channel_credentials=None,
217
+ call_credentials=None,
218
+ insecure=False,
219
+ compression=None,
220
+ wait_for_ready=None,
221
+ timeout=None,
222
+ metadata=None):
223
+ return grpc.experimental.unary_unary(
224
+ request,
225
+ target,
226
+ '/files.FilesService/Read',
227
+ files__pb2.ReadDeleteRequest.SerializeToString,
228
+ files__pb2.ReadResponse.FromString,
229
+ options,
230
+ channel_credentials,
231
+ insecure,
232
+ call_credentials,
233
+ compression,
234
+ wait_for_ready,
235
+ timeout,
236
+ metadata,
237
+ _registered_method=True)
238
+
239
+ @staticmethod
240
+ def Delete(request,
241
+ target,
242
+ options=(),
243
+ channel_credentials=None,
244
+ call_credentials=None,
245
+ insecure=False,
246
+ compression=None,
247
+ wait_for_ready=None,
248
+ timeout=None,
249
+ metadata=None):
250
+ return grpc.experimental.unary_unary(
251
+ request,
252
+ target,
253
+ '/files.FilesService/Delete',
254
+ files__pb2.ReadDeleteRequest.SerializeToString,
255
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
256
+ options,
257
+ channel_credentials,
258
+ insecure,
259
+ call_credentials,
260
+ compression,
261
+ wait_for_ready,
262
+ timeout,
263
+ metadata,
264
+ _registered_method=True)
265
+
266
+ @staticmethod
267
+ def List(request,
268
+ target,
269
+ options=(),
270
+ channel_credentials=None,
271
+ call_credentials=None,
272
+ insecure=False,
273
+ compression=None,
274
+ wait_for_ready=None,
275
+ timeout=None,
276
+ metadata=None):
277
+ return grpc.experimental.unary_unary(
278
+ request,
279
+ target,
280
+ '/files.FilesService/List',
281
+ files__pb2.ListRequest.SerializeToString,
282
+ files__pb2.ListResponse.FromString,
283
+ options,
284
+ channel_credentials,
285
+ insecure,
286
+ call_credentials,
287
+ compression,
288
+ wait_for_ready,
289
+ timeout,
290
+ metadata,
291
+ _registered_method=True)
292
+
293
+ @staticmethod
294
+ def Rename(request,
295
+ target,
296
+ options=(),
297
+ channel_credentials=None,
298
+ call_credentials=None,
299
+ insecure=False,
300
+ compression=None,
301
+ wait_for_ready=None,
302
+ timeout=None,
303
+ metadata=None):
304
+ return grpc.experimental.unary_unary(
305
+ request,
306
+ target,
307
+ '/files.FilesService/Rename',
308
+ files__pb2.RenameRequest.SerializeToString,
309
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
310
+ options,
311
+ channel_credentials,
312
+ insecure,
313
+ call_credentials,
314
+ compression,
315
+ wait_for_ready,
316
+ timeout,
317
+ metadata,
318
+ _registered_method=True)
319
+
320
+ @staticmethod
321
+ def CreateContainer(request,
322
+ target,
323
+ options=(),
324
+ channel_credentials=None,
325
+ call_credentials=None,
326
+ insecure=False,
327
+ compression=None,
328
+ wait_for_ready=None,
329
+ timeout=None,
330
+ metadata=None):
331
+ return grpc.experimental.unary_unary(
332
+ request,
333
+ target,
334
+ '/files.FilesService/CreateContainer',
335
+ files__pb2.ContainerRequest.SerializeToString,
336
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
337
+ options,
338
+ channel_credentials,
339
+ insecure,
340
+ call_credentials,
341
+ compression,
342
+ wait_for_ready,
343
+ timeout,
344
+ metadata,
345
+ _registered_method=True)
346
+
347
+ @staticmethod
348
+ def RenameContainer(request,
349
+ target,
350
+ options=(),
351
+ channel_credentials=None,
352
+ call_credentials=None,
353
+ insecure=False,
354
+ compression=None,
355
+ wait_for_ready=None,
356
+ timeout=None,
357
+ metadata=None):
358
+ return grpc.experimental.unary_unary(
359
+ request,
360
+ target,
361
+ '/files.FilesService/RenameContainer',
362
+ files__pb2.RenameRequest.SerializeToString,
363
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
364
+ options,
365
+ channel_credentials,
366
+ insecure,
367
+ call_credentials,
368
+ compression,
369
+ wait_for_ready,
370
+ timeout,
371
+ metadata,
372
+ _registered_method=True)
373
+
374
+ @staticmethod
375
+ def DeleteContainer(request,
376
+ target,
377
+ options=(),
378
+ channel_credentials=None,
379
+ call_credentials=None,
380
+ insecure=False,
381
+ compression=None,
382
+ wait_for_ready=None,
383
+ timeout=None,
384
+ metadata=None):
385
+ return grpc.experimental.unary_unary(
386
+ request,
387
+ target,
388
+ '/files.FilesService/DeleteContainer',
389
+ files__pb2.ContainerRequest.SerializeToString,
390
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
391
+ options,
392
+ channel_credentials,
393
+ insecure,
394
+ call_credentials,
395
+ compression,
396
+ wait_for_ready,
397
+ timeout,
398
+ metadata,
399
+ _registered_method=True)
File without changes
File without changes
File without changes
depozit/tests/files.py ADDED
File without changes
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: depozit
3
+ Version: 0.0.1
4
+ Summary: Client for Depozit storage service
5
+ Author: Igor Rodrigues
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/slim-devhub/depozit-python.git
8
+ Requires-Python: >=3.12
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: aiogrpc>=1.8
11
+ Requires-Dist: grpcio-tools>=1.76.0
@@ -0,0 +1,22 @@
1
+ depozit/__init__.py,sha256=cRMPSbRg5NEaGy-V98rQyNpRACH5qSCyRNpPmAC4-n8,36
2
+ depozit/aio.py,sha256=IiT9-A7hMaTGwLdPFg3belM3_-sh7PiNCSy6mUbHSsI,40
3
+ depozit/log.py,sha256=gnQLZD50ajQULceSn5TGEG4A_siCyDVV0NmZD_CYfgY,53
4
+ depozit/aio_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ depozit/aio_client/client.py,sha256=83QYbEunRVHuU0F-V2P0Rd1w5Hn0VWP-Ob_WSIY5E_c,1897
6
+ depozit/aio_client/containers.py,sha256=cdLXp8bk2Fud6-oJJZnUZrllutoskTS3u7_D0EJ8ULA,1217
7
+ depozit/aio_client/files.py,sha256=pA4tBDDtNuN63HzFm3FWNbZ2iAhve0KIqHu_J3ijb70,2494
8
+ depozit/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ depozit/client/client.py,sha256=kV53vWeUuT-YMgOxRE_sd5Lc6m9k7rGodPDbTPvPcgI,1749
10
+ depozit/client/containers.py,sha256=DjDmaUGCDWBW_vdNJfaO6ehqo61h2P8DGXhA1PKWRs0,1106
11
+ depozit/client/files.py,sha256=fB_oWrcBIjKxc0h77aK0DS4qfy5BzskxOfv5ItL46-0,2382
12
+ depozit/protobufs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ depozit/protobufs/files_pb2.py,sha256=kigufNNJrqE0EZwPVms5yaCQt03271x6ira462cmkoE,3471
14
+ depozit/protobufs/files_pb2_grpc.py,sha256=DFz5Ma0vUpZxcHB3F1MixZGrGYUgm9p--BnAPJacstw,15322
15
+ depozit/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ depozit/tests/client.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ depozit/tests/containers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ depozit/tests/files.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ depozit-0.0.1.dist-info/METADATA,sha256=brU1KeXCR49HPqI-BO5mivd-1yvCrXbr5Cr7KEQBlzM,343
20
+ depozit-0.0.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
21
+ depozit-0.0.1.dist-info/top_level.txt,sha256=g_2M2Kd9yg3xmPlxY4v_KLcJiRXoeonCw-vOInfCG_o,8
22
+ depozit-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ depozit