{ "info": { "author": "Christopher H. Todd", "author_email": "Christopher.Hayden.Todd@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8" ], "description": "# Christopher H. Todd's PROJECT_STRING_NAME\n\nThe PROJECT_GIT_NAME project is responsible for ...\n\nThe library ...\n\n## Table of Contents\n\n- [Dependencies](#dependencies)\n- [Libraries](#libraries)\n- [Example Scripts](#example-scripts)\n- [Notes](#notes)\n- [TODO](#todo)\n\n## Dependencies\n\n### Python Packages\n\n-\n\n## Libraries\n\n### [minio_bucket_helpers.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_bucket_helpers.py)\n\nThis library is used to interact with Minio object storage. Will handle functions used to interact with buckets (creating, downloading, finding, etc)\n\nFunctions:\n\n```\ndef get_buckets(minio_client):\n \"\"\"\n Purpose:\n Get a list of buckets that exist in the Minio Client\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n Returns:\n buckets (List of Bucket Objs): List of Bucket OBJs in Minio\n \"\"\"\n```\n\n```\ndef get_bucket_names(minio_client):\n \"\"\"\n Purpose:\n Get a list of buckets that exist in the Minio Client\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n Returns:\n bucket_names (List of Strings): List of Buckets in Minio\n \"\"\"\n\n```\n\n```\ndef create_bucket(minio_client, bucket_name):\n \"\"\"\n Purpose:\n Create a specified Bucket by name\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of bucket to create\n Returns:\n N/A\n \"\"\"\n```\n\n```\ndef delete_bucket(minio_client, bucket_name):\n \"\"\"\n Purpose:\n Delete a specified Bucket by name\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of bucket to delete\n Returns:\n N/A\n \"\"\"\n```\n\n### [minio_client.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_client.py)\n\nMinioClient Class for interacting with minio object store. Objects will be created connected to Minio\n\nClasses:\n\n```\nclass MinioClient(object):\n \"\"\"\n MinioClient Class. Class objects will hold connection to the\n Minio service and can be used to interact with buckets and objects\n \"\"\"\n```\n\n### [minio_connection_helpers.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_connection_helpers.py)\n\nThis library is used to interact with Minio object storage. Functions establish a connection to the Minio service that can be used to interact with the service and pass to the other helper functions\n\nFunctions:\n\n```\ndef connect_to_minio(minio_url, access_key=None, secret_key=None, secure=False):\n \"\"\"\n Purpose:\n Connect to Minio and return the minio_client of minio lib\n Args:\n minio_url (String): URL of Minio\n access_key (String): Access Key for Minio\n secret_key (String): Secret Key for Minio\n Returns:\n minio_client (minio client Obj): Client obj connection to Minio\n \"\"\"\n```\n\n```\ndef build_minio_url(minio_host, minio_port=9000):\n \"\"\"\n Purpose:\n Create the Minio URL from host and port\n Args:\n minio_host (String): Host of Minio\n minio_host (Int): Port of Minio (Defaults to 9000)\n Returns:\n minio_url (String): URL of Minio\n \"\"\"\n```\n\n### [minio_exceptions.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_exceptions.py)\n\nFile for holding custom exception types that will be generated by the minio_helpers libraries\n\nExceptions:\n\n```\nclass BucketAlreadyExists(Exception):\n \"\"\"\n Purpose:\n The BucketAlreadyExists will be raised when attempting to create a bucket\n that already exists\n \"\"\"\n```\n\n```\nclass BucketDoesntExist(Exception):\n \"\"\"\n Purpose:\n The BucketDoesntExist will be raised when attempting to delete a bucket\n that doesn't exist in Minio\n \"\"\"\n```\n\n```\nclass ObjectAlreadyExists(Exception):\n \"\"\"\n Purpose:\n The ObjectAlreadyExists will be raised when attempting to create an object\n that already exists\n \"\"\"\n```\n\n```\nclass ObjectDoesntExist(Exception):\n \"\"\"\n Purpose:\n The ObjectDoesntExist will be raised when attempting to pull an object\n that doesn't exist in Minio\n \"\"\"\n```\n\n```\nclass ObjectDecodingNotSupported(Exception):\n \"\"\"\n Purpose:\n The ObjectDecodingNotSupported will be raised when attempting to decode a\n filetype from Minio that is not yet supported (such as .avro)\n \"\"\"\n```\n\n\n### [minio_general_helpers.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_general_helpers.py)\n\nThis library is used to interact with Minio object storage.\n\nFunctions:\n\n### N/A\n\n### [minio_object_helpers.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/master/minio_helpers/minio_object_helpers.py)\n\n\nExample executable Python scripts/modules for testing and interacting with the library. These show example use-cases for the libraries and can be used as templates for developing with the libraries or to use as one-off development efforts.\n\nFunctions:\n\n```\ndef get_objects(minio_client, bucket_name):\n \"\"\"\n Purpose:\n Get a list of objects that exist in the Minio Client\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to get objects for\n Returns:\n objects (List of Object Objs): List of Object OBJs in Minio\n \"\"\"\n```\n\n```\ndef get_object_names(minio_client, bucket_name):\n \"\"\"\n Purpose:\n Get a list of objects that exist in the Minio Client\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to get objects for\n Returns:\n object_names (List of Strings): List of Objects in Minio\n \"\"\"\n```\n\n```\ndef is_object_in_bucket(minio_client, bucket_name, object_name):\n \"\"\"\n Purpose:\n Check if Object exists in Bucket\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to check for object\n object_name (String): Name of object to check for in Minio\n Returns:\n object_exists (Boolean): Boolean if the object exists or not\n \"\"\"\n```\n\n```\ndef get_object_stats(minio_client, bucket_name, object_name):\n \"\"\"\n Purpose:\n Get Stats of the Object\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to check for object\n object_name (String): Name of object to get stats for in Minio\n Returns:\n object_stats (Dict):Dict of stats about the object\n \"\"\"\n```\n\n```\ndef download_object_to_memory(minio_client, bucket_name, object_name, encoding=\"utf-8\"):\n \"\"\"\n Purpose:\n Download an Object from Mino into memory (if supported)\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to get object from\n filename (String): Location (And Path) of file to upload\n object_name (String): Name of object to upload in Minio\n Returns:\n parsed_object (Obj, depending on extension): Object parsed from Minio from the\n extension of the file. Current supported = .txt -> str, .json -> Dict/JSON\n \"\"\"\n```\n\n```\ndef download_object_to_file(minio_client, bucket_name, object_name, filename=None):\n \"\"\"\n Purpose:\n Download a file from Minio to local storage\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to get object from\n filename (String): Location (And Path) of file to upload\n object_name (String): Name of object to upload in Minio\n Returns:\n N/A\n \"\"\"\n```\n\n```\ndef upload_object(minio_client, bucket_name, filename, object_name=None):\n \"\"\"\n Purpose:\n Uploading a local file to Minio\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n bucket_name (String): Name of the bucket to get to upload object to\n filename (String): Location (And Path) of file to upload\n object_name (String): Name of object to upload in Minio\n Returns:\n N/A\n \"\"\"\n```\n\n```\ndef delete_object(minio_client, bucket_name, object_name):\n \"\"\"\n Purpose:\n Delete a specified Object by name\n Args:\n minio_client (minio client Obj): Client obj connection to Minio\n object_name (String): Name of object in Minio to delete\n Returns:\n N/A\n \"\"\"\n```\n\n## Example Scripts\n\nExample executable Python scripts/modules for testing and interacting with the library. These show example use-cases for the libraries and can be used as templates for developing with the libraries or to use as one-off development efforts.\n\n### [connect_to_minio.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/develop/example_usage/connect_to_minio.py)\n\n```\nPurpose:\n Connecting to Minio\n\nSteps:\n - Connect to Minio\n\nfunction call:python3 connect_to_minio {--access-key=access_key} \\\n {--secret-key=secret_key} {--minio-host=minio_host} {--minio-port=minio_port}\n```\n\n### [create_bucket_in_minio.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/develop/example_usage/create_bucket_in_minio.py)\n\n```\nPurpose:\n Create Bucket in Minio\n\nSteps:\n - Connect to Minio\n - Create a Bucket\n\nfunction call:python3 create_bucket_in_minio.py {--access-key=access_key} \\\n {--secret-key=secret_key} {--minio-host=minio_host} {--minio-port=minio_port} \\\n {--bucket-name=bucket_name}\n```\n\n### [delete_bucket_from_minio.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/develop/example_usage/delete_bucket_from_minio.py)\n\n```\nPurpose:\n Delete Bucket from Minio\n\nSteps:\n - Connect to Minio\n - Delete a Bucket\n\nfunction call:python3 delete_bucket_from_minio.py {--access-key=access_key} \\\n {--secret-key=secret_key} {--minio-host=minio_host} {--minio-port=minio_port} \\\n {--bucket-name=bucket_name}\n```\n\n### [get_objects_from_bucket.py](https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio/blob/develop/example_usage/get_objects_from_bucket.py)\n\n```\nPurpose:\n Get all Objects (Or a Specific Object) From a Bucket in Minio\n\nSteps:\n - Connect to Minio\n - Get the Bucket Obj\n - Get objects from Minio and store locally\n\nfunction call:python3 get_objects_from_Bucket.py {--access-key=access_key} \\\n {--secret-key=secret_key} {--minio-host=minio_host} {--minio-port=minio_port} \\\n {--bucket-name=bucket_name} {--object-name=object_name}\n```\n\n## Notes\n\n - Relies on f-string notation, which is limited to Python3.6. A refactor to remove these could allow for development with Python3.0.x through 3.5.x\n\n## TODO\n\n - Unittest framework in place, but lacking tests\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio", "keywords": "python,libraries,minio,object storage", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ctodd-python-lib-minio", "package_url": "https://pypi.org/project/ctodd-python-lib-minio/", "platform": "", "project_url": "https://pypi.org/project/ctodd-python-lib-minio/", "project_urls": { "Homepage": "https://github.com/ChristopherHaydenTodd/ctodd-python-lib-minio" }, "release_url": "https://pypi.org/project/ctodd-python-lib-minio/1.0.2/", "requires_dist": [ "minio (>=4.0.11)", "simplejson (>=3.16.0)" ], "requires_python": ">3.6", "summary": "Python utilities used for interacting with Minio Object Storage", "version": "1.0.2" }, "last_serial": 5170344, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "b4b6b4d743105108484e83f08a9c35b9", "sha256": "4d8eee6c0971458cbd2309aa06f89988ae47ccac1a92d33a31771963ad25f036" }, "downloads": -1, "filename": "ctodd_python_lib_minio-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b4b6b4d743105108484e83f08a9c35b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 12745, "upload_time": "2019-04-21T17:29:13", "url": "https://files.pythonhosted.org/packages/35/d6/a2036ea6d8672aa83c60d6351b3e3a7ce8415fd33b918f5654ba0c9343e6/ctodd_python_lib_minio-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f8c84c2a63e15f5daa3683450ff09bd", "sha256": "04ced019ab93f1ddb754e3ea0ec2e86cee78672aa8501eb4917fcf41e373ba5f" }, "downloads": -1, "filename": "ctodd-python-lib-minio-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9f8c84c2a63e15f5daa3683450ff09bd", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 10443, "upload_time": "2019-04-21T17:29:15", "url": "https://files.pythonhosted.org/packages/a4/de/8c72bb9d42edf2deb6b06e38036776b25553e7213d3491e205edda606053/ctodd-python-lib-minio-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4be9971a93db9ac2895cee2e42eaa441", "sha256": "fb7dd013aa44ac9f894f84b3655a6d4ad02a2e0661f228bd64c1690d7e18f882" }, "downloads": -1, "filename": "ctodd_python_lib_minio-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4be9971a93db9ac2895cee2e42eaa441", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 12750, "upload_time": "2019-04-21T17:38:50", "url": "https://files.pythonhosted.org/packages/6c/9b/e2246a46a3f7d23dbb12246c6cae0a984b93b38ae03eff96e483488e4989/ctodd_python_lib_minio-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e3ae11090a82ba22010ba26dbfb2862", "sha256": "025f3986c54bbcb27fdf589b76e171235becf3dbd42cb067c7d246a4b586838f" }, "downloads": -1, "filename": "ctodd-python-lib-minio-1.0.2.tar.gz", "has_sig": false, "md5_digest": "1e3ae11090a82ba22010ba26dbfb2862", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 10431, "upload_time": "2019-04-21T17:38:51", "url": "https://files.pythonhosted.org/packages/7d/21/49a767ff8f842d017b93603a20306837db081b853b6307964610276fc9e6/ctodd-python-lib-minio-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4be9971a93db9ac2895cee2e42eaa441", "sha256": "fb7dd013aa44ac9f894f84b3655a6d4ad02a2e0661f228bd64c1690d7e18f882" }, "downloads": -1, "filename": "ctodd_python_lib_minio-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4be9971a93db9ac2895cee2e42eaa441", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">3.6", "size": 12750, "upload_time": "2019-04-21T17:38:50", "url": "https://files.pythonhosted.org/packages/6c/9b/e2246a46a3f7d23dbb12246c6cae0a984b93b38ae03eff96e483488e4989/ctodd_python_lib_minio-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e3ae11090a82ba22010ba26dbfb2862", "sha256": "025f3986c54bbcb27fdf589b76e171235becf3dbd42cb067c7d246a4b586838f" }, "downloads": -1, "filename": "ctodd-python-lib-minio-1.0.2.tar.gz", "has_sig": false, "md5_digest": "1e3ae11090a82ba22010ba26dbfb2862", "packagetype": "sdist", "python_version": "source", "requires_python": ">3.6", "size": 10431, "upload_time": "2019-04-21T17:38:51", "url": "https://files.pythonhosted.org/packages/7d/21/49a767ff8f842d017b93603a20306837db081b853b6307964610276fc9e6/ctodd-python-lib-minio-1.0.2.tar.gz" } ] }