semvec/pypi-packages huggingface dataset:
vnpy-dolphindb 1.0.9
DolphinDB database adapter for vn.py quant trading framework.
License: MIT
Keywords: quant, quantitative, investment, trading, algotrading

# VeighNa框架的DolphinDB数据库接口

<p align="center">
  <img src ="https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png"/>
</p>

<p align="center">
    <img src ="https://img.shields.io/badge/version-1.0.9-blueviolet.svg"/>
    <img src ="https://img.shields.io/badge/platform-linux|windows-yellow.svg"/>
    <img src ="https://img.shields.io/badge/python-3.10-blue.svg" />
</p>

## 说明

基于dolphindb开发的DolphinDB数据库接口。

**需要使用DolphinDB 2.0以上版本。**

## 使用

在vn.py中使用DolphinDB时，需要在全局配置中填写以下字段信息：

|名称|含义|必填|举例|
|---------|----|---|---|
|database.name|名称|是|dolphindb|
|database.host|地址|是|localhost|
|database.port|端口|是|8848|
|database.database|实例|是|vnpy|
|database.user|用户名|是|admin|
|database.password|密码|是|123456|
lilliepy-state 0.1
state manager for lilliepy framework
License: MIT
Requires Python: >=3.6
Keywords: lilliepy, lilliepy-state, reactpy

# liiliepy State Management Library

A lightweight state management library for lilliepy, inspired by state management solutions like Zustand and XState.

---

## Features

1. **State Containers**: Manage global or local state in an intuitive way.
2. **Selectors**: Derive state slices to minimize unnecessary re-renders.
3. **Transitions**: (Optional) Add finite state machine (FSM) logic for more complex scenarios.

---

## Installation

Simply include the `liiliepy_state.py` file in your project.

```bash
# Clone the repository (if applicable)
git clone <repository_url>
```

---

## Quick Start

### 1. Define a Store

Create a state container to manage your application's state.

```python
from liiliepy_state import StateContainer

# Define your store
counter_store = StateContainer({"count": 0})

# Define actions
def increment():
    counter_store.set_state(lambda state: {"count": state["count"] + 1})

def decrement():
    counter_store.set_state(lambda state: {"count": state["count"] - 1})
```

---

### 2. Use the Store in liiliepy Components

Connect your store to liiliepy components using the `use_store` hook.

```python
from reactpy import component, html
from liiliepy_state import use_store
from my_store import counter_store, increment, decrement

@component
def CounterComponent():
    state, _ = use_store(counter_store)

    return html.div(
        html.button({"onClick": lambda: decrement()}, "-"),
        html.span(f"Count: {state['count']}"),
        html.button({"onClick": lambda: increment()}, "+"),
    )
```

---

### 3. Advanced Usage: Finite State Machines (FSM)

For more complex scenarios, use the `FSMContainer` to add finite state transitions.

```python
from liiliepy_state import FSMContainer

# Define state transitions
fsm_store = FSMContainer("idle", {
    "idle": {"START": "running"},
    "running": {"STOP": "idle"},
})

# Transition actions
def start():
    fsm_store.transition("START")

def stop():
    fsm_store.transition("STOP")
```

#### Component Example

```python
@component
def FSMComponent():
    state, _ = use_store(fsm_store)

    return html.div(
        html.span(f"State: {state}"),
        html.button({"onClick": lambda: start()}, "Start"),
        html.button({"onClick": lambda: stop()}, "Stop"),
    )
```

---

## Roadmap

- **Middleware Support**: Add features like logging and persistence.
- **Optimizations**: Improve performance for concurrent updates.
- **Testing**: Cover edge cases and stress-test the library.

---

## License

This project is licensed under the MIT License. Feel free to use and contribute!