rose-bag


Namerose-bag JSON
Version 0.6.9 PyPI version JSON
download
home_pageNone
SummaryA modern CLI/TUI tool for ROS bag file analysis and filtering
upload_time2025-07-15 00:16:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Lingfengai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bag cli filter robotics ros tui visualization
VCS
bugtrack_url
requirements textual rosbags rich typer pydantic click InquirerPy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ROSE - Yet Another ROS Bag Filter Tool

A high-performance ROS bag filtering tool that allows you to extract specific topics from ROSv1 bag files. Built with C++ core and Python interface, it provides both command-line and TUI interfaces for efficient bag file processing.


>inspired by [rosbag_editor](https://github.com/facontidavide/rosbag_editor)


## Aesthetic 

> The cassette tape, a modest analog artifact, has evolved into a retro-futurism icon, demonstrating that technological advancement can coexist with human touch. Its tactile interface and physical limitations serve as poignant reminders of our technological heritage.

> 磁带盒不仅是一种技术遗物,更是复古未来主义的艺术品和精神图腾。简单的按钮、褪色的塑料外壳和有限的存储容量,既是怀旧的载体,也是对数字霸权的温柔反抗。它时刻提醒着我们:技术的突飞猛进不应该以牺牲人性为代价,克制的设计往往更能打动人心。

The TUI embraces the **cassette futurism** aesthetic - a design philosophy that reimagines future interfaces through the lens of 20th century technological fossils. This intentional retrofuturism features:

- **Nostalgic minimalism**: Low-resolution displays and monochromatic schemes that evoke 1980s computing
- **Tactile authenticity**: Visual metaphors of physical media like magnetic tapes and CRT textures
- **Humanized technology**: Warm color palettes and "imperfect" interfaces that resist digital sterility

More than mere retro styling, this approach serves as poetic resistance to digital hegemony. The cassette tape - our central metaphor - embodies this duality: 


![splash](splash.png)

## Key Features and Todos

- 🎉 ROS Environment independent using [rosbags](https://pypi.org/project/rosbags/)
- 🌟 Interactive TUI for easy operation
- 🌟 Command-line interface for automation
- 🌟 Interactive CLI for guided operations
- Filter ROS bag files 
  - 🌟 with whitelists 
  - with manually selected topics
  - by time range (only TUI tested)
- 🌟 **Bag file compression support** - Reduce file sizes significantly
  - BZ2 compression (best compression ratio)
  - LZ4 compression (faster compression/decompression)
  - No compression (fastest processing)
- 🌟 Fuzzy search topic in TUI
- 🌟 Multi-selection mode for batch processing in TUI (note:partially supported, rename and time range based filtering not supported yet) 
   - 🌟 parallel processing for Multi-selection mode
- Docker support for cross-platform usage
- 🌟 cassette futurism theme for dark and light mode
- 🚧 Message view in TUI
- 🚧 Support dynamic file/whitelist refresh in TUI

## Getting Started

### Installation

1. Install rose-bag from pypi
```bash
pip install rose-bag
```

2. Install from the source
```bash
# Clone the repository
git clone https://github.com/hanxiaomax/rose.git
cd rose

# Install dependencies
pip install -r requirements.txt
```

To uninstall Rose, run the following command:
```bash
pip uninstall rose-bag
```

### Terminal Setup

To ensure proper color display in your terminal, set the following environment variable:
```bash
# Add this to your bashrc or zshrc
export TERM=xterm-256color
```

No ROS bag file? No problem! Download [webviz demo.bag](https://storage.googleapis.com/cruise-webviz-public/demo.bag) and give it a try!

## Usage


### Command Line Interface

### Inline CLI

Rose provides a command-line tool for direct bag file operations. Currently, it supports the filter command:

```bash
# Basic usage for single file
rose filter <input_bag> <output_bag> [OPTIONS]

# Basic usage for directory
rose filter <input_directory> <output_directory> [OPTIONS]
```

**Parameters:**

- `<input_bag/directory>`: Path to the input bag file or directory containing bag files (required)
- `<output_bag/directory>`: Path to the output bag file (for single file) or directory (required for directory input)

**Options:**

- `-w, --whitelist TEXT`: Specify a topic whitelist file path
- `-t, --topics TEXT`: Specify topics to include, can be used multiple times to add multiple topics
- `-p, --parallel`: Process files in parallel when input is a directory
- `--workers INTEGER`: Number of parallel workers (default: CPU count - 2)
- `--dry-run`: Preview the operation without actually executing it
- `--help`: Show help information

**Usage Examples:**

1. Filter a single bag file using a whitelist:
   ```bash
   rose filter input.bag output.bag -w whitelist.txt
   ```

2. Filter specific topics from a single file:
   ```bash
   rose filter input.bag output.bag -t /topic1 -t /topic2 -t /topic3
   ```

3. Process all bag files in a directory:
   ```bash
   rose filter input_dir/ output_dir/ -w whitelist.txt
   ```

4. Process directory with parallel execution:
   ```bash
   rose filter input_dir/ output_dir/ -w whitelist.txt --parallel
   ```

5. Preview filtering results without execution:
   ```bash
   rose filter input.bag output.bag -w whitelist.txt --dry-run
   ```


### Interactive CLI

For a guided experience with interactive prompts:

```bash
# Launch the interactive CLI tool
rose cli
```

The interactive CLI provides:
- Menu-driven interface for bag file operations
- Guided workflow for filtering and whitelist management
- Batch processing capabilities for multiple files
- Progress indicators and detailed results

Key features:
- Load single bag files or entire directories
- Select topics with fuzzy search
- Create, view, and manage whitelists
- Process multiple files in batch mode

#### Single Bag Processing
![asciicast](screen-shots/single-bag.gif)

#### Multi-Bag Processing
![asciicast](screen-shots/multi-bag.gif)


### TUI Interface

> [!IMPORTANT]
> If you experience color display issues in your terminal, set the following environment variable:
> ```bash
> export TERM=xterm-256color
> ```
> This ensures proper color rendering in both CLI and TUI interfaces.

For a full-featured terminal user interface:

```bash
# Launch the TUI
rose tui
```
![asciicast](screen-shots/tui.gif)


Key bindings:
- `q`: to quit
- `f`: to filter bag files
- `w`: to load whitelist
- `s`: to save whitelist
- `a`: to toggle select all topics

## Compression Support

Rose supports automatic compression of filtered bag files to significantly reduce file sizes. This is especially useful for storing and transferring large bag files.

### Available Compression Types

| Type | Description | Compression Ratio | Speed | Use Case |
|------|-------------|------------------|-------|----------|
| `none` | No compression | 0% | Fastest | When processing speed is critical |
| `bz2` | BZ2 compression | ~80-90% | Slower | Best for long-term storage |
| `lz4` | LZ4 compression | ~60-70% | Faster | Good balance of speed and compression |

### Using Compression

Compression options are presented to users during the filtering process. By default, Rose uses no compression for fastest processing speed. Users can choose from:

- **No compression**: Fastest processing, largest files
- **BZ2 compression**: Best compression ratio, slower processing  
- **LZ4 compression**: Balanced speed and compression

**Example compression results:**
- Original bag file: 696.15 MB
- After BZ2 compression: 92.03 MB  
- **Compression ratio: 86.8%**

### Programmatic Usage

```python
from roseApp.core.BagManager import BagManager, CompressionType
from roseApp.core.parser import create_parser, ParserType

# Create parser and bag manager
parser = create_parser(ParserType.PYTHON)
bag_manager = BagManager(parser)

# Load bag and select topics
bag_manager.load_bag(Path("input.bag"))
bag_manager.select_topic("/your_topic")

# Get filter configuration with desired compression
bag = bag_manager.get_single_bag()
config = bag.get_filter_config(compression="bz2")  # or "none", "lz4"

# Filter with specified compression
bag_manager.filter_bag(Path("input.bag"), config, Path("output.bag"))
```

### Command Line Usage

```bash
# Filter with BZ2 compression
rose filter input.bag output.bag -w whitelist.txt -c bz2

# Filter with no compression (fastest)
rose filter input.bag output.bag -w whitelist.txt -c none

# Filter with LZ4 compression (balanced)
rose filter input.bag output.bag -w whitelist.txt -c lz4
```

> **Note**: LZ4 compression requires additional system dependencies. If LZ4 is not available, BZ2 compression will be used as fallback.

#### Configuration

Rose is configured with `roseApp/config.json`.
```json
{
    "show_splash_screen": true,
    "theme": "cassette-walkman",
    "whitelists": {
        "demo": "./whitelists/demo.txt",
        "radar": "./whitelists/radar.txt",
        "invalid": "./whitelists/invalid.txt"
    }
}
```

- `show_splash_screen`: whether to show the splash screen, default is true
- `theme`: the theme of the TUI, default is `cassette-walkman`, check [Theme](#theme) for more details
- `whitelists`: the whitelists of the TUI, default is empty, check [Whitelist](#whitelist) for more details

#### Theme
RoseApp TUI provides two built-in themes: `cassette-walkman` (default light theme) and `cassette-dark`. You can configure the theme in two ways:

| cassette-walkman | cassette-dark |
|------------|-------------|
| ![Light Theme TUI](screen-shots/main-light.png) | ![Dark Theme TUI](screen-shots/main-dark.png) |

1. Modify `config.json` to specify your preferred theme:

```json
{
    "theme": "cassette-dark",
}
```
2. Switch Theme in TUI with command palette(the buttom in bottom right corner or keybinding ^p)


### Whitelist

You can filter bag files with pre-configured whitelist. To select pre-configured whitelists, press `w` in TUI. But before that, you need to create your own whitelist.

You can create your own whitelist in 3 ways:

#### 1. Create topic whitelist with your favorite text editor and save it to `whitelist/`:


#### 2. Create whitelist with interactive cli and choose **2. whitelist**:
```bash
rose cli
```

![asciicast](screen-shots/whitelist.gif)

#### 3. Create topic in TUI by press `s` to save current selected topics as whitelist file to `whitelist/` directory:

you can create/view/delete whitelists

![asciicast](screen-shots/tui-whitelist.gif)


After whitelist created, add it to `config.json` so RoseApp can find it:
```json
{
    "whitelists": {
        "demo": "./whitelists/demo.txt",
        "radar": "./whitelists/radar.txt",
        "invalid": "./whitelists/invalid.txt"
    }
}
```

## Development

### Run locally

```bash
python -m roseApp.rose --help
```

### Publishing to PyPI

To publish a new version to PyPI:

1. Update version in `pyproject.toml`
2. Install required tools:
```bash
pip install keyring keyrings.alt
```

3. Configure PyPI credentials:
```bash
# Using environment variables
export HATCH_INDEX_USER=__token__
export HATCH_INDEX_AUTH=your_pypi_token

# Or using hatch config
hatch config set pypi.auth.username __token__
hatch config set pypi.auth.password your_pypi_token
```

4. Build and publish:
```bash
# Build the package
hatch build

# Publish to PyPI
hatch publish
```

### Project Structure
```
project_root/
├── roseApp/                # Python application
│   ├── rose.py             # Main entry script
│   ├── cli/                # CLI tools
│   │   ├── cli_tool.py     # Interactive CLI implementation
│   │   ├── theme.py        # CLI theme and color configuration
│   │   └── <inline-cmd>.py # Command-line commands implementation
│   ├── core/               # Core functionality
│   │   ├── parser.py       # Bag file parser
│   │   └── util.py         # Utility functions and logging
│   ├── tui/                # TUI components
│   │   ├── tui.py          # Main TUI application
│   │   └── components/     # Custom widgets
│   │   ├── config.json     # Configuration file
│   │   ├── themes/         # TUI themes
│   │   └── style.tcss          # TUI style sheet
│   ├── whitelists/         # Topic whitelist folder
│   │   └── *.txt           # Whitelist files
├── docker/                 # Docker support
│   ├── Dockerfile
│   └── go_docker.sh
├── docs/                   # Documentation
├── pyproject.toml          # Project metadata and dependencies
├── requirements.txt        # Development dependencies
└── README.md               # Project documentation
```

### Tech stack

- **[Textual](https://textual.textualize.io/)**: A Python framework for building sophisticated TUI applications. Used for creating the interactive terminal interface.
- **[Rich](https://rich.readthedocs.io/)**: A Python library for rich text and beautiful formatting in the terminal. Used for enhancing the visual presentation in both CLI and TUI.
- **[InquirerPy](https://github.com/kazhala/InquirerPy)**: A Python library for building interactive command line interfaces with elegant prompts. Used for the interactive CLI.
- **[Typer](https://typer.tiangolo.com/)**: A Python library for building CLI applications. Used for building the inline command-line interface.
- **[rosbags](https://pypi.org/project/rosbags/)**: A pure Python library for reading and writing ROS bag files. Used for ROS bag file processing without ROS dependencies.

### Rough ideas - data driven rendering

![1](docs/notes/sketch.png)

>[!TIP]
> Before you start with Textual, there are some docs worth reading:
>
> - [Textual devtools](https://textual.textualize.io/guide/devtools/) on how to use `textual run <your app> --dev` to go into dev mode and how to handle logs
> - [Design a layout](https://textual.textualize.io/how-to/design-a-layout/) 、[TextualCSS](https://textual.textualize.io/guide/CSS/) and [CSS Types](https://textual.textualize.io/css_types/) to understand how to design a layout and style your app with CSS. and more tips on [Styles](https://textual.textualize.io/guide/styles/) and its [reference](https://textual.textualize.io/styles/)
> - [Event and Messages](https://textual.textualize.io/guide/events/) are also important ideas to understand how Textual works so you can handle [actions](https://textual.textualize.io/guide/actions/)
> - Thanks to [Workers](https://textual.textualize.io/guide/workers/), asynchronous operations never been so easy. it can supppot asyncio or threads.

## Resources

- Demo bag file: [webviz demo.bag](https://storage.googleapis.com/cruise-webviz-public/demo.bag)




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rose-bag",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "bag, cli, filter, robotics, ros, tui, visualization",
    "author": null,
    "author_email": "Lingfeng_ai <hanxiaomax@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/9c/33/78f123f6c5edf419c1a530d5a08cc75c8d9074cfa6466589dec1950393e7/rose_bag-0.6.9.tar.gz",
    "platform": null,
    "description": "# ROSE - Yet Another ROS Bag Filter Tool\n\nA high-performance ROS bag filtering tool that allows you to extract specific topics from ROSv1 bag files. Built with C++ core and Python interface, it provides both command-line and TUI interfaces for efficient bag file processing.\n\n\n>inspired by [rosbag_editor](https://github.com/facontidavide/rosbag_editor)\n\n\n## Aesthetic \n\n> The cassette tape, a modest analog artifact, has evolved into a retro-futurism icon, demonstrating that technological advancement can coexist with human touch. Its tactile interface and physical limitations serve as poignant reminders of our technological heritage.\n\n> \u78c1\u5e26\u76d2\u4e0d\u4ec5\u662f\u4e00\u79cd\u6280\u672f\u9057\u7269\uff0c\u66f4\u662f\u590d\u53e4\u672a\u6765\u4e3b\u4e49\u7684\u827a\u672f\u54c1\u548c\u7cbe\u795e\u56fe\u817e\u3002\u7b80\u5355\u7684\u6309\u94ae\u3001\u892a\u8272\u7684\u5851\u6599\u5916\u58f3\u548c\u6709\u9650\u7684\u5b58\u50a8\u5bb9\u91cf\uff0c\u65e2\u662f\u6000\u65e7\u7684\u8f7d\u4f53\uff0c\u4e5f\u662f\u5bf9\u6570\u5b57\u9738\u6743\u7684\u6e29\u67d4\u53cd\u6297\u3002\u5b83\u65f6\u523b\u63d0\u9192\u7740\u6211\u4eec\uff1a\u6280\u672f\u7684\u7a81\u98de\u731b\u8fdb\u4e0d\u5e94\u8be5\u4ee5\u727a\u7272\u4eba\u6027\u4e3a\u4ee3\u4ef7\uff0c\u514b\u5236\u7684\u8bbe\u8ba1\u5f80\u5f80\u66f4\u80fd\u6253\u52a8\u4eba\u5fc3\u3002\n\nThe TUI embraces the **cassette futurism** aesthetic - a design philosophy that reimagines future interfaces through the lens of 20th century technological fossils. This intentional retrofuturism features:\n\n- **Nostalgic minimalism**: Low-resolution displays and monochromatic schemes that evoke 1980s computing\n- **Tactile authenticity**: Visual metaphors of physical media like magnetic tapes and CRT textures\n- **Humanized technology**: Warm color palettes and \"imperfect\" interfaces that resist digital sterility\n\nMore than mere retro styling, this approach serves as poetic resistance to digital hegemony. The cassette tape - our central metaphor - embodies this duality: \n\n\n![splash](splash.png)\n\n## Key Features and Todos\n\n- \ud83c\udf89 ROS Environment independent using [rosbags](https://pypi.org/project/rosbags/)\n- \ud83c\udf1f Interactive TUI for easy operation\n- \ud83c\udf1f Command-line interface for automation\n- \ud83c\udf1f Interactive CLI for guided operations\n- Filter ROS bag files \n  - \ud83c\udf1f with whitelists \n  - with manually selected topics\n  - by time range (only TUI tested)\n- \ud83c\udf1f **Bag file compression support** - Reduce file sizes significantly\n  - BZ2 compression (best compression ratio)\n  - LZ4 compression (faster compression/decompression)\n  - No compression (fastest processing)\n- \ud83c\udf1f Fuzzy search topic in TUI\n- \ud83c\udf1f Multi-selection mode for batch processing in TUI (note:partially supported, rename and time range based filtering not supported yet) \n   - \ud83c\udf1f parallel processing for Multi-selection mode\n- Docker support for cross-platform usage\n- \ud83c\udf1f cassette futurism theme for dark and light mode\n- \ud83d\udea7 Message view in TUI\n- \ud83d\udea7 Support dynamic file/whitelist refresh in TUI\n\n## Getting Started\n\n### Installation\n\n1. Install rose-bag from pypi\n```bash\npip install rose-bag\n```\n\n2. Install from the source\n```bash\n# Clone the repository\ngit clone https://github.com/hanxiaomax/rose.git\ncd rose\n\n# Install dependencies\npip install -r requirements.txt\n```\n\nTo uninstall Rose, run the following command:\n```bash\npip uninstall rose-bag\n```\n\n### Terminal Setup\n\nTo ensure proper color display in your terminal, set the following environment variable:\n```bash\n# Add this to your bashrc or zshrc\nexport TERM=xterm-256color\n```\n\nNo ROS bag file? No problem! Download [webviz demo.bag](https://storage.googleapis.com/cruise-webviz-public/demo.bag) and give it a try!\n\n## Usage\n\n\n### Command Line Interface\n\n### Inline CLI\n\nRose provides a command-line tool for direct bag file operations. Currently, it supports the filter command:\n\n```bash\n# Basic usage for single file\nrose filter <input_bag> <output_bag> [OPTIONS]\n\n# Basic usage for directory\nrose filter <input_directory> <output_directory> [OPTIONS]\n```\n\n**Parameters:**\n\n- `<input_bag/directory>`: Path to the input bag file or directory containing bag files (required)\n- `<output_bag/directory>`: Path to the output bag file (for single file) or directory (required for directory input)\n\n**Options:**\n\n- `-w, --whitelist TEXT`: Specify a topic whitelist file path\n- `-t, --topics TEXT`: Specify topics to include, can be used multiple times to add multiple topics\n- `-p, --parallel`: Process files in parallel when input is a directory\n- `--workers INTEGER`: Number of parallel workers (default: CPU count - 2)\n- `--dry-run`: Preview the operation without actually executing it\n- `--help`: Show help information\n\n**Usage Examples:**\n\n1. Filter a single bag file using a whitelist:\n   ```bash\n   rose filter input.bag output.bag -w whitelist.txt\n   ```\n\n2. Filter specific topics from a single file:\n   ```bash\n   rose filter input.bag output.bag -t /topic1 -t /topic2 -t /topic3\n   ```\n\n3. Process all bag files in a directory:\n   ```bash\n   rose filter input_dir/ output_dir/ -w whitelist.txt\n   ```\n\n4. Process directory with parallel execution:\n   ```bash\n   rose filter input_dir/ output_dir/ -w whitelist.txt --parallel\n   ```\n\n5. Preview filtering results without execution:\n   ```bash\n   rose filter input.bag output.bag -w whitelist.txt --dry-run\n   ```\n\n\n### Interactive CLI\n\nFor a guided experience with interactive prompts:\n\n```bash\n# Launch the interactive CLI tool\nrose cli\n```\n\nThe interactive CLI provides:\n- Menu-driven interface for bag file operations\n- Guided workflow for filtering and whitelist management\n- Batch processing capabilities for multiple files\n- Progress indicators and detailed results\n\nKey features:\n- Load single bag files or entire directories\n- Select topics with fuzzy search\n- Create, view, and manage whitelists\n- Process multiple files in batch mode\n\n#### Single Bag Processing\n![asciicast](screen-shots/single-bag.gif)\n\n#### Multi-Bag Processing\n![asciicast](screen-shots/multi-bag.gif)\n\n\n### TUI Interface\n\n> [!IMPORTANT]\n> If you experience color display issues in your terminal, set the following environment variable:\n> ```bash\n> export TERM=xterm-256color\n> ```\n> This ensures proper color rendering in both CLI and TUI interfaces.\n\nFor a full-featured terminal user interface:\n\n```bash\n# Launch the TUI\nrose tui\n```\n![asciicast](screen-shots/tui.gif)\n\n\nKey bindings:\n- `q`: to quit\n- `f`: to filter bag files\n- `w`: to load whitelist\n- `s`: to save whitelist\n- `a`: to toggle select all topics\n\n## Compression Support\n\nRose supports automatic compression of filtered bag files to significantly reduce file sizes. This is especially useful for storing and transferring large bag files.\n\n### Available Compression Types\n\n| Type | Description | Compression Ratio | Speed | Use Case |\n|------|-------------|------------------|-------|----------|\n| `none` | No compression | 0% | Fastest | When processing speed is critical |\n| `bz2` | BZ2 compression | ~80-90% | Slower | Best for long-term storage |\n| `lz4` | LZ4 compression | ~60-70% | Faster | Good balance of speed and compression |\n\n### Using Compression\n\nCompression options are presented to users during the filtering process. By default, Rose uses no compression for fastest processing speed. Users can choose from:\n\n- **No compression**: Fastest processing, largest files\n- **BZ2 compression**: Best compression ratio, slower processing  \n- **LZ4 compression**: Balanced speed and compression\n\n**Example compression results:**\n- Original bag file: 696.15 MB\n- After BZ2 compression: 92.03 MB  \n- **Compression ratio: 86.8%**\n\n### Programmatic Usage\n\n```python\nfrom roseApp.core.BagManager import BagManager, CompressionType\nfrom roseApp.core.parser import create_parser, ParserType\n\n# Create parser and bag manager\nparser = create_parser(ParserType.PYTHON)\nbag_manager = BagManager(parser)\n\n# Load bag and select topics\nbag_manager.load_bag(Path(\"input.bag\"))\nbag_manager.select_topic(\"/your_topic\")\n\n# Get filter configuration with desired compression\nbag = bag_manager.get_single_bag()\nconfig = bag.get_filter_config(compression=\"bz2\")  # or \"none\", \"lz4\"\n\n# Filter with specified compression\nbag_manager.filter_bag(Path(\"input.bag\"), config, Path(\"output.bag\"))\n```\n\n### Command Line Usage\n\n```bash\n# Filter with BZ2 compression\nrose filter input.bag output.bag -w whitelist.txt -c bz2\n\n# Filter with no compression (fastest)\nrose filter input.bag output.bag -w whitelist.txt -c none\n\n# Filter with LZ4 compression (balanced)\nrose filter input.bag output.bag -w whitelist.txt -c lz4\n```\n\n> **Note**: LZ4 compression requires additional system dependencies. If LZ4 is not available, BZ2 compression will be used as fallback.\n\n#### Configuration\n\nRose is configured with `roseApp/config.json`.\n```json\n{\n    \"show_splash_screen\": true,\n    \"theme\": \"cassette-walkman\",\n    \"whitelists\": {\n        \"demo\": \"./whitelists/demo.txt\",\n        \"radar\": \"./whitelists/radar.txt\",\n        \"invalid\": \"./whitelists/invalid.txt\"\n    }\n}\n```\n\n- `show_splash_screen`: whether to show the splash screen, default is true\n- `theme`: the theme of the TUI, default is `cassette-walkman`, check [Theme](#theme) for more details\n- `whitelists`: the whitelists of the TUI, default is empty, check [Whitelist](#whitelist) for more details\n\n#### Theme\nRoseApp TUI provides two built-in themes: `cassette-walkman` (default light theme) and `cassette-dark`. You can configure the theme in two ways:\n\n| cassette-walkman | cassette-dark |\n|------------|-------------|\n| ![Light Theme TUI](screen-shots/main-light.png) | ![Dark Theme TUI](screen-shots/main-dark.png) |\n\n1. Modify `config.json` to specify your preferred theme:\n\n```json\n{\n    \"theme\": \"cassette-dark\",\n}\n```\n2. Switch Theme in TUI with command palette(the buttom in bottom right corner or keybinding ^p)\n\n\n### Whitelist\n\nYou can filter bag files with pre-configured whitelist. To select pre-configured whitelists, press `w` in TUI. But before that, you need to create your own whitelist.\n\nYou can create your own whitelist in 3 ways:\n\n#### 1. Create topic whitelist with your favorite text editor and save it to `whitelist/`:\n\n\n#### 2. Create whitelist with interactive cli and choose **2. whitelist**:\n```bash\nrose cli\n```\n\n![asciicast](screen-shots/whitelist.gif)\n\n#### 3. Create topic in TUI by press `s` to save current selected topics as whitelist file to `whitelist/` directory:\n\nyou can create/view/delete whitelists\n\n![asciicast](screen-shots/tui-whitelist.gif)\n\n\nAfter whitelist created, add it to `config.json` so RoseApp can find it:\n```json\n{\n    \"whitelists\": {\n        \"demo\": \"./whitelists/demo.txt\",\n        \"radar\": \"./whitelists/radar.txt\",\n        \"invalid\": \"./whitelists/invalid.txt\"\n    }\n}\n```\n\n## Development\n\n### Run locally\n\n```bash\npython -m roseApp.rose --help\n```\n\n### Publishing to PyPI\n\nTo publish a new version to PyPI:\n\n1. Update version in `pyproject.toml`\n2. Install required tools:\n```bash\npip install keyring keyrings.alt\n```\n\n3. Configure PyPI credentials:\n```bash\n# Using environment variables\nexport HATCH_INDEX_USER=__token__\nexport HATCH_INDEX_AUTH=your_pypi_token\n\n# Or using hatch config\nhatch config set pypi.auth.username __token__\nhatch config set pypi.auth.password your_pypi_token\n```\n\n4. Build and publish:\n```bash\n# Build the package\nhatch build\n\n# Publish to PyPI\nhatch publish\n```\n\n### Project Structure\n```\nproject_root/\n\u251c\u2500\u2500 roseApp/                # Python application\n\u2502   \u251c\u2500\u2500 rose.py             # Main entry script\n\u2502   \u251c\u2500\u2500 cli/                # CLI tools\n\u2502   \u2502   \u251c\u2500\u2500 cli_tool.py     # Interactive CLI implementation\n\u2502   \u2502   \u251c\u2500\u2500 theme.py        # CLI theme and color configuration\n\u2502   \u2502   \u2514\u2500\u2500 <inline-cmd>.py # Command-line commands implementation\n\u2502   \u251c\u2500\u2500 core/               # Core functionality\n\u2502   \u2502   \u251c\u2500\u2500 parser.py       # Bag file parser\n\u2502   \u2502   \u2514\u2500\u2500 util.py         # Utility functions and logging\n\u2502   \u251c\u2500\u2500 tui/                # TUI components\n\u2502   \u2502   \u251c\u2500\u2500 tui.py          # Main TUI application\n\u2502   \u2502   \u2514\u2500\u2500 components/     # Custom widgets\n\u2502   \u2502   \u251c\u2500\u2500 config.json     # Configuration file\n\u2502   \u2502   \u251c\u2500\u2500 themes/         # TUI themes\n\u2502   \u2502   \u2514\u2500\u2500 style.tcss          # TUI style sheet\n\u2502   \u251c\u2500\u2500 whitelists/         # Topic whitelist folder\n\u2502   \u2502   \u2514\u2500\u2500 *.txt           # Whitelist files\n\u251c\u2500\u2500 docker/                 # Docker support\n\u2502   \u251c\u2500\u2500 Dockerfile\n\u2502   \u2514\u2500\u2500 go_docker.sh\n\u251c\u2500\u2500 docs/                   # Documentation\n\u251c\u2500\u2500 pyproject.toml          # Project metadata and dependencies\n\u251c\u2500\u2500 requirements.txt        # Development dependencies\n\u2514\u2500\u2500 README.md               # Project documentation\n```\n\n### Tech stack\n\n- **[Textual](https://textual.textualize.io/)**: A Python framework for building sophisticated TUI applications. Used for creating the interactive terminal interface.\n- **[Rich](https://rich.readthedocs.io/)**: A Python library for rich text and beautiful formatting in the terminal. Used for enhancing the visual presentation in both CLI and TUI.\n- **[InquirerPy](https://github.com/kazhala/InquirerPy)**: A Python library for building interactive command line interfaces with elegant prompts. Used for the interactive CLI.\n- **[Typer](https://typer.tiangolo.com/)**: A Python library for building CLI applications. Used for building the inline command-line interface.\n- **[rosbags](https://pypi.org/project/rosbags/)**: A pure Python library for reading and writing ROS bag files. Used for ROS bag file processing without ROS dependencies.\n\n### Rough ideas - data driven rendering\n\n![1](docs/notes/sketch.png)\n\n>[!TIP]\n> Before you start with Textual, there are some docs worth reading:\n>\n> - [Textual devtools](https://textual.textualize.io/guide/devtools/) on how to use `textual run <your app> --dev` to go into dev mode and how to handle logs\n> - [Design a layout](https://textual.textualize.io/how-to/design-a-layout/) \u3001[TextualCSS](https://textual.textualize.io/guide/CSS/) and [CSS Types](https://textual.textualize.io/css_types/) to understand how to design a layout and style your app with CSS. and more tips on [Styles](https://textual.textualize.io/guide/styles/) and its [reference](https://textual.textualize.io/styles/)\n> - [Event and Messages](https://textual.textualize.io/guide/events/) are also important ideas to understand how Textual works so you can handle [actions](https://textual.textualize.io/guide/actions/)\n> - Thanks to [Workers](https://textual.textualize.io/guide/workers/), asynchronous operations never been so easy. it can supppot asyncio or threads.\n\n## Resources\n\n- Demo bag file: [webviz demo.bag](https://storage.googleapis.com/cruise-webviz-public/demo.bag)\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Lingfengai\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE. ",
    "summary": "A modern CLI/TUI tool for ROS bag file analysis and filtering",
    "version": "0.6.9",
    "project_urls": {
        "Bug Tracker": "https://github.com/hanxiaomax/rose/issues",
        "Homepage": "https://github.com/hanxiaomax/rose"
    },
    "split_keywords": [
        "bag",
        " cli",
        " filter",
        " robotics",
        " ros",
        " tui",
        " visualization"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cc216b25d3299fd440b4c976ebb94dd1ed0964f04dc022f5fd552f712b0d93ca",
                "md5": "b0cd5e9c256e542174d2ba1bdf62eb74",
                "sha256": "205c8c5eaabc661e60be3d69e83115784641a0eec0b288094beed560b78d1509"
            },
            "downloads": -1,
            "filename": "rose_bag-0.6.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b0cd5e9c256e542174d2ba1bdf62eb74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 117918,
            "upload_time": "2025-07-15T00:16:03",
            "upload_time_iso_8601": "2025-07-15T00:16:03.896900Z",
            "url": "https://files.pythonhosted.org/packages/cc/21/6b25d3299fd440b4c976ebb94dd1ed0964f04dc022f5fd552f712b0d93ca/rose_bag-0.6.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9c3378f123f6c5edf419c1a530d5a08cc75c8d9074cfa6466589dec1950393e7",
                "md5": "96f1f4f5234337d2abb5e72ca60999f4",
                "sha256": "3830f62a7f4830ec88028658aa7811c264d34aedab1f069c874119c10ce9cc35"
            },
            "downloads": -1,
            "filename": "rose_bag-0.6.9.tar.gz",
            "has_sig": false,
            "md5_digest": "96f1f4f5234337d2abb5e72ca60999f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 98194,
            "upload_time": "2025-07-15T00:16:02",
            "upload_time_iso_8601": "2025-07-15T00:16:02.156212Z",
            "url": "https://files.pythonhosted.org/packages/9c/33/78f123f6c5edf419c1a530d5a08cc75c8d9074cfa6466589dec1950393e7/rose_bag-0.6.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-15 00:16:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hanxiaomax",
    "github_project": "rose",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "textual",
            "specs": [
                [
                    ">=",
                    "0.40.0"
                ]
            ]
        },
        {
            "name": "rosbags",
            "specs": [
                [
                    ">=",
                    "0.9.16"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "13.0.0"
                ]
            ]
        },
        {
            "name": "typer",
            "specs": [
                [
                    ">=",
                    "0.9.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "8.0.0"
                ]
            ]
        },
        {
            "name": "InquirerPy",
            "specs": [
                [
                    ">=",
                    "0.3.4"
                ]
            ]
        }
    ],
    "lcname": "rose-bag"
}
        
Elapsed time: 0.44404s