Skip to main content

Uploadoss is the general module of uploading database data and local files to the Alibaba Cloud OSS

Project description

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')  





Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uploadoss-0.4.4.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uploadoss-0.4.4-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file uploadoss-0.4.4.tar.gz.

File metadata

  • Download URL: uploadoss-0.4.4.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for uploadoss-0.4.4.tar.gz
Algorithm Hash digest
SHA256 850f682aaf2f2ace1028ec7d9428a64a81fcbaddbe88e129c8ba1c063a4ba7fb
MD5 b648b52cec120895c76ed69946d0f532
BLAKE2b-256 e4e9d0e027552d8c5e8b54ee4ab0f324246b949052a776110be2aa0da46b9dd5

See more details on using hashes here.

File details

Details for the file uploadoss-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: uploadoss-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for uploadoss-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7e5db758b6e8f0cbe376e77951a67eabfed699d8ae49f35c8fcb5f9d21238e5a
MD5 eb063c21373d538d88d70d14e1cc7c5e
BLAKE2b-256 d4f405e41db525478f228c986277789bfb82eda6a4b7bab98538226ad29efe6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page