Skip to main content

A few ready-to use python tools for machine learning

Project description

FlashPythonToolbox

A few ready-to use python tools for machine learning

Install

pip install flashtool

Logger (to file)

For every print function, we print a copy to file without changing the whole file.

Logger(filepath = "./log.txt", mode = "w", stdout = None)
  • filepath: output path. Default: "./log.txt"
  • mode: write mode, e.g., w,w+,a,a+. Default: "w"
  • stdout: capture which print source. Default: "sys.stdout"

Example:

from flashtool import Logger
import sys
sys.stdout = Logger("path/to/log/file/log.txt")
sys.stdout = Logger("path/to/log/file/log.txt","w")
sys.stdout = Logger("path/to/log/file/log.txt","w", sys.stdout)

Email Module

Default Sender: gtflashauto@gmail.com. You need a password for this.

# Function api
def send_email(port = 587,password = None,
        sender_email = "gtflashauto@gmail.com",
        smtp_server="smtp.gmail.com",
        receiver_email = None,
        subject="Subject",
        message="Hello! "):
    ...

# Example
from flashtool import send_email
send_email(receiver_email="xxx@gmail.com", subject="Hi", message="first email")

Track Job

Track your job. Send you an email when it is done.

Tracking by PID Step 1: find your job pid by ps, e.g., ps aux | grep python Step 2:

from flashtool import checkpid
f(12345,5,"xxx@gmail.com")

API:

def trackpid(pid, checktime=1, receiver_email=None, sender_email="gtflashauto@gmail.com", msg=""):
  ...
  • checktime: check pid every checktime seconds
  • msg: additional message

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

flashtool-0.0.2.tar.gz (3.0 kB view details)

Uploaded Source

File details

Details for the file flashtool-0.0.2.tar.gz.

File metadata

  • Download URL: flashtool-0.0.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.24.0 CPython/3.5.2

File hashes

Hashes for flashtool-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c024c4fdadd27395dc865c295e5312cde22e3a02f6f517552a46661adfeeb30a
MD5 93f49caab20090fd640a17286bd0e066
BLAKE2b-256 4301ad5d4bef1e9a3cc4bc75e2139f53f8b649f444a4ffc1164e8a74b0ac0bdb

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