Metadata-Version: 2.1
Name: cube-utils
Version: 0.1.0
Summary: Python functions for Cube projects using cube.py config file.
Author-Email: Paco Valdez <paco.valdez@berkeley.edu>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Cube Utils

Cube Utils is a Python library for parsing and extracting information from query payloads.

## Installation

You can install Cube Utils using pip:


```sh
pip install cube-utils
```

Usage
Here is an example of how to use the extract_cubes function from the cube_utils.query_parser module:

from cube_utils.query_parser import extract_cubes

```python
# Example payload
payload = {
    "dimensions": ["test_a.city", "test_a.country", "test_a.state"],
    "measures": ["test_b.count"],
    "filters": [
        {"values": ["US"], "member": "test_a.country", "operator": "equals"}
    ],
    "timeDimensions": [
        {
            "dimension": "test_c.time",
            "dateRange": ["2021-01-01", "2021-12-31"],
            "granularity": "month",
        }
    ],
}

# Extract cubes
cubes = extract_cubes(payload)
print(cubes)  # Output: ['test_a', 'test_b', 'test_c']
```

## Running Tests
To run the tests, use the following command:
    
```sh
python -m unittest discover tests
```

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
