swiftstorage


Nameswiftstorage JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA simple way to interact with local and remote files / folders through an easy-to-use and highly extendable API.
upload_time2025-02-02 18:13:23
maintainerNone
docs_urlNone
authorSean Yeatts
requires_python>=3.7
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            *Copyright (c) 2025 Sean Yeatts, Inc. All rights reserved.*

SwiftStorage
============

A simple way to interact with local and remote files / folders through an easy-to-use and highly extendable API.

Key Features
------------
- High level methods provide intuitive ways to move, copy, and delete files / folders with minimal code.
- Low level methods provide injection points for middleman services ( ex. data encryption ).
- Hook into data streams to monitor progress; useful for GUI apps that incorporate progress bars.

Quickstart
----------

Key ``import`` statements :

.. code:: python

  from swiftstorage import Storage

**Example** - a simple script that transfers a file between two directories on the user's local machine :

.. code:: python

  # IMPORTS
  from swiftstorage import Storage


  # MOCKUP FUNCTIONS
  def monitor_download(percent: float) -> None:
      print(f"downloaded: {percent}%")
  
  def monitor_upload(percent: float) -> None:
      print(f"uploaded: {percent}%")


  # MAIN DEFINITION
  def main() -> None:
      
      # [1] Prepare datastores using basic paths
      source      = Storage(fr"cache\folder-1")
      destination = Storage(fr"cache\folder-2")
  
      # [2] ( OPTIONAL ) Hook into data streams to monitor transfer progress
      source.stream.connect(monitor_download)
      destination.stream.connect(monitor_upload)
  
      # [3] Perform a simple copy ( + rename ) operation
      file    = "test-file.jpg"
      renamed = "test-file-copy.jpg"
      source.copy(file, destination, renamed, overwrite=True)
  
  
  # ENTRY POINT
  if __name__ == "__main__":
      main()


Installation
------------
**Prerequisites:**

- Python 3.8 or higher is recommended
- pip 24.0 or higher is recommended

**For a pip installation:**

Open a new Command Prompt. Run the following command:

.. code:: sh

  py -m pip install swiftstorage

**For a local installation:**

Extract the contents of this module to a safe location. Open a new terminal and navigate to the top level directory of your project. Run the following command:

.. code:: sh

  py -m pip install "DIRECTORY_HERE\swiftstorage\dist\swiftstorage-1.0.0.tar.gz"

- ``DIRECTORY_HERE`` should be replaced with the complete filepath to the folder where you saved the SwiftStorage module contents.
- Depending on the release of SwiftStorage you've chosen, you may have to change ``1.0.0`` to reflect your specific version.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "swiftstorage",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sean Yeatts",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/85/c5/8f4b30ce22c23cd1caa989a6726805a86680d2e0d62f2c589a4cb495df65/swiftstorage-0.2.0.tar.gz",
    "platform": null,
    "description": "*Copyright (c) 2025 Sean Yeatts, Inc. All rights reserved.*\n\nSwiftStorage\n============\n\nA simple way to interact with local and remote files / folders through an easy-to-use and highly extendable API.\n\nKey Features\n------------\n- High level methods provide intuitive ways to move, copy, and delete files / folders with minimal code.\n- Low level methods provide injection points for middleman services ( ex. data encryption ).\n- Hook into data streams to monitor progress; useful for GUI apps that incorporate progress bars.\n\nQuickstart\n----------\n\nKey ``import`` statements :\n\n.. code:: python\n\n  from swiftstorage import Storage\n\n**Example** - a simple script that transfers a file between two directories on the user's local machine :\n\n.. code:: python\n\n  # IMPORTS\n  from swiftstorage import Storage\n\n\n  # MOCKUP FUNCTIONS\n  def monitor_download(percent: float) -> None:\n      print(f\"downloaded: {percent}%\")\n  \n  def monitor_upload(percent: float) -> None:\n      print(f\"uploaded: {percent}%\")\n\n\n  # MAIN DEFINITION\n  def main() -> None:\n      \n      # [1] Prepare datastores using basic paths\n      source      = Storage(fr\"cache\\folder-1\")\n      destination = Storage(fr\"cache\\folder-2\")\n  \n      # [2] ( OPTIONAL ) Hook into data streams to monitor transfer progress\n      source.stream.connect(monitor_download)\n      destination.stream.connect(monitor_upload)\n  \n      # [3] Perform a simple copy ( + rename ) operation\n      file    = \"test-file.jpg\"\n      renamed = \"test-file-copy.jpg\"\n      source.copy(file, destination, renamed, overwrite=True)\n  \n  \n  # ENTRY POINT\n  if __name__ == \"__main__\":\n      main()\n\n\nInstallation\n------------\n**Prerequisites:**\n\n- Python 3.8 or higher is recommended\n- pip 24.0 or higher is recommended\n\n**For a pip installation:**\n\nOpen a new Command Prompt. Run the following command:\n\n.. code:: sh\n\n  py -m pip install swiftstorage\n\n**For a local installation:**\n\nExtract the contents of this module to a safe location. Open a new terminal and navigate to the top level directory of your project. Run the following command:\n\n.. code:: sh\n\n  py -m pip install \"DIRECTORY_HERE\\swiftstorage\\dist\\swiftstorage-1.0.0.tar.gz\"\n\n- ``DIRECTORY_HERE`` should be replaced with the complete filepath to the folder where you saved the SwiftStorage module contents.\n- Depending on the release of SwiftStorage you've chosen, you may have to change ``1.0.0`` to reflect your specific version.\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A simple way to interact with local and remote files / folders through an easy-to-use and highly extendable API.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/SeanYeatts/SwiftStorage"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f8d7e1e677cb592dcf82d6ee847c43d29ef2f0aaf51fa6ae7360c340666b9b72",
                "md5": "593a474b70bdf1f20c7196bb6025096d",
                "sha256": "bb041fe48c7a573dedc8036197f9b365f6cdf29ccf963605d812d9eda65a9166"
            },
            "downloads": -1,
            "filename": "swiftstorage-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "593a474b70bdf1f20c7196bb6025096d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7599,
            "upload_time": "2025-02-02T18:13:21",
            "upload_time_iso_8601": "2025-02-02T18:13:21.454230Z",
            "url": "https://files.pythonhosted.org/packages/f8/d7/e1e677cb592dcf82d6ee847c43d29ef2f0aaf51fa6ae7360c340666b9b72/swiftstorage-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "85c58f4b30ce22c23cd1caa989a6726805a86680d2e0d62f2c589a4cb495df65",
                "md5": "e2486e9c8517576442f3f025b11d050d",
                "sha256": "265232c3de28d9f7a28680a24fcf08f07fc46965cadaf5d44c26e3f8d3b593f5"
            },
            "downloads": -1,
            "filename": "swiftstorage-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e2486e9c8517576442f3f025b11d050d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6324,
            "upload_time": "2025-02-02T18:13:23",
            "upload_time_iso_8601": "2025-02-02T18:13:23.250309Z",
            "url": "https://files.pythonhosted.org/packages/85/c5/8f4b30ce22c23cd1caa989a6726805a86680d2e0d62f2c589a4cb495df65/swiftstorage-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-02 18:13:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SeanYeatts",
    "github_project": "SwiftStorage",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "swiftstorage"
}
        
Elapsed time: 1.43582s