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

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.2.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

baysalt_christmas-1.2.2-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for baysalt_christmas-1.2.2.tar.gz
Algorithm Hash digest
SHA256 1cee5ab6b282984f7fa2baf176ab364a07ddf6101361af5c4cb079f1e1967682
MD5 bb1dd9eb37ee84e154bbc14488070074
BLAKE2b-256 68878d6992b98db426a0caa7a6cfc9eb33cb976e9981471a5c3b250aa806217c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for baysalt_christmas-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 57fb6b8522905a023a573856147f4918a3955df36f03dcb40356018d2e354f46
MD5 62947b832307f1ef0ea630acf5ebffc1
BLAKE2b-256 bf65ae26101cd560fbf1736796b0f7c6890dab53510cb116abcdaaeaba5165ff

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