Uploadoss
Uploadoss is the general module of uploading database data and local files to the Alibaba Cloud OSS
Installation
download uploadoss-0.1.tar.gz
https://pypi.org/project/uploadoss/#files
pip install uploadoss-0.1.tar.gz
Usage
Some simple things you can do with uploadoss
#upload local file(Logs, CSV, and their gzip compression) to Alibaba Cloud OSS
from uploadoss import uploadoss
conf_path = 'C:\demo\oss\conf.ini'
bucket = uploadoss.getossbucket(conf_path)
# Directory of local files
local_path = r'C:\\demo\\data\\file\\'
# The file name in the local directory, also used as the file name on the OSS side
file_name = 'test1.log.gz'
# OSS Directory
oss_path = 'xxx/testlocalfile/'
result = uploadoss.file_to_oss(bucket,local_path = local_path,file_name = file_name,oss_path = oss_path)
print('http status: {0}'.format(result.status))
# Through a single SQL statement
conn = uploadoss.getmysqlconn(conf_path=conf_path)
#
sql_text = 'select * from bigdata_demo.event_info limit 1'
# The file where the SQL query results are stored, also serving as the file name on the OSS side
file_name = 'sql_text.csv.gz'
# OSS Directory
oss_path = 'xxx/testsqltext/dt=20230926/'
result = uploadoss.mysql_to_oss_table(conn=conn,bucket=bucket,local_path=local_path,file_name=file_name,sql_text=sql_text,oss_path = oss_path)
print('http status: {0}'.format(result.status))
# Through a multiple SQL statements,The separator is \001 ,e.g. event_info\001SQL_TEXT
table_conf_list=r'C:\\demo\\oss\\table_config.txt'
result = uploadoss.mysql_to_oss_list(conf_path = conf_path,local_path = local_path,oss_dire_path = oss_dire_path,table_list_conf = table_conf_list )
from datetime import datetime, timedelta
from uploadoss import uploadoss_ora
today = datetime.today()
yesterday = today - timedelta(days=1)
# 日分区表目录
dir_name = 'dt=' + yesterday.strftime('%Y%m%d') + '/'
print(dir_name)
conf_path = 'C:\works\splc\conf\conf.ini'
#conf_path = r'C:\python_prj\tooss\uploadoss\conf.ini'
local_path = r'C:\\demo\\data\\'
config = ConfigParser()
config.read(conf_path)
# 配置多个表及SQL语句,分隔符要求 \001
table_conf_list=r'C:\\demo\\oss\\table_config.txt'
oracle_to_oss_list_incremental(conf_path,local_path,table_conf_list,"'2025-01-01'","'2025-02-02'",'20250202')
Release files for uploadoss 0.4.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uploadoss-0.4.6.tar.gz | 19.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uploadoss-0.4.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.9 kB
Release files / uploadoss-0.4.6.tar.gz
| Download URL | uploadoss-0.4.6.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb18c5c0d4a170184dd2483361c14e416be81126c7f07873176044670b6f6742
|
|
BLAKE2b-256 checksum How to use checksums |
135c9b3ac8cb5ed4412270a3ac4608d099501b6fcf0932ec63b13680e59860c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / uploadoss-0.4.6-py3-none-any.whl
| Download URL | uploadoss-0.4.6-py3-none-any.whl |
|---|---|
| Size | 20.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39a6e1be5341b3fd6f66441b11b19a5690a291cfe51542d836449dce7f625a9a
|
|
BLAKE2b-256 checksum How to use checksums |
a65eb598d73edc6e3fd2ac4511dda2e7f0718050002349a4752ed9e873357329
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|