semvec/pypi-packages huggingface dataset:
ngawari 0.1.17
A simple and functional toolkit for working with data in VTK.
License: MIT
Requires Python: >=3.9

# Ngawari

Ngawari is a Python-based toolkit for simplifying operations in data analysis and processing, particularly focused on medical imaging and computational geometry. It is built heavily on top of the [VTK library](https://vtk.org/).

## Features

- Advanced geometric calculations and transformations
- Medical imaging data processing
- Statistical analysis tools
- 3D visualization capabilities

## Installation

To install Ngawari, run the following command:

```bash
pip install ngawari
```

## Usage

Here's a quick example of how to use Ngawari:

```python
from ngawari import ftk, fIO, vtkfilters
import numpy as np

# Create a simple sphere
sphere = vtkfilters.buildSphereSource([0, 0, 0], radius=1.0)

# Get points as numpy array
points = vtkfilters.getPtsAsNumpy(sphere)

# Add a scalar array
vtkfilters.setArrayFromNumpy(sphere, points[:, 0], "x_coords", SET_SCALAR=True)

# Apply a filter
smoothed = vtkfilters.smoothTris(sphere, iterations=10)

# Write to file
fIO.writeVTKFile(smoothed, "smoothed_sphere.vtp")

# Build image over sphere:
image = vtkfilters.buildRawImageDataFromPolyData(smoothed, res=[0.1,0.1,0.1])

# Add a scalar array to the image
vtkfilters.setArrayFromNumpy(image, np.random.rand(image.GetNumberOfPoints()), "random_scalar", SET_SCALAR=True)

# Null scalars outside sphere
image_nulled = vtkfilters.filterNullOutsideSurface(image, smoothed)

# Write to file
fIO.writeVTKFile(image_nulled, "image_over_sphere.vti")
```

For more detailed usage instructions, please refer to the documentation.

## Documentation 

Full documentation is available at [https://fraser29.github.io/ngawari/](https://fraser29.github.io/ngawari/)

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details.

## License

Ngawari is released under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Contact

For any questions or support, please open an issue on our [GitHub repository](https://github.com/fraser29/ngawari) or contact us at support@ngawari.com.

## Dependencies

This project uses the following major dependencies:
- VTK (BSD 3-Clause License) - https://vtk.org/
engrate-sdk 0.0.24
Engrate SDK for plugin developers
License: MIT
Requires Python: >=3.8
Keywords: api-client, energy, engrate, http-client, logging, mcp, plugins, sdk

# Engrate SDK

A utility SDK providing common services for logging, configuration, and HTTP clients to connect the Engrate Platform.

## Features

- Simple and consistent logging interface
- Flexible configuration management
- HTTP client utilities for seamless API integration
- TypeScript support

## Installation

Add the dependency to your project configuration (i.e. UV):

```code
"engrate-sdk ~= 0.0.16"
```
Then update your local environment
```bash
uv pip install .
```

## Usage

```python
from engrate_sdk import Logger, Config, HttpClient

# Logging
logger = Logger()
logger.info('Engrate SDK initialized')

# Configuration
config = Config()
config.load_from_env()

# HTTP Client
client = HttpClient(base_url=config.get('API_URL'))
response = client.get('/status')
```

## Registry

The library contains a ```regystry.py``` module which provides access to our internal plugin registry. Every plugin has to call to the ```register_plugin()``` method
at some point in the plugin bootstrap process (if using ```FastAPI``this is usually recommended to use a lifespan function). 

```python
@asynccontextmanager
async def lifespan(fast_app: FastAPI):
    """Startup and shutdown logic using lifespan events."""
    try:
        print("Validating environment variables...")
        env.validate()
        if env.should_register():
            logger.info("Registering plugin...")
            plugin = PluginRegistry(registrar_url=env.get_registrar_url())
            await plugin.register_plugin()
        yield
    finally:
        logger.info("Shutting down application...")
```
This method will look for a ```plugin_manifest.yaml```file at root level of the project (it's also possible to provide an url when initializing the ```PluginRegistry```object) This file must exist and contain the following format ***(WIP: this might change in the near future)***:

 ```yaml
name: "power-tariffs"
author: "Energy development solutions"
description: "Test plugin to use Engrate SDK"
product_category: "market_intelligence"
extensions:
  markets:
    - "*"
    - "nl"
    - "de"
    - "se"
plugin_metadata:
  display_name: "Demo Plugin"
  service_name: "demo-plugin"
  url_prefix: "demo-plugin"
  fav_icon: ""
  image: ""
  port: "3111"
  api_version: "v1"
  flavors:
    - "external-api"
  traits:
    - "storage"

 ```

### Mock registrar
For testing purposes, the library includes a ```mock registrar```that mimics the behaviour for the actual registrar in the core services. This is a simple ```FastApi``` server that will
implement the required endpoints for puglins lifecycle.

## Documentation

[TODO]

## License

[TBD]