flask-and-minio


Nameflask-and-minio JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/heysaeid/flask-and-minio.git
SummaryEverything you need to use MinIO in flask
upload_time2023-06-30 19:08:39
maintainer
docs_urlNone
authorSaeid Noormohammadi
requires_python
licenseMIT
keywords flask minio flask minio flask flask-minio flask-and-minio flask-and-minio minio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flask And MinIO
FlaskAndMinio allows you to easily use MinIO in your Flask projects and offers some features to improve and ease things.

## Install
You can either download the source code of this repository or install it via pip:
```
pip install flask-and-minio
```

## Usage
You can add it to your program in the following two ways:
```
from flask import Flask
from flask_and_minio import FlaskAndMinio

app = Flask(__name__)
app.config['MINIO_ENDPOINT'] = 'localhost:9000'
app.config['MINIO_ACCESS_KEY	'] = 'minioadmin'
app.config['MINIO_SECRET_KEY'] = 'minioadmin'
minio = FlaskAndMinio(app)

mc = minio.get_client() # This client method returns the minio for direct use
minio.get_url('bucket', 'object-name.png')
minio.remove_file('bucket', 'object-name.png')
```
Or:
```
from flask import Flask
from flask_and_minio import FlaskAndMinio

app = Flask(__name__)
minio = FlaskAndMinio()
app.config['MINIO_ENDPOINT'] = 'localhost:9000'
app.config['MINIO_ACCESS_KEY	'] = 'minioadmin'
app.config['MINIO_SECRET_KEY'] = 'minioadmin'
minio.init_app(app)

mc = minio.get_client() # This client method returns the minio for direct use
minio.get_url('bucket', 'object-name.png')
minio.remove_file('bucket', 'object-name.png')
```

Configurations:
| Variable                               | Default value       | Description                                                    |
| -------------                          |:-------------:      |:-------------:                                                 |
| MINIO_ENDPOINT                         | localhost:9000      | URL to S3 service.                                             |
| MINIO_ACCESS_KEY                       | minioadmin          | Access key (aka user ID) of an account in the S3 service.      |
| MINIO_SECRET_KEY                       | minioadmin          | Secret key (aka password) of an account in the S3 service.     |
| MINIO_SECURE                           | True                | Use HTTPS.                                                     |
| MINIO_REGION                           | None                | Set region.                                                    |
| MINIO_HTTP_CLIENT                      | None                | Customized HTTP client.                                        |
| MINIO_LOAD_BALANCER_URL                | None                | If you use load balancer for s3, you can have urls with this domain by setting this value                                    |



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/heysaeid/flask-and-minio.git",
    "name": "flask-and-minio",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "flask,minio,flask minio,flask ,flask-minio,flask-and-minio,Flask-And-Minio,MinIO",
    "author": "Saeid Noormohammadi",
    "author_email": "heysaeid92@gmail.com",
    "download_url": "",
    "platform": "any",
    "description": "# Flask And MinIO\nFlaskAndMinio allows you to easily use MinIO in your Flask projects and offers some features to improve and ease things.\n\n## Install\nYou can either download the source code of this repository or install it via pip:\n```\npip install flask-and-minio\n```\n\n## Usage\nYou can add it to your program in the following two ways:\n```\nfrom flask import Flask\nfrom flask_and_minio import FlaskAndMinio\n\napp = Flask(__name__)\napp.config['MINIO_ENDPOINT'] = 'localhost:9000'\napp.config['MINIO_ACCESS_KEY\t'] = 'minioadmin'\napp.config['MINIO_SECRET_KEY'] = 'minioadmin'\nminio = FlaskAndMinio(app)\n\nmc = minio.get_client() # This client method returns the minio for direct use\nminio.get_url('bucket', 'object-name.png')\nminio.remove_file('bucket', 'object-name.png')\n```\nOr:\n```\nfrom flask import Flask\nfrom flask_and_minio import FlaskAndMinio\n\napp = Flask(__name__)\nminio = FlaskAndMinio()\napp.config['MINIO_ENDPOINT'] = 'localhost:9000'\napp.config['MINIO_ACCESS_KEY\t'] = 'minioadmin'\napp.config['MINIO_SECRET_KEY'] = 'minioadmin'\nminio.init_app(app)\n\nmc = minio.get_client() # This client method returns the minio for direct use\nminio.get_url('bucket', 'object-name.png')\nminio.remove_file('bucket', 'object-name.png')\n```\n\nConfigurations:\n| Variable                               | Default value       | Description                                                    |\n| -------------                          |:-------------:      |:-------------:                                                 |\n| MINIO_ENDPOINT                         | localhost:9000      | URL to S3 service.                                             |\n| MINIO_ACCESS_KEY                       | minioadmin          | Access key (aka user ID) of an account in the S3 service.      |\n| MINIO_SECRET_KEY                       | minioadmin          | Secret key (aka password) of an account in the S3 service.     |\n| MINIO_SECURE                           | True                | Use HTTPS.                                                     |\n| MINIO_REGION                           | None                | Set region.                                                    |\n| MINIO_HTTP_CLIENT                      | None                | Customized HTTP client.                                        |\n| MINIO_LOAD_BALANCER_URL                | None                | If you use load balancer for s3, you can have urls with this domain by setting this value                                    |\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Everything you need to use MinIO in flask",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/heysaeid/flask-and-minio.git"
    },
    "split_keywords": [
        "flask",
        "minio",
        "flask minio",
        "flask ",
        "flask-minio",
        "flask-and-minio",
        "flask-and-minio",
        "minio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9531d1cf40e1b414abf45f4b5b7980ee2c12a8935e7dd37c63d901eaab1eea85",
                "md5": "37fb88b6431f0f9bb3c4d8ec8f14c31b",
                "sha256": "0a514c1a0163d16858b03468ac3775d5e8293bd24c0a90d67bb5d00f5d6b0316"
            },
            "downloads": -1,
            "filename": "flask_and_minio-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37fb88b6431f0f9bb3c4d8ec8f14c31b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3842,
            "upload_time": "2023-06-30T19:08:39",
            "upload_time_iso_8601": "2023-06-30T19:08:39.394849Z",
            "url": "https://files.pythonhosted.org/packages/95/31/d1cf40e1b414abf45f4b5b7980ee2c12a8935e7dd37c63d901eaab1eea85/flask_and_minio-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-30 19:08:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "heysaeid",
    "github_project": "flask-and-minio",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "flask-and-minio"
}
        
Elapsed time: 0.10925s