Skip to main content
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

Metadata

Release files for sfm 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sfm 0.0.17
File Size Uploaded
sfm-0.0.17.tar.gz 73.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sfm 0.0.17
File Interpreter ABI Platform
sfm-0.0.17-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 159.9 kB

Release files / sfm-0.0.17.tar.gz

Download URL sfm-0.0.17.tar.gz
Size 73.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fa97c0c22183de1b92caab42a75cdb3a54e4772ce8cc0643daf832c331ec245c
BLAKE2b-256 checksum
How to use checksums
58669031dfcc6036603a2aab53377c4c21a6be91e7e9f9f812176a23e018d895
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / sfm-0.0.17-py2.py3-none-any.whl

Download URL sfm-0.0.17-py2.py3-none-any.whl
Size 86.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8d56b2e1b1a45281cb078a15e4c521e035e899e5621cb22feeeaf0c5e0584252
BLAKE2b-256 checksum
How to use checksums
eb7cd36e83ae90c5e0c892649a8064f90c484c29b2f43de555bad1f83a55acaa
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page