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.

Source Distribution

sfm-0.0.17.tar.gz (73.5 kB view details)

Uploaded Source

Built Distribution

sfm-0.0.17-py2.py3-none-any.whl (86.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sfm-0.0.17.tar.gz.

File metadata

  • Download URL: sfm-0.0.17.tar.gz
  • Upload date:
  • Size: 73.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.13

File hashes

Hashes for sfm-0.0.17.tar.gz
Algorithm Hash digest
SHA256 fa97c0c22183de1b92caab42a75cdb3a54e4772ce8cc0643daf832c331ec245c
MD5 1339030631f200edfe29a1037b9c3542
BLAKE2b-256 58669031dfcc6036603a2aab53377c4c21a6be91e7e9f9f812176a23e018d895

See more details on using hashes here.

File details

Details for the file sfm-0.0.17-py2.py3-none-any.whl.

File metadata

  • Download URL: sfm-0.0.17-py2.py3-none-any.whl
  • Upload date:
  • Size: 86.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.13

File hashes

Hashes for sfm-0.0.17-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8d56b2e1b1a45281cb078a15e4c521e035e899e5621cb22feeeaf0c5e0584252
MD5 1a66f98ed6f780815004d1d50ed21f96
BLAKE2b-256 eb7cd36e83ae90c5e0c892649a8064f90c484c29b2f43de555bad1f83a55acaa

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