semvec/pypi-packages huggingface dataset:
make-py 0.1.1
A make equivalent in Python
Requires Python: >=3.6

# make.py

[![PyPI version](https://badge.fury.io/py/make-py.svg)](https://badge.fury.io/py/make-py)

`make.py` is like `make` but with its build configuration written in Python.

## Example

For the following `Makefile`:

```makefile
CC=gcc
OUTPUT=build

all: $(OUTPUT)/main

$(OUTPUT)/%.o: %.c
	mkdir -p $(dir $@)
	$(CC) -MMD -c $< -o $@

$(OUTPUT)/main: $(OUTPUT)/hello.o $(OUTPUT)/main.o
	$(CC) $^ -o $@

clean:
	rm -rf $(OUTPUT)

.PHONY: clean

-include $(OUTPUT)/*.d
```

The equivalent `Makefile.py` is:

```python
from pathlib import Path
from shutil import rmtree
from subprocess import check_call

from make_py import task, rule, phony_task

CC = "gcc"
OUTPUT = "build"

phony_task("all", f"{OUTPUT}/main")


def collect_c_dependencies(target, target_regex_groups):
    dep_file = Path(target).with_suffix(".d")
    if dep_file.exists():
        return dep_file.read_text().split(":")[1].strip().split(" ")


# missing parent directories will be made automatically
@rule(f"{OUTPUT}/%.o", ["%.c", collect_c_dependencies])
def compile_c(ctx):
    check_call([CC, "-MMD", "-c", ctx.source, "-o", ctx.target])


@rule(f"{OUTPUT}/main", [f"{OUTPUT}/{o}" for o in ["hello.o", "main.o"]])
def link(ctx):
    check_call([CC, *ctx.sources, "-o", ctx.target])


@task()
def clean(ctx):
    rmtree(OUTPUT, ignore_errors=True)
```

The commands can be executed by `make.py` the same way as executing `make`

For more examples, refer to the `examples` folder in project root.
flask-minio-factory 0.1.2
A package, which provides easy usage for minio with flask

## Flask minio factory

  A package, which provides easy usage for minio with flask.

  Via this package you can easily create this connection
  - with directly creating a minio instance
  - or by using the application factory pattern

  ### Intallation

  You can install the package from pip:

  ```
  pip install flask-minio-factory
  ```

  ### Usage

  If you want to create a minio instance directly
  you can achieve it by:

  ```
  from flask import Flask
  from flask_minio import Minio

  app = Flask(__name__)
  minio_client = Minio(app)
  ```

  If you want to create the client via the application
  factory, you are able to do that with:

  ```
  from flask import Flask, send_file
  from flask_minio import Minio

  app = Flask(__name__)

  minio = Minio()
  minio.init_app(app)
  ```

  If you have the client you can simply call the available
  methods on it:
  ```
  @app.route("/img/<id_>")
  def query_image(id_):
      with NamedTemporaryFile(suffix="png") as file:
          minio.fget_object("img", id_, file.name)

          return send_file(file.name)
  ```

  (an example code can be tested under `/example`)

  The following config variables are avialble in the flask config:

  |Variable|Description|Default|
  |-|-|-|
  |MINIO_URL| Hostname of a S3 service.| - |
  |MINIO_ACCESS_KEY| (Optional) Access key (aka user ID) of your account in S3 service.| - |
  |MINIO_SECRET_KEY| (Optional) Secret Key (aka password) of your account in S3 service.| - |
  |MINIO_SESSION_TOKEN| (Optional) Session token of your account in S3 service.| - |
  |MINIO_SECURE_CONNECTION| (Optional) Flag to indicate to use secure (TLS) connection to S3 service or not.| `False` |
  |MINIO_REGION| (Optional) Region name of buckets in S3 service.| - |
  |MINIO_HTTP_CLIENT| (Optional) Customized HTTP client.| - |
  |MINIO_CREDENTIALS| (Optional) Credentials of your account in S3 service.| - |
  |MINIO_BUCKETS| (Optional) A list of buckets, that should be created at startup | - |