semvec/pypi-packages huggingface dataset:
mocap-converter 0.0.1
Motion capture conversion utilities.
Requires Python: >=3.11
Keywords: bvh, kinect, mocap, motion-capture

# mocap-converter

[![PyPI - Version](https://img.shields.io/pypi/v/mocap-converter.svg)](https://pypi.org/project/mocap-converter)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mocap-converter.svg)](https://pypi.org/project/mocap-converter)

`mocap-converter` is a library for turning motion-capture recordings into
formats that downstream tools can reuse. It converts joint position traces
captured during a mocap session into joint rotation data, making it easy to
repurpose captured motion in other contexts.

## Installation

Install with uv:

```console
$ uv add mocap-converter
```

Or install with pip:

```console
$ pip install mocap-converter
```

## Usage

### Convert Azure Kinect Data to BVH

The snippet below loads Azure Kinect Body Tracking data exported by the
[Offline Processor](https://github.com/microsoft/Azure-Kinect-Samples/tree/master/body-tracking-samples/offline_processor),
derives joint rotations from the recorded global joint positions, and saves the
result as a BVH animation.

```python
import json

from mocap_converter.adapter.azure_kinect import (
    AZURE_KINECT_KINEMATIC_TREE,
    get_positions_from_json,
)
from mocap_converter.adjust_kinematic_tree import adjust_kinematic_tree
from mocap_converter.io.bvh.saver import save_bvh
from mocap_converter.motion_data import MotionData
from mocap_converter.pos2rot import get_rotations_from_positions


with open("path/to/kinect_capture.json") as raw:
    kinect_data = json.load(raw)

positions = get_positions_from_json(kinect_data)
# Apply optional smoothing (e.g., a median filter) here if the capture contains noisy frames.
kinematic_tree = adjust_kinematic_tree(AZURE_KINECT_KINEMATIC_TREE, positions)
root = kinematic_tree.root

positional_motion = MotionData(kinematic_tree, positions)
rotations = get_rotations_from_positions(positional_motion, current_node_name=root.name)

rotational_motion = MotionData(
    kinematic_tree,
    positions={root.name: positions[root.name]},
    rotations=rotations,
)

save_bvh(rotational_motion, "path/to/output.bvh")
```

## License

`mocap-converter` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
dbt-switch 0.2.6
A simple CLI to switch between dbt Cloud projects and hosts.
Requires Python: >=3.9

# dbt-switch

A simple CLI tool to manage and switch between dbt Cloud projects and hosts. Solves the pain point of manually updating `active-host` and `active-project` in your `dbt_cloud.yml` when working with multiple dbt Cloud accounts. 

The crux of the issue is documented in this dbt forum post: [dbt Cloud CLI - Connect to Mulitple Hosts](https://discourse.getdbt.com/t/dbt-cloud-cli-connect-to-multiple-hosts/14075).


## Requirements
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
- [dbt Cloud CLI config](https://docs.getdbt.com/docs/cloud/configure-cloud-cli#configure-the-dbt-cli) in your `~/.dbt/dbt_cloud.yml` file

## Important Setup Step

**You must manually merge your dbt_cloud.yml files from different accounts into one file.**

If you work with multiple dbt Cloud accounts, you'll have separate `dbt_cloud.yml` files for each account. You need to combine all the `projects` sections into a single `~/.dbt/dbt_cloud.yml` file before using `dbt-switch`.

## Documentation
📚 See the [Complete Usage Guide](docs/how_to_use.md#configuration-files) for detailed examples of the merged file structure.

## Installation

```bash
uv tool install dbt-switch
```

## Quick Start

```bash
# Initialize the configuration file
dbt-switch init

# Add a new project (interactive)
dbt-switch add

# Add a new project (non-interactive)
dbt-switch add my-project --host https://cloud.getdbt.com --project-id 12345

# List all configured projects
dbt-switch list

# Switch to a project
dbt-switch -p my-project
```

## Key Features

- Manage multiple dbt Cloud projects across different accounts
- Switch projects instantly with a simple command
- Interactive and non-interactive modes for different workflows
- Update project configurations easily (host, project ID, or both)

## Documentation

**[Complete Usage Guide](docs/how_to_use.md)** - Detailed documentation with examples, configuration files, and command reference

## How It Works

1. **Store configurations**: Define your projects in `~/.dbt/dbt_switch.yml`
2. **Switch instantly**: Update `active-host` and `active-project` in your `~/.dbt/dbt_cloud.yml`
3. **Keep your data**: All tokens and project configurations are preserved

**Example workflow:**
```bash
# Add your projects
dbt-switch add alpha --host cloud.getdbt.com --project-id 12345
dbt-switch add beta --host xyz123.us1.dbt.com --project-id 67890

# Switch between them
dbt-switch -p alpha    # Now using Alpha Industries project
dbt-switch -p beta     # Now using Beta Corp project
```