# minio

> MinIO Python SDK for Amazon S3 Compatible Cloud Storage

- **URL**: https://www.freshcrate.ai/projects/minio
- **Author**: MinIO
- **Category**: Databases
- **Latest version**: `7.2.20` (2026-04-21)
- **License**: Apache-2.0
- **Source**: https://github.com/minio/minio-py/releases
- **Homepage**: https://github.com/minio/minio-py
- **Language**: Python
- **GitHub**: 1,050 stars, 367 forks
- **Registry**: pypi (`minio`)
- **Tags**: `pypi`

## Description

# MinIO Python Client SDK for Amazon S3 Compatible Cloud Storage [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/minio/minio-py/blob/master/LICENSE)

The MinIO Python Client SDK provides high level APIs to access any MinIO Object Storage or other Amazon S3 compatible service.

This Quickstart Guide covers how to install the MinIO client SDK, connect to the object storage service, and create a sample file uploader.

The example below uses:
- [Python version 3.7+](https://www.python.org/downloads/) 
- The [MinIO `mc` command line tool](https://min.io/docs/minio/linux/reference/minio-mc.html)
- The MinIO `play` test server

The `play` server is a public MinIO cluster located at [https://play.min.io](https://play.min.io).
This cluster runs the latest stable version of MinIO and may be used for testing and development.
The access credentials in the example are open to the public and all data uploaded to `play` should be considered public and world-readable.

For a complete list of APIs and examples, see the [Python Client API Reference](https://min.io/docs/minio/linux/developers/python/API.html)

## Install the MinIO Python SDK

The Python SDK requires Python version 3.7+.
You can install the SDK with `pip` or from the [`minio/minio-py` GitHub repository](https://github.com/minio/minio-py):

### Using `pip`

```sh
pip3 install minio
```

### Using Source From GitHub

```sh
git clone https://github.com/minio/minio-py
cd minio-py
python setup.py install
```

## Create a MinIO Client

To connect to the target service, create a MinIO client using the `Minio()` method with the following required parameters:

| Parameter    | Description                                            |
|--------------|--------------------------------------------------------|
| `endpoint`   | URL of the target service.                             |
| `access_key` | Access key (user ID) of a user account in the service. |
| `secret_key` | Secret key (password) for the user account.            |

For example:

```py
from minio import Minio

client = Minio("play.min.io",
    access_key="Q3AM3UQ867SPQQA43P2F",
    secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
)
```

## Example - File Uploader

This example does the following:

- Connects to the MinIO `play` server using the provided credentials.
- Creates a bucket named `python-test-bucket` if it does not already exist.
- Uploads a file named `test-file.txt` from `/tmp`, renaming it `my-test-file.txt`.
- Verifies the file was created using [`mc ls`](https://min.io/docs/minio/linux/reference/minio-mc/mc-ls.html).

### `file_uploader.py`

```py
# file_uploader.py MinIO Python SDK example
from minio import Minio
from minio.error import S3Error

def main():
    # Create a client with the MinIO server playground, its access key
    # and secret key.
    client = Minio("play.min.io",
        access_key="Q3AM3UQ867SPQQA43P2F",
        secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
    )

    # The file to upload, change this path if needed
    source_file = "/tmp/test-file.txt"

    # The destination bucket and filename on the MinIO server
    bucket_name = "python-test-bucket"
    destination_file = "my-test-file.txt"
    
    # Make the bucket if it doesn't exist.
    found = client.bucket_exists(bucket_name)
    if not found:
        client.make_bucket(bucket_name)
        print("Created bucket", bucket_name)
    else:
        print("Bucket", bucket_name, "already exists")

    # Upload the file, renaming it in the process
    client.fput_object(
        bucket_name, destination_file, source_file,
    )
    print(
        source_file, "successfully uploaded as object",
        destination_file, "to bucket", bucket_name,
    )

if __name__ == "__main__":
    try:
        main()
    except S3Error as exc:
        print("error occurred.", exc)
```

To run this example:

1. Create a file in `/tmp` named `test-file.txt`.
   To use a different path or filename, modify the value of `source_file`.

2. Run `file_uploader.py` with the following command:

```sh
python file_uploader.py
```

If the bucket does not exist on the server, the output resembles the following:

```sh
Created bucket python-test-bucket
/tmp/test-file.txt successfully uploaded as object my-test-file.txt to bucket python-test-bucket
```

3. Verify the uploaded file with `mc ls`:

```sh
mc ls play/python-test-bucket
[2023-11-03 22:18:54 UTC]  20KiB STANDARD my-test-file.txt
```

## More References

* [Python Client API Reference](https://min.io/docs/minio/linux/developers/python/API.html)
* [Examples](https://github.com/minio/minio-py/tree/master/examples)

## Explore Further

* [Complete Documentation](https://min.io/docs/minio/kubernetes/upstream/index.html)

## Contribute

[Contributors Guide](https://github.com/minio/minio-py/blob/master/CONTRIBUTING.md)

## License

This SDK is distributed under

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `7.2.20` | 2026-04-21 | Low | Imported from PyPI (7.2.20) |
| `7.2.19` | 2025-11-24 | Low | ## What's Changed * Add region, extra_headers and extra_query_params by @balamurugana in https://github.com/minio/minio-py/pull/1505 * Make BaseException internals to be set by @balamurugana in https://github.com/minio/minio-py/pull/1521 * Fix: Add missing type annotations to serialization dataclass fields by @rraulinio in https://github.com/minio/minio-py/pull/1527 * support optional parameters in LdapIdentityProvider by @jkandasa in https://github.com/minio/minio-py/pull/1528 * Incorrect |
| `7.2.18` | 2025-09-29 | Low | ## What's Changed * fix ETag parsing in CompleteMultipartUploadResult by @balamurugana in https://github.com/minio/minio-py/pull/1518 * credentials: set expiration using object.__setattr__() by @balamurugana in https://github.com/minio/minio-py/pull/1516 * cleanup: SSE-C keys fix a misleading error message by @marktheunissen in https://github.com/minio/minio-py/pull/1514 * feat: add py.typed in setup.py by @tughril in https://github.com/minio/minio-py/pull/1513  ## New Contributors * @mar |
| `7.2.17` | 2025-09-26 | Low | ## What's Changed * MinioAdmin: allow specifying policies as dict besides file by @Alveel in https://github.com/minio/minio-py/pull/1480 * fix too-many-positional-arguments error and other issues by @balamurugana in https://github.com/minio/minio-py/pull/1504 * Credentials: redact password in URL by @balamurugana in https://github.com/minio/minio-py/pull/1511   **Full Changelog**: https://github.com/minio/minio-py/compare/7.2.16...7.2.17 |
| `7.2.16` | 2025-07-21 | Low | ## What's Changed * Add account_info Admin API by @mhkarimi1383 in https://github.com/minio/minio-py/pull/1463 * fix mypy error by @balamurugana in https://github.com/minio/minio-py/pull/1483 * put_object: add append object support by @balamurugana in https://github.com/minio/minio-py/pull/1493 * Add append_object() API by @balamurugana in https://github.com/minio/minio-py/pull/1494 * fix: type wrong in commonconfig by @hlf20010508 in https://github.com/minio/minio-py/pull/1489 * fix pip i |
| `7.2.15` | 2025-01-19 | Low | ## What's Changed * MinioAdmin: conditionally decrypt response in {attach,detach}_policy APIs by @balamurugana in https://github.com/minio/minio-py/pull/1472 * xml: prepend namespace for each path in findall() by @balamurugana in https://github.com/minio/minio-py/pull/1476 * Fix ExcludedPrefixes in set/get bucket versioning config by @vadmeste in https://github.com/minio/minio-py/pull/1475   **Full Changelog**: https://github.com/minio/minio-py/compare/7.2.14...7.2.15 |
| `7.2.14` | 2025-01-07 | Low | ## What's Changed * MinioAdmin: add IDP/LDAP attach/detach/list APIs by @balamurugana in https://github.com/minio/minio-py/pull/1470 * MinioAdmin: add {attach,detach}_policy and get_policy_entities APIs by @balamurugana in https://github.com/minio/minio-py/pull/1471   **Full Changelog**: https://github.com/minio/minio-py/compare/7.2.13...7.2.14 |
| `7.2.13` | 2024-12-18 | Low | ## What's Changed * Add NewerNoncurrentVersions in LifecycleConfig by @balamurugana in https://github.com/minio/minio-py/pull/1469 * IamAwsProvider: fix url with role name by @balamurugana in https://github.com/minio/minio-py/pull/1465   **Full Changelog**: https://github.com/minio/minio-py/compare/7.2.12...7.2.13 |
| `7.2.12` | 2024-11-26 | Low | ## What's Changed * Pass request_headers to stat_object API from fget_object API by @balamurugana in https://github.com/minio/minio-py/pull/1461 * list_objects: add extra headers and extra query parameters by @balamurugana in https://github.com/minio/minio-py/pull/1458   **Full Changelog**: https://github.com/minio/minio-py/compare/7.2.11...7.2.12 |
| `7.2.11` | 2024-11-19 | Low | ## What's Changed * prompt_object API support by @dilverse in https://github.com/minio/minio-py/pull/1450 * remove EOLed python 3.8 support by @balamurugana in https://github.com/minio/minio-py/pull/1453 * WebIdentityClientGrantsProvider: use 'id_token' as fallback to 'access_token' by @balamurugana in https://github.com/minio/minio-py/pull/1457 * fix calling cleanup function in Worker.run() to avoid race condition by @detailyang in https://github.com/minio/minio-py/pull/1455 * fix python3. |

## Citation

- HTML: https://www.freshcrate.ai/projects/minio
- Markdown: https://www.freshcrate.ai/projects/minio.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/minio/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
