semvec/pypi-packages huggingface dataset:
sirc 1.2.0
SIRC - Digital Logic and Circuit Simulation Engine
Requires Python: >=3.12
Keywords: digital logic, circuit simulation, simulation engine

# SIRC

## SIRC - Digital Logic and Circuit Simulation Engine

SIRC is a lightweight, fully typed Python library for simulating digital logic
at the transistor level. It models Nodes, Devices, and Transistors and computes
stable LogicValues through fixed-point iteration and dynamic connectivity.

---

## 📦 Installation

Install from PyPI:

```bash
pip install sirc
```

Import the device simulator:

```python
from sirc.simulator.device import DeviceSimulator
```

---

## 🚀 Quick Start

```python
from sirc.simulator.device import DeviceSimulator
from sirc.core.logic import LogicValue
from sirc.core.transistor import NMOS, PMOS
from sirc.core.device import VDD, GND, Input, Probe, Port

sim = DeviceSimulator()

# Create Devices and Transistors
vdd = VDD()
gnd = GND()

inp = Input()
probe = Probe()

inp_port = Port()
out_port = Port()

pmos = PMOS()
nmos = NMOS()

# Register Devices and Transistors
sim.register_devices([vdd, gnd, inp, probe, inp_port, out_port])
sim.register_transistors([pmos, nmos])

# Connect Components
sim.connect(inp.terminal, inp_port.terminal)
sim.connect(inp_port.terminal, pmos.gate)
sim.connect(inp_port.terminal, nmos.gate)
sim.connect(vdd.terminal, pmos.source)
sim.connect(gnd.terminal, nmos.source)
sim.connect(pmos.drain, out_port.terminal)
sim.connect(nmos.drain, out_port.terminal)
sim.connect(out_port.terminal, probe.terminal)

# Simulate and Sample Output
inp.set_value(LogicValue.ONE)
sim.build_topology()
sim.tick()
print(repr(probe.sample()))

# Change Input and Resimulate
inp.set_value(LogicValue.ZERO)
sim.build_topology()
sim.tick()
print(repr(probe.sample()))
```

---

## 🔧 Features

### Core Devices

- `VDD`
- `GND`
- `Input`
- `Probe`
- `Port`

### Transistors

- `NMOS`
- `PMOS`

### Fully Typed

```python
from sirc.simulator.device import DeviceSimulator
from sirc.core.logic import LogicValue
from sirc.core.node import Node
from sirc.core.device import LogicDevice, VDD, GND, Input, Probe, Port
from sirc.core.transistor import Transistor, NMOS, PMOS
```

---

## 📂 Project Structure

```bash
src/
    sirc/
        core/
            device.py
            logic.py
            node.py
            transistor.py
        simulator/
            device.py
stats/
    main.py
tests/
    sirc/
        core/
            test_device.py
            test_logic.py
            test_node.py
            test_transistor.py
        simulator/
            test_device.py
```

---

## 🧪 Testing

Run the full test suite:

```bash
pytest
```

---

## 📝 License

MIT License

---

## 🔗 Links

- PyPI: https://pypi.org/project/sirc/
- Source Code: https://github.com/CRISvsGAME/sirc
xtai-mcp-data-analysis 0.1.0
a data analysis mcp-server
Requires Python: >=3.12


# xtai-mcp-data-analysis

一个基于MCP协议的数据分析和可视化 MCP server，支持CSV和Excel格式的数据文件处理。

## 功能特性

- **数据概览**：获取数据的表头信息、字段类型、数据条数等基本信息
- **数据汇总分析**：计算数值列的平均值、中位数、方差等统计指标
- **多维数据透视可视化**：生成柱状图、饼图、热力图、堆叠图等多种可视化图表
- **灵活的聚合函数**：支持求和(sum)、平均(mean)、计数(count)、最大值(max)、最小值(min)等多种聚合方式


## 如何在客户端引用

在MCP客户端配置中添加如下配置：

```
{
  "mcpServers": {
    "xtai-mcp-data-analysis": {
      "command": "uvx",
      "args": ["xtai-mcp-data-analysis"]
    }
  }
}
```

## 提供的工具

### 1. data_overview

获取数据的基本概览信息。

**参数：**
- `data_path`: 数据文件路径，支持.csv、.xlsx、.xls格式

**示例：**
```json
{
  "name": "data_overview",
  "arguments": {
    "data_path": "./sales_data.csv"
  }
}
```

### 2. data_summary

获取数据的汇总分析情况，包括数值列统计、类别列统计和缺失值统计。

**参数：**
- `data_path`: 数据文件路径，支持.csv、.xlsx、.xls格式

**示例：**
```json
{
  "name": "data_summary",
  "arguments": {
    "data_path": "./sales_data.xlsx"
  }
}
```

### 3. visualize_data

通过数据透视的方式可视化数据。

**参数：**
- `data_path`: 数据文件路径，支持.csv、.xlsx、.xls格式
- `index`: 数据透视的索引列名列表，支持1-2个维度，如['城市','季度']
- `values`: 需要聚合的数值列名列表，如['销量','销售额']
- `aggfunc` (可选): 聚合函数，支持sum | mean | count | max | min | median | std | var，默认是sum
- `output_dir` (可选): 聚合图表的保存目录，默认./output

**示例：**
```json
{
  "name": "visualize_data",
  "arguments": {
    "data_path": "./sales_data.csv",
    "index": ["城市"],
    "values": ["销售额"],
    "aggfunc": "sum",
    "output_dir": "./charts"
  }
}
```

## 支持的文件格式

- CSV (逗号分隔值文件)
- XLSX (Excel 2007+ 文件)
- XLS (旧版 Excel 文件)

## 输出图表类型

根据输入参数的不同，服务器会自动生成多种类型的图表：

- **单维度分析**：柱状图、饼图
- **双维度分析**：热力图、堆叠柱状图、分组柱状图
- **多值对比**：多指标对比柱状图

所有生成的图表都会以PNG格式保存到指定的输出目录中，并返回图表路径和对应的数据信息。