cosfs 0.1.0__tar.gz
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.
- cosfs-0.1.0/.gitignore +5 -0
- cosfs-0.1.0/PKG-INFO +24 -0
- cosfs-0.1.0/cosfs/__init__.py +6 -0
- cosfs-0.1.0/cosfs/consts.py +44 -0
- cosfs-0.1.0/cosfs/core.py +1457 -0
- cosfs-0.1.0/cosfs/exceptions.py +81 -0
- cosfs-0.1.0/cosfs/retry.py +95 -0
- cosfs-0.1.0/cosfs/tests/__init__.py +0 -0
- cosfs-0.1.0/cosfs/tests/conftest.py +85 -0
- cosfs-0.1.0/cosfs/tests/test_core.py +870 -0
- cosfs-0.1.0/cosfs/tests/test_fsspec_api.py +472 -0
- cosfs-0.1.0/cosfs/tests/test_performance.py +503 -0
- cosfs-0.1.0/cosfs/tests/test_utils.py +61 -0
- cosfs-0.1.0/cosfs/utils.py +93 -0
- cosfs-0.1.0/cosfs.egg-info/PKG-INFO +24 -0
- cosfs-0.1.0/cosfs.egg-info/SOURCES.txt +20 -0
- cosfs-0.1.0/cosfs.egg-info/dependency_links.txt +1 -0
- cosfs-0.1.0/cosfs.egg-info/entry_points.txt +3 -0
- cosfs-0.1.0/cosfs.egg-info/requires.txt +8 -0
- cosfs-0.1.0/cosfs.egg-info/top_level.txt +1 -0
- cosfs-0.1.0/pyproject.toml +62 -0
- cosfs-0.1.0/setup.cfg +4 -0
cosfs-0.1.0/.gitignore
ADDED
cosfs-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cosfs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A fsspec-compatible filesystem interface for Tencent Cloud COS
|
|
5
|
+
Author: cosfs contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: cosfs,cos,tencent,fsspec,filesystem
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Requires-Dist: fsspec>=2023.9.2
|
|
19
|
+
Requires-Dist: cos-python-sdk-v5>=1.9.30
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
22
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
23
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
24
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Constants for cosfs."""
|
|
2
|
+
|
|
3
|
+
# Protocol prefixes
|
|
4
|
+
COSN_PROTOCOL = "cosn"
|
|
5
|
+
COS_PROTOCOL = "cos"
|
|
6
|
+
|
|
7
|
+
# Environment variable names
|
|
8
|
+
ENV_SECRET_ID = "COS_SECRET_ID"
|
|
9
|
+
ENV_SECRET_KEY = "COS_SECRET_KEY"
|
|
10
|
+
ENV_REGION = "COS_REGION"
|
|
11
|
+
ENV_TOKEN = "COS_TOKEN"
|
|
12
|
+
ENV_ENDPOINT = "COS_ENDPOINT"
|
|
13
|
+
ENV_BUCKET = "COS_BUCKET"
|
|
14
|
+
|
|
15
|
+
# Default test bucket (used when COS_BUCKET env var is not set)
|
|
16
|
+
DEFAULT_TEST_BUCKET = "test-cos-bucket"
|
|
17
|
+
|
|
18
|
+
# Default configuration
|
|
19
|
+
DEFAULT_BLOCK_SIZE = 128 * 1024 * 1024 # 128 MB
|
|
20
|
+
|
|
21
|
+
# Multipart upload thresholds and sizes
|
|
22
|
+
MULTIPART_THRESHOLD = 128 * 1024 * 1024 # files larger than this use multipart upload
|
|
23
|
+
MULTIPART_SIZE = 8 * 1024 * 1024 # 8 MB - size of each part in multipart upload
|
|
24
|
+
PART_MAX_SIZE = 5 * 1024 * 1024 * 1024 # 5 GB - max size for single put_object
|
|
25
|
+
COPY_MAX_SIZE = 5 * 1024 * 1024 * 1024 # 5 GB - max size for single copy_object
|
|
26
|
+
|
|
27
|
+
# Listing defaults
|
|
28
|
+
LIST_MAX_KEYS = 1000 # COS max objects per list_objects call
|
|
29
|
+
DELETE_MAX_KEYS = 1000 # COS max objects per delete_objects call
|
|
30
|
+
|
|
31
|
+
# Retry configuration
|
|
32
|
+
DEFAULT_MAX_RETRY_NUM = 10
|
|
33
|
+
RETRY_BASE_DELAY = 0.1 # seconds
|
|
34
|
+
RETRY_MAX_DELAY = 60.0 # seconds
|
|
35
|
+
RETRYABLE_STATUS_CODES = {429, 500, 502, 503, 504}
|
|
36
|
+
RETRYABLE_ERROR_CODES = {"RequestTimeout", "InternalError", "ServiceUnavailable", "SlowDown"}
|
|
37
|
+
|
|
38
|
+
# File types (for fsspec info dict)
|
|
39
|
+
FILE_TYPE = "file"
|
|
40
|
+
DIRECTORY_TYPE = "directory"
|
|
41
|
+
BUCKET_TYPE = "directory"
|
|
42
|
+
|
|
43
|
+
# Logging
|
|
44
|
+
LOGGER_NAME = "cosfs"
|