s3streamer


Names3streamer JSON
Version 2024.1.0.0 PyPI version JSON
download
home_pagehttps://gitlab.com/fer1035_python/modules/pypi-s3streamer
SummaryStream files to AWS S3 using multipart upload.
upload_time2024-02-02 05:45:45
maintainer
docs_urlNone
authorAhmad Ferdaus Abd Razak
requires_python>=3.6,<4.0
licenseGPL-2.0-only
keywords s3 aws api multipart upload
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==============
**s3streamer**
==============

Overview
--------

A frontend module to upload files to AWS S3 storage. The module supports large files as it chunks them into smaller sizes and recombines them into the original file in the specified S3 bucket. It employs multiprocessing, and there is the option of specifying the size of each chunk as well as how many chunks to send in a single run. The defaults are listed in **Optional Arguments** below.

Prerequisites
-------------

- An AWS S3 bucket to receive uploads.
- An AWS Lambda function to perform backend tasks.
- The AWS CloudFormation template to create these resources are available in the project's GitHub repository.

Required (Positional) Arguments
-------------------------------

- Position 1: Filename (local full / relative path to the file)

Optional (Keyword) Arguments
----------------------------

- path: Destination path in the S3 bucket (default: /)
- parts: Number of multiprocessing parts to send simultaneously (default: 5)
- partsize: Size of each part in MB (default: 100)
- tmp: Location of local temporary directory to store temporary files created by the module (default: '/tmp')
- purge: Whether to purge the specified file instead of uploading it (default: False)
- requrl: The endpoint URL for backend Lambda function (default: 'https://<api_endpoint_url>')
- reqapikey: The API key for backend Lambda function (default: '<api_key>')

Usage
-----

Installation:

.. code-block:: BASH

   pip3 install s3streamer
   # or
   python3 -m pip install s3streamer

In Python3:

.. code-block:: BASH

   # To upload a new file.
   from s3streamer.s3streamer import multipart
   response = multipart(
       'myfile.iso', 
       'installer/images'
   )

   # To remove a file from S3.
   from s3streamer.s3streamer import multipart
   response = multipart(
       'myfile.iso', 
       'installer/images', 
       purge = True
   )

In BASH:

.. code-block:: BASH

   # To upload a new file.
   python3 -c \
   "from s3streamer.s3streamer import multipart; \
   response = multipart(\
   'myfile.iso', \
   'installer/images')"

   # To remove a file from S3.
   python3 -c \
   "from s3streamer.s3streamer import multipart; \
   response = multipart(\
   'myfile.iso', \
   'installer/images', \
   purge = True)"

