semvec/pypi-packages huggingface dataset:
frexco-pylogger 0.2.5
Python library for logging with colors and http status code.
Keywords: logs logging logger

# **Frexco PyLogger**

## Install

___

```bash
pip install frexco_pylogger
```

## Configure

___

```python
# main.py
from frexco_pylogger.functions import PyLogger

logger = PyLogger(appname="my_app")
logger.http(message="Uma mensagem http qualquer", status_code=200, data={"name": "Um nome qualquer", "age": 22})
```

> 2022-09-02 14:05:59 | [HTTP   ] | Uma mensagem http qualquer | [STATUSCODE 200] | {'name': 'Um nome qualquer', 'age': 22}

## Log Types

___

| Tipo      | Description                                                        |
|-----------|--------------------------------------------------------------------|
| `error`   | Informar sobre exceptions tratadas                                 |
| `warning` | Informar eventos ou estados potencialmente prejudicias ao programa |
| `debug`   | Acompanhar eventos ou estados do programa                          |
| `info`    | Descrever infos detalhadas sobre o estado do programa              |
| `http`    | Informar dados de requests e responses feitas via http             |

## Middlewares

___

### django

```python
# httpLogger.py
from frexco_pylogger.functions import PyLogger
from django.utils.deprecation import MiddlewareMixin


class HTTPLoggerMiddleware(MiddlewareMixin):

    def process_response(self, request, response):
        logger = PyLogger(appname="my_django_app")
        logger.http(message=f'{request.META.get("REMOTE_ADDR")} {request.method} {request.META.get("PATH_INFO")}',
                    status_code=response.status_code)

        return response
```

```python
# setting.py

MIDDLEWARE = [
    ...,
    'app.utils.httpLogger.HTTPLoggerMiddleware' # path to your middleware file
]

```

### Flask

```python
# Your app setup file
from flask import Flask, request, Response
from frexco_pylogger.functions import PyLogger

app = Flask(__name__)
logger = PyLogger(appname="my_flask_app")

@app.after_request
def log_response(response: Response):
    logger.http(message=f'{request.remote_addr} {request.method} {request.path}',
                status_code=response.status_code)
    return response

```

## Alert

```python
# Seu arquivo de configuração de logger
from frexco_pylogger.functions import PyLogger

logger = PyLogger(appname="my_app_name", group="nome_do_grupo") # Ex: group="warehouse", Ex: group="consumer"

logger.error(message="Uma messagem de error qualquer",
            status_code=500, data={"name": "Um error"}) # Enviar alerta

logger.error(message="Uma messagem de error qualquer repetida",
            status_code=500, data={"name": "Um error"}, alert=False) # Não enviar alerta
```
staremaster 0.0.5
STARE sidecar creator
Requires Python: >=3.7

STAREMaster_py is the python implementation of STAREMaster. 
It is used to create sidecar files for a collection of remote sensing products

# Install

## With pip
The installer will install the create_sidecar_files.py script and its dependencies.

Create a virtualenv:

    mkvirtualevironment staremaster_py

Install from pypi

   pip install staremaster
   
we then can install STAREMaster_py with 

    pip3 install -e STAREMaster_py/

## pyhdf issues

Installing pyhdf from pip does not always seem to be trivially possible. 
Simple workaround is using conda;

    conda create --name staremaster
    conda activate staremaster
    conda install -c conda-forge pyhdf

Then:

    pip3 install -e STAREMaster_py/
    




# Requirements

* pystare
* pyhdf
* numpy
* netCDF4
* argparse
* xarray
* dask['distributed']
* filelock

xarray and dask are hardcoded dependecies, but will become optional in the future

# Usage

```
usage: create_sidecar_files.py [-h] [--folder folder] [--files files [files ...]] [--grid files] [--out_path OUT_PATH]
                               [--product product] [--cover_res cover_res] [--workers n_workers] [--archive archive]
                               [--parallel_files]

Creates Sidecar Files

optional arguments:
  -h, --help            show this help message and exit
  --folder folder       the folder to create sidecars for
  --files files [files ...]
                        the files to create a sidecar for
  --grid files          the grid to create a sidecar for (e.g. IMERG)
  --out_path OUT_PATH   the folder to create sidecars in; default: next to granule
  --product product     product (e.g. cldmsk_l2_viirs, hdfeos, l2_viirs, mod05, mod09, vj102dnb, vj103dnb, vnp02dnb, vnp03dnb,
                        ssmi)
  --cover_res cover_res
                        max STARE resolution of the cover. Default: min resolution of iFOVs
  --workers n_workers   use n_workers (local) dask workers
  --archive archive     Create sidecars only for granules not listed in the archive file. Record all create sidecars and their
                        corresponding granules in it.
  --parallel_files      Process files in parallel rather than looking up SIDs in parallel

```

e.g.

```bash
python3 create_sidecar_files.py --workers 4 
       --product MOD09 --file ~/MOD09.A2019317.0815.006.2019319020759.hdf
```

# Extension
To add support for additional products, we need the following:

1. a module in products/ containing 
    * a class for the product that implements the reading of the geolocation and the gring 
    * a method that implements the write_sidecar() function
2. an import of the new module in products/\_\_init\_\_.py
3. argument parsing and switch for the added product in create_sidecar_files.py
battleshippygame 1.0.0
Play Battleship in the Terminal!

######################
This project is made for educational and entertainment purposes only
I (David H Peterson) do not own the rights to the original game, aka "Battleship"
######################

To play the game, please type the following into a python source file:

######################
import battleship
battleship.startup()
battleship.game()
######################

There, now you can play battleship in the terminal!