semvec/pypi-packages huggingface dataset:
cgc-common 0.6.0
Shared utilities for CGC Studio applications
Requires Python: >=3.10

# Cindergrace Common

**Status:** Final


> **Internal Use Only** - This repository is public solely for integration with free-tier code analysis tools (Codacy). It is not intended for external use, contribution, or distribution. No support is provided.

Shared utilities for Cindergrace applications.

## Installation

```bash
pip install cindergrace-common
```

With optional dependencies:
```bash
pip install cindergrace-common[gradio]   # Gradio theme support
pip install cindergrace-common[secrets]  # OS Keyring support
pip install cindergrace-common[dev]      # Development tools
```

## Features

- **Configuration**: Type-safe environment variable helpers
- **Security**: Localhost-by-default server binding, feature flags
- **Branding**: Centralized logo and CSS loading
- **i18n**: YAML-based translations
- **State**: XDG-compliant JSON persistence
- **Logging**: Unified logging setup with colored output
- **Paths**: Path traversal protection utilities
- **Secrets**: OS Keyring integration for API keys (v0.3.0)
- **Gradio**: Consistent theming for Gradio apps

## Quick Start

```python
from cindergrace_common import (
    BaseConfig, SecurityMixin, BrandingMixin,
    env_int, env_bool, setup_logging
)

logger = setup_logging("myapp")

class Config(BaseConfig, SecurityMixin, BrandingMixin):
    APP_PREFIX = "MYAPP"
    PORT = env_int("MYAPP_PORT", 7865)

# Server binds to localhost by default
# Set MYAPP_ALLOW_REMOTE=1 for network access
server_name = Config.get_server_bind()
```

### Secure API Key Storage (v0.3.0)

```python
from cindergrace_common import SecretStore

secrets = SecretStore("myapp")
secrets.set("API_TOKEN", "secret123")  # Stores in OS Keyring
token = secrets.get("API_TOKEN")       # Retrieves from Keyring
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `{PREFIX}_PORT` | Server port |
| `{PREFIX}_ALLOW_REMOTE` | Set to `1` for network access |
| `{PREFIX}_ENABLE_{FEATURE}` | Enable specific features |
| `CINDERGRACE_BRANDING_PATH` | Path to branding assets |
| `{SERVICE}__{KEY}` | Fallback for secrets when keyring unavailable |

## License

MIT
dotbot-provision 0.1.4
A command-line tool for provisioning DotBot devices and gateways.
Requires Python: >=3.8

# `dotbot-provision`

A command-line tool for provisioning DotBot devices and gateways.

It can fetch, config, and flash pre-built firmwares from repos [SwarmIT](https://github.com/DotBots/swarmit) and [mari](https://github.com/DotBots/mari).

## Requirements

This tool shells out to external flashing utilities:

- `nrfjprog` (Nordic nRF Command Line Tools) for nRF5340 flashing
- `pyocd` for DAPLink/J-Link OB programmer flashing
- `JLinkExe` (SEGGER J-Link) for STM32 bootloader flashing

Make sure these are installed and available on your `PATH`.

## Installation

```bash
pip install dotbot-provision
```

```
Usage: dotbot-provision [OPTIONS] COMMAND [ARGS]...

  A tool for provisioning DotBot devices and gateways.

Options:
  --help  Show this message and exit.

Commands:
  fetch          Fetch firmware assets into bin/<fw-version>/.
  flash          Flash firmware + config using versioned bin layout.
  flash-bringup  Flash J-Link OB or DAPLink programmer firmware.
  flash-hex      Flash explicit app/net hex files.
  read-config    Read config from the device.
```

## Deploying a testbed

First, download firmware assets:

```bash
dotbot-provision fetch --fw-version v0.7.0
```

Then, to flash a DotBot-v3 while specifying a certain Network ID:

```bash
dotbot-provision flash --device dotbot-v3 --fw-version v0.7.0 --network-id 0100
```

You can also pass `-a <fw-name>` to flash, in addition to bootloader and netcore, a default app firmware:


```bash
dotbot-provision flash --device dotbot-v3 --fw-version v0.7.0 --network-id 0100 -a motors
```


And to flash a Mari Gateway:

```bash
dotbot-provision flash --device gateway --fw-version v0.7.0 --network-id 0100
```

... and it's done!

## Deploying a testbed on fresh robots

If your robot just arrived from factory, first you have to run the `flash-bringup` command.
You can concatenate it with a regular `flash` command so that all happens in sequence with minimal manual work.
Like this:

```bash
dotbot-provision flash-bringup --programmer-firmware jlink -d ../../../programer-files-dotbot && \
  dotbot-provision flash -d dotbot-v3 -f local -n 0100 -s 77
```
... where the `-s` flag stands for `--sn-starting-digits` and serves as a pattern to identify the connected programming probe. In this case it solves a problem where the flash command incorrectly selects the external J-Link probe instead of the dotbot's (most DotBots come from factory with a serial number starting by 77).
mikrotik-upgrade 0.1.1
A minmal tool for mass upgrade Mikrotik routers
Requires Python: >=3.12

# Mikrotik upgrade

A minimal tool for mass updating Mikrotik routers

## Installation

```
pip install mikrotik-upgrade
```

## Config

Place a config.yaml either in `/etc/mikrotik-upgrade/config.yaml` or in `~/.config/mikrotik-upgrade/config.yaml`

An example can be found in the repo.

## Runing the upgrades

simply call `mikrotik-upgrade`

The output lokks like this

```sh
mikrotik-upgrade  
================================================================================
==                                   Router                                   ==
================================================================================
New version is available
Download updates
Upgrade routerboard
Reboot System
```