semvec/pypi-packages huggingface dataset:
rox-septentrio 0.5.2
Driver for Septentrio GPS, posting messages to mqtt
License: MIT
Requires Python: >=3.10

# Septentrio GPS


**What it does:**

* Reads NMEA messages from the gps receiver (over serial or ip)
* parses them and calculates ENU coordinates
* publishes `latlon` and `enu` data as json to mqtt topics.

**mqtt messages**

```
topic: /gps/position
{"lat":51.45655803,"lon":6.08187908,"x":-13.354,"y":-67.59,"gps_qual":4,"time":"14:27:27.800000","ts":1726149158.437}

topic: /gps/direction
{"heading":152.22,"heading_stdev":0.084,"theta":-1.0859,"ts":1726149158.441}
```


## 1. Configure receiver

Install and configure gps receiver as described in [installation manual](docs/README.md)


## 2. Launch docker container

get docker image (use tag for version)

    registry.gitlab.com/roxautomation/components/septentrio-gps:latest

launch container with

    docker run \
    -e GPS_NODE_TYPE=ip \
    -e GPS_IP_HOST=<hostname> \
    registry.gitlab.com/roxautomation/components/septentrio-gps:latest


Set these environment variables to override default settings:

### MQTT
- **MQTT_HOST**: MQTT server host (default: `"localhost"`).
- **MQTT_PORT**: MQTT server port (default: `1883`).
- **MQTT_POSITION_TOPIC**: MQTT topic for GPS positions (default: `"/gps/position"`).
- **MQTT_DIRECTION_TOPIC**: MQTT topic for GPS directions (default: `"/gps/direction"`).

### GPS
- **GPS_NODE_TYPE**: "serial" or "ip" (default: `"serial"`).
- **GPS_SERIAL_PORT**: Serial port for GPS (default: `"/dev/gps_nmea"`).
- **GPS_SERIAL_BAUD**: Baud rate for GPS serial communication (default: `115200`).
- **GPS_IP_HOST** : ip server address (default `localhost`)
- **GPS_IP_PORT** : ip port (default `28000`)
- **GPS_REF**: gps reference point, provide lat,lon, example: `GPS_REF="51.123,6.456"`

## Precision
 - **DIGITS_POSITION** : meter position accuracy, defaults to 3
 - **DIGITS_LATLON** : digits latitude and longitude, defaults to 8
 - **DIGITS_ANGLE** : angle accuracy, defaults to 4


(note: configuration is defined in `config.py`)



## Development

There should be mqtt broker available on the host system. If not, there is a docker image for that:

    docker run -d --name mosquitto --restart unless-stopped -p 1883:1883 registry.gitlab.com/roxautomation/images/mosquitto:latest

* Open in VSCode devcontainer. Virtual com port is located at `/tty/tty_nmea_rx`
* Pre-recorded nmea stream can be sent to com port with `replay_data.py` in `integration/data` folder.
pathio 0.1.0
Input and output path checks. Simplifies handling of file/directory paths in scripts.
License: MIT
Requires Python: <4.0,>=3.8
Keywords: path, checks, scripts

# pathio

Path collection class for checking paths for input and output files/directories.

- Initializing a collection (and later path additions) runs the suite of checks:
  - Duplication, existence (inputs), ... TODO add all checks
- Printing/logging the collection provides a summary of the paths. 
- Paths are converted to `pathlib.Path` objects and missing directories can be created.
- Can create missing output directories.

> https://pypi.python.org/pypi/pathio/


# Installation

Install from PyPI:

```shell
pip install pathio
```

Install from GitHub:

```shell
python -m pip install git+https://github.com/ludvigolsen/pathio
```


# Main class/functions

| Class/Function | Description                                           |
| :------------- | :---------------------------------------------------- |
| `IOPaths`      | Collection of paths with built-in checks.             |
| `mk_dir`       | Wrapper for creating directory if it doesn't exist.   |
| `rm_dir`       | Wrapper for removing directory with relevant options. |


# Examples

Initialize the collection of path collections. Often the paths come from input arguments (like via `argparse`).
Additional paths can be added later with `set_path()` or `set_paths()`.


```python
# Create path collection
paths = IOPaths(
    in_files={
        "in_file": "../dir1/dir2/john.csv",
        "stream_in": "-"
    },
    in_dirs={
        "in_dir": "../dir1/dir2/",
    },
    out_files={
        "out_file": "../dir1/dir2/output/no_john.csv"
    },
    out_dirs={
        "out_path": "../dir1/dir2/output/"
    }
)
```

Add additional path. Reruns checks to ensure consistency.

```python
paths.set_path(
    name="in_file_2",
    path="../dir1/dir2/dennis.csv",
    collection="in_files"
)
```

Or set multiple at a time to avoid rerunning checks unnecessarily:

```python
paths.set_paths(
    paths={
        "out_file_2": "../dir1/dir2/output/no_dennis.csv"
        "out_file_3": "../dir1/dir2/output/readme.txt"
    },
    collection="out_files"
)
```

Create the output directories that do not exist:

```python
paths.mk_output_dirs(collection="out_dirs")
```

Get a path:

```python
paths["in_file"]  # or
paths.get_path(name="in_file", as_str=False, raise_on_fail=True)
```

Remove file from disk:

```python
paths.rm_file(name="in_file")
```

Update collection with another `IOPaths` collection.
The sub collections are simple dicts, why this is just dict.update()
on each sub collection.

```python
paths.update(other=other_paths)
```

Find the combinations of keys and paths in the collections of this object
that are not in the collections of another object:

```python
paths.difference(other=other_paths)
```