Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 206 additions & 119 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions data/batch/file1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name,Score,Value,Category
Alice,85,120,A
Bob,92,150,B
Charlie,78,95,A
4 changes: 4 additions & 0 deletions data/batch/file2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name,Score,Value,Category
Diana,88,110,C
Eve,95,180,B
Frank,72,85,A
5 changes: 5 additions & 0 deletions data/batch/file3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name,Score,Value,Category
Grace,91,160,C
Henry,83,105,B
Iris,89,140,A
Jack,76,90,C
11 changes: 11 additions & 0 deletions data/sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Name,Score,Value,Category
Alice,85,120,A
Bob,92,150,B
Charlie,78,95,A
Diana,88,110,C
Eve,95,180,B
Frank,72,85,A
Grace,91,160,C
Henry,83,105,B
Iris,89,140,A
Jack,76,90,C
57 changes: 57 additions & 0 deletions my_dh_cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# My Deephaven CLI

A CLI-only package providing command-line tools for data processing with Deephaven. This package is designed to be installed and run as a command-line tool.

## Installation

```shell
pip install .
```

Or in editable mode for development:

```shell
pip install -e .
```

## Usage

> [!NOTE]
> CLI functions require a Deephaven server running in the same Python process. Use the functions within a Python session where the server is already started.

```shell
pip install -e .
python
```

Then in Python:

```python
# Start the Deephaven server
from deephaven_server import Server
server = Server(port=10000, jvm_args=["-Xmx4g"])
server.start()

# Now use the CLI function
from my_dh_cli.cli import my_dh_query
result = my_dh_query("../data/sample.csv", verbose=True)
print(f"Processed {result.size} rows")
```

## Commands

### my-dh-query

Process a CSV file with Deephaven.

**Arguments:**
- `input_file` - Path to the CSV file to process

**Options:**
- `--verbose, -v` - Enable verbose output

## Requirements

- Python 3.8 or later
- Deephaven Server 0.35.0 or later
- Click 8.0.0 or later
20 changes: 20 additions & 0 deletions my_dh_cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "my_dh_cli"
version = "0.1.0"
description = "Command-line tool for data processing"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"deephaven-server>=0.35.0",
"click>=8.0.0",
]

[project.scripts]
my-dh-query = "my_dh_cli.cli:app"

[tool.setuptools.packages.find]
where = ["src"]
59 changes: 59 additions & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Metadata-Version: 2.4
Name: my_dh_cli
Version: 0.1.0
Summary: Command-line tool for data processing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: deephaven-server>=0.35.0
Requires-Dist: click>=8.0.0

# My Deephaven CLI

A CLI-only package providing command-line tools for data processing with Deephaven. This package is designed to be installed and run as a command-line tool.

## Installation

```shell
pip install .
```

Or in editable mode for development:

```shell
pip install -e .
```

## Usage

After installation, use the command-line tool:

```shell
my-dh-query input_data.csv
my-dh-query input_data.csv --verbose
```

### Module Execution

You can also run without installation using module execution:

```shell
python -m my_dh_cli input_data.csv
```

## Commands

### my-dh-query

Process a CSV file with Deephaven.

**Arguments:**
- `input_file` - Path to the CSV file to process

**Options:**
- `--verbose, -v` - Enable verbose output

## Requirements

