Metadata-Version: 2.1
Name: sfm
Version: 0.0.17
Summary: Collection of useful single file module.
Home-page: https://github.com/MacHu-GWU/
Author: Sanhe Hu
Author-email: husanhe@gmail.com
Maintainer: Unknown
License: MIT
Download-URL: https://pypi.python.org/pypi/sfm/0.0.17#downloads
Platform: Windows
Platform: MacOS
Platform: Unix
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Dist: six
Provides-Extra: docs
Requires-Dist: sphinx (==1.8.1) ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
Requires-Dist: sphinx-jinja ; extra == 'docs'
Requires-Dist: sphinx-copybutton ; extra == 'docs'
Requires-Dist: docfly (>=0.0.17) ; extra == 'docs'
Requires-Dist: rstobj (>=0.0.5) ; extra == 'docs'
Requires-Dist: pygments ; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest (==3.2.3) ; extra == 'tests'
Requires-Dist: pytest-cov (==2.5.1) ; extra == 'tests'
Requires-Dist: Faker ; extra == 'tests'
Requires-Dist: sqlalchemy ; extra == 'tests'
Requires-Dist: pathlib-mate ; extra == 'tests'
Requires-Dist: marshmallow ; extra == 'tests'
Requires-Dist: fuzzywuzzy ; extra == 'tests'
Requires-Dist: atomicwrites ; extra == 'tests'
Requires-Dist: attrs ; extra == 'tests'

.. image:: https://readthedocs.org/projects/sfm/badge/?version=latest
    :target: https://sfm.readthedocs.io/index.html
    :alt: Documentation Status

.. image:: https://travis-ci.org/MacHu-GWU/single_file_module-project.svg?branch=master
    :target: https://travis-ci.org/MacHu-GWU/single_file_module-project?branch=master

.. image:: https://codecov.io/gh/MacHu-GWU/single_file_module-project/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/MacHu-GWU/single_file_module-project

.. image:: https://img.shields.io/pypi/v/sfm.svg
    :target: https://pypi.python.org/pypi/sfm

.. image:: https://img.shields.io/pypi/l/sfm.svg
    :target: https://pypi.python.org/pypi/sfm

.. image:: https://img.shields.io/pypi/pyversions/sfm.svg
    :target: https://pypi.python.org/pypi/sfm

.. image:: https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
    :target: https://github.com/MacHu-GWU/single_file_module-project

------


.. image:: https://img.shields.io/badge/Link-Document-blue.svg
      :target: https://sfm.readthedocs.io/index.html

.. image:: https://img.shields.io/badge/Link-API-blue.svg
      :target: https://sfm.readthedocs.io/py-modindex.html

.. image:: https://img.shields.io/badge/Link-Source_Code-blue.svg
      :target: https://sfm.readthedocs.io/py-modindex.html

.. image:: https://img.shields.io/badge/Link-Install-blue.svg
      :target: `install`_

.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
      :target: https://github.com/MacHu-GWU/single_file_module-project

.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
      :target: https://github.com/MacHu-GWU/single_file_module-project/issues

.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
      :target: https://github.com/MacHu-GWU/single_file_module-project/issues

.. image:: https://img.shields.io/badge/Link-Download-blue.svg
      :target: https://pypi.org/pypi/sfm#files


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:

.. code-block:: bash

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

Usage:

.. code-block:: python

    >>> 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:

.. code-block:: python

    >>> 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:

Install
-------------------------------------------------------------------------------

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

.. code-block:: console

    $ pip install sfm

To upgrade to latest version:

.. code-block:: console

    $ pip install --upgrade sfm