If the upload is successful, the file will be available at **installer/images/myfile.iso**.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/fer1035_python/modules/pypi-s3streamer",
    "name": "s3streamer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "S3,AWS,API,multipart,upload",
    "author": "Ahmad Ferdaus Abd Razak",
    "author_email": "ahmad.ferdaus.abd.razak@ni.com",
    "download_url": "https://files.pythonhosted.org/packages/87/1d/70422c45541c7ca2067cd3d9e62719757315f8b773506be39a865898047b/s3streamer-2024.1.0.0.tar.gz",
    "platform": null,
    "description": "==============\n**s3streamer**\n==============\n\nOverview\n--------\n\nA frontend module to upload files to AWS S3 storage. The module supports large files as it chunks them into smaller sizes and recombines them into the original file in the specified S3 bucket. It employs multiprocessing, and there is the option of specifying the size of each chunk as well as how many chunks to send in a single run. The defaults are listed in **Optional Arguments** below.\n\nPrerequisites\n-------------\n\n- An AWS S3 bucket to receive uploads.\n- An AWS Lambda function to perform backend tasks.\n- The AWS CloudFormation template to create these resources are available in the project's GitHub repository.\n\nRequired (Positional) Arguments\n-------------------------------\n\n- Position 1: Filename (local full / relative path to the file)\n\nOptional (Keyword) Arguments\n----------------------------\n\n- path: Destination path in the S3 bucket (default: /)\n- parts: Number of multiprocessing parts to send simultaneously (default: 5)\n- partsize: Size of each part in MB (default: 100)\n- tmp: Location of local temporary directory to store temporary files created by the module (default: '/tmp')\n- purge: Whether to purge the specified file instead of uploading it (default: False)\n- requrl: The endpoint URL for backend Lambda function (default: 'https://<api_endpoint_url>')\n- reqapikey: The API key for backend Lambda function (default: '<api_key>')\n\nUsage\n-----\n\nInstallation:\n\n.. code-block:: BASH\n\n   pip3 install s3streamer\n   # or\n   python3 -m pip install s3streamer\n\nIn Python3:\n\n.. code-block:: BASH\n\n   # To upload a new file.\n   from s3streamer.s3streamer import multipart\n   response = multipart(\n       'myfile.iso', \n       'installer/images'\n   )\n\n   # To remove a file from S3.\n   from s3streamer.s3streamer import multipart\n   response = multipart(\n       'myfile.iso', \n       'installer/images', \n       purge = True\n   )\n\nIn BASH:\n\n.. code-block:: BASH\n\n   # To upload a new file.\n   python3 -c \\\n   \"from s3streamer.s3streamer import multipart; \\\n   response = multipart(\\\n   'myfile.iso', \\\n   'installer/images')\"\n\n   # To remove a file from S3.\n   python3 -c \\\n   \"from s3streamer.s3streamer import multipart; \\\n   response = multipart(\\\n   'myfile.iso', \\\n   'installer/images', \\\n   purge = True)\"\n\nIf the upload is successful, the file will be available at **installer/images/myfile.iso**.\n",
    "bugtrack_url": null,
    "license": "GPL-2.0-only",
    "summary": "Stream files to AWS S3 using multipart upload.",
    "version": "2024.1.0.0",
    "project_urls": {
        "Homepage": "https://gitlab.com/fer1035_python/modules/pypi-s3streamer",
        "Repository": "https://gitlab.com/fer1035_python/modules/pypi-s3streamer"
    },
    "split_keywords": [
        "s3",
        "aws",
        "api",
        "multipart",
        "upload"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab9a80a9030a40de880356e0b9a86209c693e3b0d3b3af3f5eb89018642d919b",
                "md5": "4c2be3ef14ccffe377a04067de040ae4",
                "sha256": "dcd8ab1503e7fda3d8af692db97e85e702080556ff104ec7c57edd589fc60d19"
            },
            "downloads": -1,
            "filename": "s3streamer-2024.1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4c2be3ef14ccffe377a04067de040ae4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 5234,
            "upload_time": "2024-02-02T05:45:43",
            "upload_time_iso_8601": "2024-02-02T05:45:43.390653Z",
            "url": "https://files.pythonhosted.org/packages/ab/9a/80a9030a40de880356e0b9a86209c693e3b0d3b3af3f5eb89018642d919b/s3streamer-2024.1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "871d70422c45541c7ca2067cd3d9e62719757315f8b773506be39a865898047b",
                "md5": "cb16ce393812feb3f3105bd6f4f91f05",
                "sha256": "457afeb3470c4ed8c6a91c82ebbac4a33eaf210e81374eeecb223ad491b163cf"
            },
            "downloads": -1,
            "filename": "s3streamer-2024.1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cb16ce393812feb3f3105bd6f4f91f05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 4651,
            "upload_time": "2024-02-02T05:45:45",
            "upload_time_iso_8601": "2024-02-02T05:45:45.076152Z",
            "url": "https://files.pythonhosted.org/packages/87/1d/70422c45541c7ca2067cd3d9e62719757315f8b773506be39a865898047b/s3streamer-2024.1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-02 05:45:45",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "fer1035_python",
    "gitlab_project": "modules",
    "lcname": "s3streamer"
}
        
Elapsed time: 0.17677s