semvec/pypi-packages huggingface dataset:
brightml 0.2.11
Machine Learned Auto brightness
License: MIT

<p align="center">
    <a href="#" target="_blank"><img src="./resources/logo.png"></a>
</p>

# brightml: Machine-Learned Auto brightness

[![PyPI](https://img.shields.io/pypi/pyversions/brightml.svg?style=flat-square&logo=python)](https://pypi.python.org/pypi/brightml/)
[![PyPI](https://img.shields.io/pypi/v/brightml.svg?style=flat-square&logo=pypi)](https://pypi.python.org/pypi/brightml/)
[![HitCount](http://hits.dwyl.io/kootenpv/brightml.svg)](http://hits.dwyl.io/kootenpv/brightml)

<p align="center">
    <a href="#" target="_blank"><img src="./brightml.gif" width="50%"></a>
</p>


The goal of this package is to automatically manage brightness on laptops, with "zero config"; using machine learning.
Some do not even realise that what is "on" your screen, matters. White screens (like browser) vs coding (in black) should be accounted for.

All you have to do is to change brightness when it is not good enough yet; **brightml** learns.

It will learn to generalize based on your personal needs. To do this, it uses:

- Brightness of screen
- Ambient light sensor (if available)
- Hour of day
- whereami (indoor wifi positioning)
- Battery feature (only if discharging)
- Active application name
- Active window title

### Features

- Cross-OS (within Linux)
- Cross-vendor (intel, nvidia)
- Cross-hardware (with or without ambient light sensor, linux on macbook works)
- Seamless integration: No need to change key bindings as it monitors brightness change by user
- Uses asyncio, event-based (change of window immediately triggers prediction; no timer)
- Updates brightness on focusing different windows and on scrolling

### Goals

- Provide service files to enable by startup (systemd: done)
- Add a command to show "feature importance"
- More extensibility (plugin based)
- Cross-platform (OSX)

### Installation

    pip install brightml

Bonus: set up `whereami <https://github.com/kootenpv/whereami>`_ to include indoor positioning in the predictions.

    pip install brightml[whereami]

### Usage

Eventually we need to get some service files for the different Operating Systems, so the process starts on boot.

For now, just ready for preview, run on command line:

    sudo brightml

This will run brightml in the foreground.

To instead just show current feature values, run:

    pascal@archbook:~$ brightml features
    {
        "ambient_light": 1,
        "whereami": "bed",
        "datetime_hour": 21,
        "datetime_timezone": "UTC+02:00",
        "datetime_date": "2017-10-28",
        "datetime_full": "2017-10-28 21:52:43+02:00",
        "display_pixel_mean": 9.072666666666667,
        "display_window_name": "pascal@archbook:~",
        "display_window_class": "urxvt URxvt",
        "battery": 95.94282414091828
    }
geolibs-dator 0.0.7
GeoLibs Dator - A data extractor
License: MIT
Requires Python: >=3.6,<4.0

# GeoLibs-Dator
Dator, a data extractor (ETL as a library), that uses Pandas' DataFrames as in memory temporal storage.

### Features
| Source | Extract | Transform | Load |
| --- | --- | --- | --- |
| BigQuery | Y | Y |  |
| CARTO | Y | Y | Y* |
| CSV | Y |  | Y |
| Pandas |  | Y |  |
| PostgreSQL | Y | Y | Y |

_* Note:_ We are waiting for the append feature on [CARTOframes](https://github.com/CartoDB/cartoframes), because the one we are using is a _ñapa_.

### Configuration
Create a `config.yml` file using the `config.example.yml` one as guide. You can find in that one all the possible ETL cases.

If you are using BigQuery in your ETL process, you need to add a `GOOGLE_APPLICATION_CREDENTIALS` environment variable with the path to your Google Cloud's `credentials.json` file.

You can test them with the `example.py` file.

#### Example

*dator_config.yml*

```yml
datastorages:
  bigquery_input:
    type: bigquery
    data:
      query: SELECT * FROM `dataset.table` WHERE updated_at >= '2019-05-04T00:00:00Z' AND updated_at < '2019-06-01T00:00:00Z';

  carto_input:
    type: carto
    credentials:
      url: https://domain.com/user/user/
      api_key: api_key
    data:
      table: table

  postgresql_input:
    credentials:
      ...
    data:
      query: SELECT * FROM somewhere;
      types:
        - name: timeinstant
          type: datetime
        - name: fillinglevel
          type: float
        - name: temperature
          type: int
        - name: category
          type: str

  carto_output:
    type: carto
    credentials:
      url: https://domain.com/user/user/
      api_key: api_key
    data:
      table: table
      append: false

transformations:
  bigquery_agg:
    type: bigquery
    time:
      field: updated_at
      start: "2019-05-02T00:00:00Z"  # As string or YAML will parse them as DateTimes
      finish: "2019-05-03T00:00:00Z"
      step: 5 MINUTE
    aggregate:
      by:
        - container_id
        - updated_at
      fields:
        field_0: avg
        field_1: max

extract: bigquery_input
transform: bigquery_agg
load: carto_output
```

### How to use

This package is designed to accomplish ETL operations in three steps:

#### Extract

The extract method is a default method, this means although this method can be overwritten, by default, it must work via config.

(This section under construction)

#### Transform

(This section under construction)

#### Load

The load method is a default method, this means although this method can be overwritten, by default, it must work via config. It can receive 2 parameters, the Pandas dataframe and a dictionary with extra info.

#### Example

*app.py*

```python
from dator import Dator

dator = Dator('/usr/src/app/dator_config.yml')
df = dator.extract()
df = dator.transform(df)
dator.load(df)
```

*app.py* with extra info

```python
from dator import Dator

def upsert_method:
  pass

dator = Dator('/usr/src/app/dator_config.yml')
df = dator.extract()
df = dator.transform(df)
dator.load(df, {'method': upsert_method})
```

### TODOs
- Better doc.
- Tests.