semvec/pypi-packages huggingface dataset:
LogAssist 1.1.2
A simple and customizable logging library for Python.
Requires Python: >=3.6
Keywords: LogAssist, Log Assist, logassist, log assist, Logger, logger

# LogAssist

A simple and customizable logging library for Python.

## Installation

```powershell
pip install LogAssist
```

## Features

-   Easy to use and configure
-   Supports multiple log levels (debug, info, warning, error)
-   Outputs log messages to both console and file
-   Allows for log file removal on initialization
-   Provides datetime formatting for log messages

## Usage

1. Import the Logger class:

```python
import LogAssist.log as Logger
```

2. Initialize the logger with your desired settings:

```python
Logger.logger_init(config=my_config_dictionary)
# or
Logger.logger_init()
```

3. Use the logger in your code:

```python
Logger.verbose('MyTag', 'This is a verbose message')
Logger.debug('MyTag', 'This is a debug message')
Logger.info('MyTag', 'This is an info message')
Logger.warn('MyTag', 'This is a warning message')
Logger.error('MyTag', 'This is an error message')
Logger.exception('MyTag', 'This is a exception message')
```

## Configuration

You can configure the logger using a JSON configuration. Below is an example of a configuration and explanations for each field.

Example Usage:

```json
{
    "base": {
        "name": "MyLogger",
        "level": "debug"
    },
    "console": {
        "level": "debug",
        "format": "%(asctime)s[%(levelname)s]%(message)s"
    },
    "file_timed": {
        "level": "info",
        "format": "%(asctime)s[%(levelname)s]%(message)s",
        "file_name": "default.log",
        "when": "midnight",
        "interval": 1,
        "backup_count": 30
    }
}
```

## Configuration Fields

### base

-   name: The identifier for the logger. Default is 'MyLogger'.
-   level: The minimum log level to set (debug, info, warn, error, exception). Default is 'debug'.

### console

-   level: The minimum log level for console output (debug, info, warn, error, exception). Default is 'debug'.
-   format: Defines the log message format for console output. Default is %(asctime)s[%(levelname)s]%(message)s.

### file_timed

-   level: The minimum log level for file output (debug, info, warn, error, exception). Default is 'info'.
-   format: Defines the log message format for file output. Default is %(asctime)s[%(levelname)s]%(message)s.
-   file_name: The file name to use for logging. Default is 'default.log'.
-   when: The time interval for rotating the log file (e.g., 'midnight'). Default is 'midnight'.
-   interval: Defines how often the log file is rotated. Default is 1.
-   backup_count: Specifies the number of backup files to keep. Default is 30.

Use this JSON configuration to initialize your logger with the desired settings.
instaui 0.8.8
insta-ui is a Python-based UI library for rapidly building user interfaces.
Requires Python: <3.14,>=3.10
Keywords: gui, ui, web

# insta-ui

<div align="center">

English| [简体中文](./README.zh-CN.md)

</div>

## 📖 Introduction
insta-ui is a Python-based UI library for quickly building user interfaces.

## ⚙️ Features
Three modes:

- web mode: generates a stateless web application.
- Web View mode: generates a web view application, which can be packaged as a local app (no need to start a web service).
- Zero mode: generates a pure HTML file that can run directly in a browser without installing any dependencies.

 
## 📦 Installation

Zero mode:

```
pip install instaui -U
```
```
uv add instaui
```

web mode

```
pip install instaui[web] -U
```
```
uv add instaui[web]
```

Web View mode
```
pip install instaui[webview] -U
```
```
uv add instaui[webview]
```

🖥️ Quick Start

Install the TDesign UI library:
```
uv add instaui-tdesign[web]
```

```python
# main.py
from instaui import ui
from instaui_tdesign import td

td.use(locale="en_US")

@ui.page('/')
def home():
    ui.text("Hello, world!")

ui.server(debug=True).run()
```

📚 Getting Started

Below is a simple example of summing two numbers.
The text color of the result changes dynamically based on whether the result is even or odd.

```python
from instaui import ui
from instaui_tdesign import td

td.use(locale="en_US")

@ui.page('/')
def home():
    num1 = ui.state(0)
    num2 = ui.state(0)

    # When num1 or num2 changes, result will be automatically recalculated
    @ui.computed
    def result(num1 = num1, num2 = num2):
        return num1 + num2

    # When result changes, text_color will be automatically updated
    @ui.computed
    def text_color(result = result):
        return "red" if result % 2 == 0 else "blue"

    # UI
    td.input_number(num1, theme="column")
    ui.text("+")
    td.input_number(num2, theme="column")
    ui.text("=")
    ui.text(result).style({"color": text_color})

# When deploying a web app, remove debug=True
ui.server(debug=True).run()

```


Replace ui.server().run() with ui.webview().run() to run in web view mode:

```python
...

# ui.server(debug=True).run()
ui.webview().run()

```

Methods bound with ui.computed are executed on the server side.
If you want to run calculations on the client side, use ui.js_computed.

```python
from instaui import ui
from instaui_tdesign import td

td.use(locale="en_US")

@ui.page('/')
def home():
    num1 = ui.state(0)
    num2 = ui.state(0)

    result = ui.js_computed(inputs=[num1, num2], code="(num1, num2) => num1 + num2")
    text_color = ui.js_computed(inputs=[result], code="(result) => result % 2 === 0? 'red' : 'blue'")

    # UI
    ...

...
```

In this case, all interactions are executed in the browser (client side).
With zero mode, you can generate a pure HTML file that works without installing any dependencies:

```python
from instaui import ui, zero
from instaui_tdesign import td

td.use(locale="en_US")

@ui.page('/')
def home():
    ...

zero().to_html(home, file='index.html')
```