semvec/pypi-packages huggingface dataset:
hw01 1.0.0
Python library to work with Lenovo HW01
License: MIT
Keywords: api health

# Lenovo HW01 [![Build Status](https://travis-ci.org/nabilbendafi/HW01.svg?branch=master)](https://travis-ci.org/nabilbendafi/HW01)

Library to work with Lenovo HW01. To be used in place of Android [Lenovo Healthy](https://play.google.com/store/apps/details?id=com.lenovohw.base.framework) app.

## Dependencies

 - [bluepy](https://github.com/IanHarvey/bluepy)


## Traffic analysis

In order to analyse communication between official Android app [Lenovo Healthy](https://play.google.com/store/apps/details?id=com.lenovohw.base.framework&hl=en_US) and Lenovo HW01 device, additional app [NordicSemiconductor/Android-nRF-Connect](https://github.com/NordicSemiconductor/Android-nRF-Connect) is used to perform traffic logging.

It allows us to write an API library to interact with the watch without using the official Android app.

## Debugging

Scan for Bluetooth devices:
```bash
$> sudo hcitool lescan
LE Scan ...
XX:XX:XX:XX:XX:XX HW01
```

Connect to Bluetooth device:

```bash
sudo gatttool --device=XX:XX:XX:XX:XX:XX -I -t random
[XX:XX:XX:XX:XX:XX][LE]> connect
Attempting to connect to XX:XX:XX:XX:XX:XX
Connection successful
```

List device characteristics:
```bash
[XX:XX:XX:XX:XX:XX][LE]> primary
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x0008 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0009, end grp handle: 0x000e uuid: 0000190a-0000-1000-8000-00805f9b34fb
attr handle: 0x000f, end grp handle: 0x0014 uuid: 0000190b-0000-1000-8000-00805f9b34fb
attr handle: 0x0015, end grp handle: 0xffff uuid: 0000fee7-0000-1000-8000-00805f9b34fb
```

## Documentation

[hw01’s documentation](https://nabilbendafi.github.io/HW01/index.html)

## Test

```
pip install -r dev-requirements.txt
./setup.py nosetests
```

## References

 - [creotiv/MiBand2](https://github.com/creotiv/MiBand2)
 - [My journey towards Reverse Engineering a Smart Band — Bluetooth-LE RE](https://medium.com/@arunmag/my-journey-towards-reverse-engineering-a-smart-band-bluetooth-le-re-d1dea00e4de2)
 - [Xiaomi Mi Band BLE Protocol reverse-engineering and API](http://androiders-newbie.blogspot.com/2014/12/xiaomi-mi-band-ble-protocol-reverse.html)
 - [How I hacked my Xiaomi MiBand 2 fitness tracker — a step-by-step Linux guide](https://medium.com/machine-learning-world/how-i-hacked-xiaomi-miband-2-to-control-it-from-linux-a5bd2f36d3ad)
 - [Get Started with Bluetooth Low Energy on Linux](https://www.jaredwolff.com/blog/get-started-with-bluetooth-low-energy/)
 - [NordicSemiconductor/Android-nRF-Connect](https://github.com/NordicSemiconductor/Android-nRF-Connect)
voxceleb_luigi 0.2.0
Luigi pipeline to download VoxCeleb audio from YouTube and extract speaker segments
License: MIT

# voxceleb-luigi
[![pypi version](http://img.shields.io/pypi/v/voxceleb_luigi.svg?style=flat)](https://pypi.python.org/pypi/voxceleb_luigi)

Luigi pipeline to download VoxCeleb audio from YouTube and extract speaker segments.

This pipeline can download both [VoxCeleb](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox1.html) and [VoxCeleb2](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/vox2.html).

## Installation

    pip install voxceleb_luigi

You need to have `ffmpeg` and `youtube-dl` installed. On systems with `apt`, you can simply run:

    sudo apt install ffmpeg youtube-dl


## Usage

Download and unpack at least one of the metadata directories with the YouTube URLs and timestamps (VC1 [dev](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/data/vox1_dev_txt.zip)/[test](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/data/vox1_test_txt.zip), VC2 [dev](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/data/vox2_dev_txt.zip)/[test](http://www.robots.ox.ac.uk/~vgg/data/voxceleb/data/vox2_test_txt.zip)).

Start luigid, the central scheduler:

    luigid --background

Then start the worker process:

    luigi --module voxceleb_luigi \
        --workers 4 \
        voxceleb.ProcessDirectory \
        --path /path/to/metadata

The pipeline will recursively search `/path/to/metadata` for the segment files (by looking for files called like `00001.txt` etc.), download the audio of their source videos, and extract the speaker segments.

By default, the segment audio files are stored in parallel to the metadata in directories called `wav` that get created next to the `txt` directories. Suppose you have the metadata of the dev and test sets of VoxCeleb1 in `~/vc1` with paths looking like `~/vc1/dev/txt/idX/videoX/XXXXX.txt`. If you pass `--path ~/vc1` to the pipeline, segments will end up in `~/vc1/dev/wav/idX/videoX/XXXXX.wav`. Other output of the pipeline (full audio of videos, soft failures, dummy outputs for completed directories) are stored in `./voxceleb-luigi-files` by default.


## Configuration

Both the location where the dataset gets created and the storage directory for the pipeline can be changed through parameters in the `luigi.cfg` (default location is the current working directory; you can override this via the `LUIGI_CONFIG_PATH` environment variable):

    [voxceleb.Config]
    # Required
    output_dir=/where/to/store/wav/segments
    pipeline_dir=/where/to/put/pipeline/stuff

    ## Only necessary if youtube-dl, ffmpeg, and ffprobe are not in your PATH:
    #ffmpeg_bin=/ffmpeg-dir/ffmpeg
    #ffmpeg_directory=/ffmpeg-dir # passed on to youtube-dl via --ffmpeg-location
    #youtube_dl_bin=/path/to/youtube-dl

    [voxceleb.ProcessDirectory]
    ## alternative to the --path command line option
    #path=/path/to/metadata

When `output_dir` is set, the directory structure of the metadata is mirrored in this directory. In this case, the `txt` directories are not replaced by `wav`, but removed from the path.
json-paginator 0.1.0
A generator for iterating over paginated JSON API responses
License: MIT

# json-paginator

![PyPI Version](https://img.shields.io/pypi/v/json-paginator.svg)
![License](https://img.shields.io/pypi/l/json-paginator.svg)

A generator for iterating over paginated JSON API responses

## Installation

```
pip install json-paginator
```

## Usage

Instantiate `JsonApiPaginator` with:

* A URL to page 1 of the API output
* A function (or lambda) `get_nextpage(url, body)` which describes how to get the next page. Return `None` to stop iteration.

Example:

```py
from json_paginator import JsonApiPaginator

BASE = 'https://galaxy.ansible.com'

def get_next_page(url, body):
    if body['next_link']:
        return BASE +  body['next_link']
    return None

# instantiate the paginator
pages = JsonApiPaginator(
    BASE + '/api/v1/categories/?page=1',
    get_next_page
)

# iterate over the pages
for url, body in pages:
    print("calling %s" % (url))
    print("found %s results" % (len(body['results'])))
```