semvec/pypi-packages huggingface dataset:
gradio-spreadsheetcomponent 0.0.3
This component is used to answer questions about spreadsheets.
Requires Python: >=3.10
Keywords: gradio-custom-component, gradio-spreadsheet-custom-component

---
tags: [gradio-custom-component, custom-component-track, gradio-spreadsheet-custom-component]
title: gradio_spreadsheetcomponent
short_description: This component answers questions about spreadsheets.
colorFrom: blue
colorTo: yellow
sdk: gradio
pinned: false
app_file: space.py
app_link: https://huggingface.co/spaces/Mustafiz996/gradio_spreadsheetcomponent
---

# `gradio_spreadsheetcomponent`
<a href="https://pypi.org/project/gradio_spreadsheetcomponent/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_spreadsheetcomponent"></a>  

This component is used to answer questions about spreadsheets.

## Installation

```bash
pip install gradio_spreadsheetcomponent
```

## Usage

```python
import gradio as gr
from gradio_spreadsheetcomponent import SpreadsheetComponent
from dotenv import load_dotenv
import os
import pandas as pd

def answer_question(file, question):
    if not file or not question:
        return "Please upload a file and enter a question."
    
    # Load the spreadsheet data
    df = pd.read_excel(file.name)
    
    # Create a SpreadsheetComponent instance
    spreadsheet = SpreadsheetComponent(value=df)
    
    # Use the component to answer the question
    return spreadsheet.answer_question(question)

with gr.Blocks() as demo:
    gr.Markdown("# Spreadsheet Question Answering")
    
    with gr.Row():
        file_input = gr.File(label="Upload Spreadsheet", file_types=[".xlsx"])
        question_input = gr.Textbox(label="Ask a Question")
    
    answer_output = gr.Textbox(label="Answer", interactive=False, lines=4)
    
    submit_button = gr.Button("Submit")
    submit_button.click(answer_question, inputs=[file_input, question_input], outputs=answer_output)

    
if __name__ == "__main__":
    demo.launch()

```

## `SpreadsheetComponent`

### Initialization

<table>
<thead>
<tr>
<th align="left">name</th>
<th align="left" style="width: 25%;">type</th>
<th align="left">default</th>
<th align="left">description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>value</code></td>
<td align="left" style="width: 25%;">

```python
pandas.core.frame.DataFrame | list | dict | None
```

</td>
<td align="left"><code>None</code></td>
<td align="left">Default value to show in spreadsheet. Can be a pandas DataFrame, list of lists, or dictionary</td>
</tr>
</tbody></table>




### User function

The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).

- When used as an Input, the component only impacts the input signature of the user function.
- When used as an output, the component only impacts the return signature of the user function.

The code snippet below is accurate in cases where the component is used as both an input and an output.

- **As output:** Is passed, the preprocessed input data sent to the user's function in the backend.


 ```python
 def predict(
     value: typing.Any
 ) -> Unknown:
     return value
 ```
netcup-dns 0.3.1
Update DNS records with your current external IP address using the netcup DNS API.
Requires Python: >=3.10.0

# netcup-dns

Update DNS A/AAAA records with your current external IP address using the netcup DNS API.

## Installation

Install release from PyPI (https://pypi.org/project/netcup-dns/):

```shell
pip install netcup-dns
```

Install release from TestPyPI (https://test.pypi.org/project/netcup-dns/):

```shell
pip install -i https://test.pypi.org/simple/ netcup-dns
```

Build and install on Arch Linux:

```shell
make
```

Build and install with `pip`:

```shell
make install-pip
```

## Configuration

For each netcup customer, create a `.json` configuration file inside `/etc/netcup-dpns`.

There is an [example configuration](cfg/example.json).

## Usage

```
usage: netcup-dns [-h] [--config CFG_FILES [CFG_FILES ...]]
                  [--cache-directory CACHE_DIR]
                  [--cache-validity-seconds CACHE_VALIDITY_SECONDS]

Update DNS A/AAAA records with your current external IP address using the
netcup DNS API.

options:
  -h, --help            show this help message and exit
  --config CFG_FILES [CFG_FILES ...]
                        Path to one or more .json configuration files.
  --cache-directory CACHE_DIR
                        Path to cache directory. Retrieved and updated DNS
                        records are cached there.
  --cache-validity-seconds CACHE_VALIDITY_SECONDS
                        Value in seconds for how long cached DNS records are
                        valid. Set to `0` to disable caching.
```

### Examples

Both examples use the same effective configuration. In the second case, personal information such as the API password is stored in a separate configuration file. 

```shell
netcup-dns --config ./cfg/example.json
netcup-dns --config ./cfg/public.json ./cfg/secret.json
```

## TODOs

API backend:

- Currently: nc-dnsapi
  - https://pypi.org/project/nc-dnsapi/
  - https://github.com/nbuchwitz/nc_dnsapi
- Alternatives:
  - https://github.com/johndoe31415/dnssync_nc

Alternative external IP detection:

```python
def external_ip_upnp():
    """
    https://stackoverflow.com/a/41385033

    Didn't work for me. Even after double checking fritz.box settings:

    fritz.box > Heimnetz > Netzwerk > Statusinformationen über UPnP übertragen
    """
    import miniupnpc
    u = miniupnpc.UPnP()
    u.discoverdelay = 1000
    u.discover()
    u.selectigd()
    print('external ip address: {}'.format(u.externalipaddress()))
```
hkopenai.hk-education-mcp-server 0.1.8
Hong Kong education MCP Server providing education data tools
Requires Python: >=3.7

# Hong Kong Education Data MCP Server

[![GitHub Repository](https://img.shields.io/badge/GitHub-Repository-blue.svg)](https://github.com/hkopenai/hk-education-mcp-server)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

This is an MCP server that provides access to Hong Kong government data related to education and security incidents through a FastMCP interface.

## Features

### Student Enrolment Data
- Get student enrolment in primary schools by district and grade in Hong Kong [url](https://data.gov.hk/en-data/dataset/hk-edb-figustat-stu-pri-dis-gra)

## Data Source

- Student enrolment data from Education Bureau

## Examples

* Get student enrolment data by district and grade

## Setup

1. Clone this repository
2. Install Python dependencies:
   ```bash
   pip install -r requirements.txt
   ```
3. Run the server:
   ```bash
   python app.py
   ```

### Running Options

- Default stdio mode: `python app.py`
- SSE mode (port 8000): `python app.py --sse`

## Cline Integration

To connect this MCP server to Cline using stdio:

1. Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
```json
{
  "hk-education": {
    "disabled": false,
    "timeout": 3,
    "type": "stdio",
    "command": "uvx",
    "args": [
      "hkopenai.hk-education-mcp-server"
    ]
  }
}
```

## Testing

Tests are available in the `tests/` directory. Run with:
```bash
pytest
```