Metadata-Version: 2.1
Name: mmgmt
Version: 0.5.3
Summary: 
Home-page: https://github.com/will-wright-eng/media-mgmt-cli
License: GNU GPL v3.0
Author: Will Wright
Author-email: willwright@example.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: PyYAML (>=6.0,<7.0)
Requires-Dist: boto3 (>=1.26.54,<2.0.0)
Requires-Dist: botocore (>=1.29.54,<2.0.0)
Requires-Dist: certifi (>=2022.12.7,<2023.0.0)
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
Requires-Dist: pytest (>=7.2.1,<8.0.0)
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: s3transfer (>=0.6.0,<0.7.0)
Requires-Dist: six (>=1.16.0,<2.0.0)
Requires-Dist: urllib3 (>=1.26.14,<2.0.0)
Project-URL: Repository, https://github.com/will-wright-eng/media-mgmt-cli
Description-Content-Type: text/markdown

# Media Management Command Line Interface

[![PyPI](https://img.shields.io/pypi/v/mmgmt)](https://pypi.org/project/mmgmt/)
[![Downloads](https://static.pepy.tech/badge/mmgmt/month)](https://pepy.tech/project/mmgmt)
[![Supported Versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)](https://pypi.org/project/mmgmt/)
[![Contributors](https://img.shields.io/github/contributors/will-wright-eng/media-mgmt-cli.svg)](https://github.com/will-wright-eng/media-mgmt-cli/graphs/contributors)
[![Tests](https://github.com/will-wright-eng/media-mgmt-cli/workflows/Test/badge.svg)](https://github.com/will-wright-eng/media-mgmt-cli/actions?query=workflow%3ATest)
[![Codeball](https://github.com/will-wright-eng/media-mgmt-cli/actions/workflows/codeball.yml/badge.svg)](https://github.com/will-wright-eng/media-mgmt-cli/actions/workflows/codeball.yml)


## Summary

**An intuitive command line interface wrapper around boto3 to search and manage media assets**

## Installing `mmgmt` & Supported Versions

`mmgmt` is available on PyPI:

```bash
python -m pip install mmgmt
```

Media Management Command Line Interface officially supports Python 3.8+.

## Supported Features & Usage

For help, run:

```bash
mmgmt --help
```

You can also use:

```bash
python -m mmgmt --help
```

Commands:

```bash
Usage: mmgmt [OPTIONS] COMMAND [ARGS]...

  A simple CLI to search and manage media assets in S3 and locally. Setup with
  `mmgmt configure`

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  configure   print project configs & set configs manually
  delete      delete file from cloud storage - TODO -
  download    download object from cloud storage
  get-status  get object head from cloud storage
  hello       test endpoint
  ls          list files in location (local, s3, or global)
  search      search files in local directory and cloud storage
  upload      upload file to cloud storage
```

Why not use `awscli`?

You can, and I do, in tandem with `mmgmt` -- the purpose is to create an additional interface that minimized the lookup/copy/paste process I found myself frequently going through.

Another use case is for rapid prototyping applications that require an S3 interface.

For example:

```python
import pandas as pd
import mmgmt as mmgmt

aws = mmgmt.AwsStorageMgmt(project_name="mmgmt")
obj_list = aws.get_bucket_objs()

res = []
for s3_obj in obj_list:
    res.append(
      [
        str(s3_obj.key),
        str(s3_obj.key.split('/')[0]),
        s3_obj.last_modified,
        s3_obj.storage_class,
        s3_obj.size
      ]
    )

df = pd.DataFrame(res)
df.columns = [
  'key',
  'group',
  'last_modified',
  'storage_class',
  'size'
]
```

## Development

To contribute to this tool, first checkout the code:

```bash
git clone https://github.com/will-wright-eng/media-mgmt-cli.git
cd media-mgmt-cli
```

Then create a new virtual environment:

```bash
python -m venv venv
source venv/bin/activate
```

Now install the dependencies and test dependencies:

```bash
pip install -e '.[test]'
```

To run the tests:

```bash
pytest
```

Install pre-commit before submitting a PR:

```bash
brew install pre-commit
pre-commit install
```

## References

- [PyPI Package](https://pypi.org/project/mmgmt)
- Based on cookiecutter template [will-wright-eng/click-app](https://github.com/will-wright-eng/click-app)
- Rewrite of original project [will-wright-eng/media_mgmt_cli](https://github.com/will-wright-eng/media_mgmt_cli)

