semvec/pypi-packages huggingface dataset:
py-geo-nearby 0.0.3
Python library to arrange geo locations by nearest distance

# py-geo-nearby Package

This uses geopy package to identify the distance between two geo co-ordinates and arrange it based on the nearest distances.

e.g) Consider the below case,

A is the starting point  \
Distance between A and B = 3 Kms \
Distance between A and C = 2 Kms \
Distance between B and C = 3 kms \
Distance between B and D = 4 kms \
Distance between C and D = 2 kms

All the places ie) B, C and D has to be visited from A. However, the nearest place from A has to be visited first followed by the nearest place from the first visited place and so on..

In the above example,  \
From A, C is the nearest location. \
From C, D is the nearest location. \
From D, B is the nearest location.

Therefore the sequence based on nearest distance is A -> C -> D -> B \
Total Distance = 2 + 2 + 4 = 8 kms

## Installation

```
pip install geopy
pip install py-geo-nearby
```

## Declare

```
import py_geo_nearby.py_geo_nearby as pygn
```

## Parameters

Parameter | Meaning | Sample Values
----------|---------|--------
list | python variable containing the list of locations | any variable name

NOTE: Each list entry should have exactly 3 values namely latitude, longitude and location Name. The 1st entry of the list will be considered as the starting location.

## Usage Example

#### Code 

```
import py_geo_nearby.py_geo_nearby as pygn

rows = [
 ['12.92509', '80.10087', 'Tambaram,Chennai'],
 ['12.95601', '80.14353', 'Saravana Stores,Chromepet, Chennai'],
 ['12.92264', '80.131151', 'Selaiyur,Chennai'],
 ['12.90885', '80.09903', 'Perungalathur,Chennai'],
 ['12.93675', '80.16917', 'Hasthinapuram, Chennai'],
 ['12.86956', '80.16775', 'Sholinganallur, Chennai'],
 ['12.96829', '80.0962', 'Thirumudivakkam, Chennai']
]
places,totalDistance = pygn.nearby(rows)
print(places,totalDistance)
```
#### Output

```
(['Tambaram,Chennai',
  'Perungalathur,Chennai',
  'Selaiyur,Chennai',
  'Saravana Stores,Chromepet, Chennai',
  'Hasthinapuram, Chennai',
  'Sholinganallur, Chennai',
  'Thirumudivakkam, Chennai'],
 33.881469236248286)
```
pykef 1.3.0
A python implementation to interface Kef speakers over tcp/ip

# Python interface to control KEF speakers
Supported: KEF LS50 Wireless (Requires [firmware](http://international.kef.com/product-support) June 2018 or later)

Untested: KEF LSX

## Features supported
- Get and set volume
- Mute and Unmute
- Get and set source input
- Get if the speakers are online
- Automatically connects and disconnects when speakers goes online/offline
- Turn off speaker

## Features unfortunatly unsupported
- Turn on is impossible over tcp/ip because the speaker turns off network interface when turned off. This is true for LS50 Wireless. LSX should be possible to turn on.

Note: One workaround to turning on is to use IR commands to turn on. I have included a [lirc config](lirc/KEF_LS50_WIRELESS.lircd) with all the keys on the remote. Note that each command has to be sent twice to work (at least for me).

## Install
```bash
pip install pykef
```

## Discussion
See [home assistant thread](https://community.home-assistant.io/t/kef-ls50-wireless/)

## Examples
Setup:
```python
host = '192.168.1.200'
port = 50001
speaker = KefSpeaker(host, port)
```
Set volume:
```python
speaker.volume = 0.5 # %50 vol
```
Get volume:
```python
volume = speaker.volume
```
Set source:
```python
speaker.source = InputSource.AUX
```
Get source:
```python
source = speaker.source
```
Mute:
```python
speaker.volume = None
# Or
speaker.muted = True
```
Unmute (set to volume before mute):
```python
speaker.muted = False
```
Step volume up
```python
speaker.increseVolume() # 5% increase
speaker.increseVolume(0.10) # 10% increase
```
Step volume down
```python
speaker.decreaseVolume() # 5% increase
speaker.decreaseVolume(0.10) # 10% increase
```
Turn off
```python
speaker.turnOff()
```

## How to

### Upload new release:
1. Update needed tools:
```bash
python3 -m pip install --user --upgrade setuptools wheel
```
2. Build
```bash
python3 setup.py sdist bdist_wheel
```
3. Upload (test)
```bash
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

## License
MIT License

## Authors
- Robin Grönberg