Skip to main content

Some simple tools for Christmas

Project description

This Package is a collection of Christmas related packages.

Authors : Christmas

Maintainer : Christmas

To install this package, run:

pip install baysalt_christmas

or

pip3 install baysalt_christmas

Packages

baysalt_christmas

commonCode.py

ddt = converToTime(str)

from christmas.commonCode import convertToTime
ddt = convertToTime('20230330')
ddt = convertToTime('2023033001')
ddt = convertToTime('202303300101')
ddt = convertToTime('20230330010101')
ddt = convertToTime('2022-11-09_01:00:00')

filename = new_filename(_pre,lon, _lat, _lat, _date, _res)

from christmas.commonCode import new_filename
import numpy as np 
_lon = np.linspace(100,120)
_lat = np.linspace(10,20)
filename = new_filename('wave', _lon, _lat, _date, 10)

date = get_date()

from christmas.commonCode import get_date
date = get_date()

make_dir(path)

from christmas.commonCode import make_dir
make_dir('/home/ocean/zcy/1/2/3/4')

class: FTPUploadTracker (deprecated)

path = split_path(_path)

from christmas.commonCode import split_path
path = split_path('/home/ocean/zcy/1/2/3/4/')

osprint(_str)

from christmas.commonCode import osprint
x = '123'
osprint(f'{x}SSS')

osprints(_str)

from christmas.commonCode import osprints
x = '123'
osprints('INFO',f'{x}SSS')

timer(func)

processBar.py

class: SftpProcessbar

from christmas.processBar import SftpProcessbar
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname='47.105.220.136', port=22, username='wave', password='wave', timeout=100)
sftp = paramiko.SFTPClient.from_transport(ssh.get_transport())
sftp_obj =SftpProcessbar()
Sprocess_bar = sftp_obj.process_bar
sftp.put('/home/ocean/x.zip', 'x.zip', callback=Sprocess_bar)

translate_byte(B)

class: FtpProcessBar

from christmas.processBar import FtpProcessbar
import os, ftplib

buf_size = 1024
ftp = ftplib.FTP()
ftp.encoding = 'utf-8'
ftp.set_debuglevel(0)
ftp.connect(host='47.105.220.136', port=22)
ftp.login('wave', 'wave')
Ftp_obj = FtpProcessbar(os.path.getsize('/home/ocean/x.zip'))
Fprocess_bar = Ftp_obj.process_bar()
with open('/home/ocean/x.zip', 'rb') as fp:
  ftp.storbinary(f'STOR x.zip', fp, buf_size, Fprocess_bar)

read_conf.py

Conf = read_conf(_conf_file, ele=None)

from christmas.read_conf import read_conf
Conf = read_conf('Post_fvcom.conf')

key, value = char_fill_dic(_key,_str)

TF = is_number(_str)

from christmas.read_conf import is_number
TF = is_number('12')
TF = is_number('-12')
TF = is_number('1e10')
TF = is_number('.5')

flattened_lst = flatten_list(_lst, flattened_lst)

S_dateTime.py

Nearby_date = build_date(_date)

from christmas.S_DateTime import build_date
Nearby_date = build_date('20230324')

server_info.py

pid = grep_from_top(_exe)

from christmas.server_info import grep_from_top
pid = grep_from_top('python3 forecast.py')

mpi_num = grep_from_top_mpi(_exe)

from christmas.server_info import grep_from_top_mpi
pid = grep_from_top_mpi('wrf.exe')

cpu_num, free_cpu_num = get_free_core()

from christmas.server_info import get_free_core
cpu_num, free_cpu_num = get_free_core()

user, hostname, ip = get_server_info()

from christmas.server_info import get_serve_info
user, hostname, ip = get_serve_info()

mncPy

class: MncPy

from christmas.mncPy.compress import mnc_Py
mnc = mnc_Py('/home/ocean/wave_without_compress.nc',o_path = True, d_rm=True)
mnc.compress_files()

Project details


Release history Release notifications | RSS feed

This version

1.2.0

Download files

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

Source Distribution

baysalt_christmas-1.2.0.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

baysalt_christmas-1.2.0-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

Details for the file baysalt_christmas-1.2.0.tar.gz.

File metadata

  • Download URL: baysalt_christmas-1.2.0.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.5

File hashes

Hashes for baysalt_christmas-1.2.0.tar.gz
Algorithm Hash digest
SHA256 fa5494bc459fd4fea1241a6d02058f3519186966ba194d5deaeeb4cd6677333d
MD5 bfbd1b7b563dc34b310ac4b16922d330
BLAKE2b-256 ecc25f809b484d3dff1b5d1cb86f06e443279460db55cb0cdf6b4825e887e5f9

See more details on using hashes here.

File details

Details for the file baysalt_christmas-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for baysalt_christmas-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90d8db2e56a21547a33146a46f858dbd35a32c3fe19292ddffb867ce0048d6a5
MD5 7dc919c0f4a8b1d678fc8b42fc3f4e17
BLAKE2b-256 9797e43f7495dec6760c34d5535c88ded6ce4e7d829b1fa8a1e424354f9d2f17

See more details on using hashes here.

Supported by

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