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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: baysalt_christmas-1.2.1.tar.gz
  • Upload date:
  • Size: 44.1 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.1.tar.gz
Algorithm Hash digest
SHA256 f3b3ce9f247cef1a4d5b555c85423a9381a07c0ea9d6d83ad2be7ea58db14077
MD5 71b45084f5be7c441ab9c06e934235d5
BLAKE2b-256 b98975c44d158553a05ec8d5067853da80eff7b90760daa21e2d58657d6d16bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for baysalt_christmas-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d22a2d3a03f921e6c05fd7174a63bafe984081fdb21206222bc3c8836e4617c1
MD5 0723a376c725ab4c766e01e4fa0ddb31
BLAKE2b-256 f0097ecfc63c95328416b18616ca0449da6643b3e783dd15b3ada0e45a30f019

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