- Python 3.8 or later
- Deephaven Server 0.35.0 or later
- Click 8.0.0 or later
Comment thread
elijahpetty marked this conversation as resolved.
11 changes: 11 additions & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
README.md
pyproject.toml
src/my_dh_cli/__init__.py
src/my_dh_cli/__main__.py
src/my_dh_cli/cli.py
src/my_dh_cli.egg-info/PKG-INFO
src/my_dh_cli.egg-info/SOURCES.txt
src/my_dh_cli.egg-info/dependency_links.txt
src/my_dh_cli.egg-info/entry_points.txt
src/my_dh_cli.egg-info/requires.txt
src/my_dh_cli.egg-info/top_level.txt
Comment thread
elijahpetty marked this conversation as resolved.
1 change: 1 addition & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Comment thread
elijahpetty marked this conversation as resolved.
2 changes: 2 additions & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[console_scripts]
my-dh-query = my_dh_cli.cli:app
Comment thread
elijahpetty marked this conversation as resolved.
2 changes: 2 additions & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deephaven-server>=0.35.0
click>=8.0.0
Comment thread
elijahpetty marked this conversation as resolved.
1 change: 1 addition & 0 deletions my_dh_cli/src/my_dh_cli.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
my_dh_cli
Comment thread
elijahpetty marked this conversation as resolved.
3 changes: 3 additions & 0 deletions my_dh_cli/src/my_dh_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""My Deephaven package for data processing."""

__version__ = "0.1.0"
4 changes: 4 additions & 0 deletions my_dh_cli/src/my_dh_cli/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from my_dh_cli.cli import app

if __name__ == "__main__":
app()
Binary file not shown.
Binary file not shown.
31 changes: 31 additions & 0 deletions my_dh_cli/src/my_dh_cli/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import click


def my_dh_query(input_file: str, verbose: bool = False):
"""Read a CSV file and perform a simple query operation on the data."""
from deephaven import read_csv

if verbose:
click.echo(f"Processing {input_file}...")

source = read_csv(input_file)

result = source.update(formulas=["DoubleScore = Score * 2"])
Comment thread
elijahpetty marked this conversation as resolved.

if verbose:
click.echo(f"Processed {result.size} rows")

return result


@click.command()
@click.argument("input_file", type=click.Path(exists=True))
@click.option("--verbose", "-v", is_flag=True, help="Enable verbose output")
def app(input_file: str, verbose: bool) -> None:
"""Process data with Deephaven."""
result = my_dh_query(input_file, verbose)
Comment thread
elijahpetty marked this conversation as resolved.
click.echo("Processing complete!")


if __name__ == "__main__":
app()
55 changes: 55 additions & 0 deletions my_dh_library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# My Deephaven Library

A library-only package providing reusable Deephaven query functions. This package contains no CLI tools - it's designed to be imported and used as a library in other Python projects.

## Installation

```shell
pip install .
```

Or in editable mode for development:

```shell
pip install -e .
```

## Usage

> [!NOTE]
> All Deephaven functionality requires a running server. Start the server before importing Deephaven modules.

Import and use the library functions in your Python code:

```python
# Start the Deephaven server
from deephaven_server import Server
server = Server(port=10000, jvm_args=["-Xmx4g"])
server.start()

# Now use the library functions
from my_dh_library.queries import filter_by_threshold, add_computed_columns
from deephaven import read_csv

data = read_csv("data.csv")
filtered = filter_by_threshold(data, "Score", 75.0)
enhanced = add_computed_columns(filtered)
```

## Available Functions

### Query Functions (`my_dh_library.queries`)
Comment thread
elijahpetty marked this conversation as resolved.

- `filter_by_threshold(table, column, threshold)` - Filter table rows where column value exceeds threshold
- `add_computed_columns(table)` - Add commonly used computed columns to a table
- `summarize_by_group(table, group_col, value_col)` - Create summary statistics grouped by a column

### Utility Functions (`my_dh_library.utils`)
Comment thread
elijahpetty marked this conversation as resolved.

- `validate_columns(table, required_columns)` - Check if table has all required columns
- `get_table_info(table)` - Get basic information about a table

## Requirements

- Python 3.8 or later
- Deephaven Server 0.35.0 or later
16 changes: 16 additions & 0 deletions my_dh_library/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "my_dh_library"
version = "0.1.0"
description = "Reusable Deephaven query functions"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"deephaven-server>=0.35.0",
]

[tool.setuptools.packages.find]
where = ["src"]
55 changes: 55 additions & 0 deletions my_dh_library/src/my_dh_library.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Metadata-Version: 2.4
Name: my_dh_library
Version: 0.1.0
Summary: Reusable Deephaven query functions
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: deephaven-server>=0.35.0

# My Deephaven Library

A library-only package providing reusable Deephaven query functions. This package contains no CLI tools - it's designed to be imported and used as a library in other Python projects.

## Installation

```shell
pip install .
```

Or in editable mode for development:

```shell
pip install -e .
```

## Usage

Import and use the library functions in your Python code:

```python
from my_dh_library.queries import filter_by_threshold, add_computed_columns
from deephaven import read_csv

# Use the library functions
data = read_csv("data.csv")
filtered = filter_by_threshold(data, "Score", 75.0)
enhanced = add_computed_columns(filtered)
```

## Available Functions

### Query Functions (`my_dh_package.queries`)

- `filter_by_threshold(table, column, threshold)` - Filter table rows where column value exceeds threshold
- `add_computed_columns(table)` - Add commonly used computed columns to a table
- `summarize_by_group(table, group_col, value_col)` - Create summary statistics grouped by a column

### Utility Functions (`my_dh_package.utils`)
Comment thread
elijahpetty marked this conversation as resolved.
Outdated
Comment thread
elijahpetty marked this conversation as resolved.
Outdated

- `validate_columns(table, required_columns)` - Check if table has all required columns
- `get_table_info(table)` - Get basic information about a table

## Requirements

- Python 3.8 or later
- Deephaven Server 0.35.0 or later
Comment thread
elijahpetty marked this conversation as resolved.
10 changes: 10 additions & 0 deletions my_dh_library/src/my_dh_library.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
README.md
pyproject.toml
src/my_dh_library/__init__.py
src/my_dh_library/queries.py
src/my_dh_library/utils.py
src/my_dh_library.egg-info/PKG-INFO
src/my_dh_library.egg-info/SOURCES.txt
src/my_dh_library.egg-info/dependency_links.txt
src/my_dh_library.egg-info/requires.txt
src/my_dh_library.egg-info/top_level.txt
Comment thread
elijahpetty marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Comment thread
elijahpetty marked this conversation as resolved.
1 change: 1 addition & 0 deletions my_dh_library/src/my_dh_library.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deephaven-server>=0.35.0
Comment thread
elijahpetty marked this conversation as resolved.
1 change: 1 addition & 0 deletions my_dh_library/src/my_dh_library.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
my_dh_library
Comment thread
elijahpetty marked this conversation as resolved.
7 changes: 7 additions & 0 deletions my_dh_library/src/my_dh_library/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""My Deephaven package for data processing."""

__version__ = "0.1.0"

from my_dh_library.queries import filter_by_threshold, add_computed_columns, summarize_by_group

__all__ = ["filter_by_threshold", "add_computed_columns", "summarize_by_group"]
Binary file not shown.
Binary file not shown.
Loading
Loading