Skip to main content

Collection of useful single file module.

Project description

Documentation Status https://travis-ci.org/MacHu-GWU/single_file_module-project.svg?branch=master https://codecov.io/gh/MacHu-GWU/single_file_module-project/branch/master/graph/badge.svg https://img.shields.io/pypi/v/sfm.svg https://img.shields.io/pypi/l/sfm.svg https://img.shields.io/pypi/pyversions/sfm.svg https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
https://img.shields.io/badge/Link-Document-blue.svg https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Source_Code-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to sfm Documentation

Collection of useful single file module. Please install required package respectively when needed.

winzip module

Suppose this is your file structure:

/alice ($HOME)
    /Document
        /word
            /paper1.doc
            /paper2.doc
        /excel
            /data1.xlsx
            /data2.xlsx
        /readme.txt

Usage:

>>> from sfm.winzip import zip_a_folder, zip_everything_in_a_folder, zip_many_files
>>> zip_a_folder("/Users/alice/Document", "/Users/alice/document.zip")
>>> zip_everything_in_a_folder("/Users/alice/Document", "/Users/alice/document.zip")
>>> zip_many_files(
    [
        "/Users/alice/Document/word/paper1.doc",
        "/Users/alice/Document/excel/data1.xlsx",
        "/Users/alice/Document/readme.txt",
    ],
    "/Users/alice/document.zip"
)

timer module

Usage:

>>> import time
>>> from sfm.timer import DateTimeTimer

>>> with DateTimeTimer(title="first measure") as timer:
...     time.sleep(1)
from xxxx-xx-xx xx:xx:xx.xxx to xxxx-xx-xx xx:xx:xx.xxx elapsed 1.000000 second.

>>> timer = DateTimeTimer(title="second measure")
>>> timer.start()
>>> time.sleep(1)
>>> timer.end()
from xxxx-xx-xx xx:xx:xx.xxx to xxxx-xx-xx xx:xx:xx.xxx elapsed 1.000000 second.

And a lot more!

Install

sfm is released on PyPI, so all you need is:

$ pip install sfm

To upgrade to latest version:

$ pip install --upgrade sfm

Project details


Download files

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

Files for sfm, version 0.0.17
Filename, size File type Python version Upload date Hashes
Filename, size sfm-0.0.17-py2.py3-none-any.whl (86.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size sfm-0.0.17.tar.gz (73.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page