semvec/pypi-packages huggingface dataset:
django-realtime-logs 0.1.2
Realtime log viewer for Django using Channels

# django-realtime-logs

A real-time log viewer for Django using WebSocket and Django Channels.  
It allows developers to view server logs live in the browser, making debugging easier without relying on external tools like Grafana.

---

## Features

- Real-time streaming of your Django `runtime.log` file via WebSocket.
- Simple UI to display logs with auto-scrolling.
- Built as a reusable Django app, easy to integrate.
- Uses Django Channels for WebSocket support.
- Lightweight and minimal dependencies.

---

## Installation

```bash
pip install django-realtime-logs
```

## Usage

- Add `django_realtime_logs` to `INSTALLED_APPS`
In your settings.py, add:
```bash
INSTALLED_APPS = [
    # existing apps...
    'django_realtime_logs',
]

ASGI_APPLICATION = 'your_project_name.asgi.application'  # Replace with your ASGI module path

# Configure your channel layers (using InMemoryChannelLayer for development)
CHANNEL_LAYERS = {
    'default': {
        'BACKEND': 'channels.layers.InMemoryChannelLayer',
    },
}

```
- Configure Logging in settings.py
Make sure your logging configuration writes logs to runtime.log in your project directory:
```bash
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'logging.FileHandler',
            'filename': BASE_DIR / 'runtime.log',
        },
    },
    'root': {
        'handlers': ['file'],
        'level': 'DEBUG',
    },
}

```
- Include `/logs/` and set up WebSocket with ASGI(asgi.py)
Modify your asgi.py to route HTTP and WebSocket connections:
```bash
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from django_realtime_logs.routing import websocket_urlpatterns

application = ProtocolTypeRouter({
    "http": get_asgi_application(),
    "websocket": AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
})

```
- Include `/logs/` in urls.py
Add the logs route to your main urls.py:
```bash
path("logs/", include("django_realtime_logs.urls")),
```
-You must use an ASGI server like daphne or uvicorn to support WebSockets.
-Install daphne
```bash
pip install daphne
```
-Run the server
```bash
daphne -p 8001 your_project_name.asgi:application
```
Replace your_project_name with your Django project folder name.

- Visit `/logs/` in the browser
```bash
http://localhost:8001/logs/
```
clinicore 1.2.1
Basic clinical entities [`source <https://github.com/laminlabs/clinicore/blob/main/clinicore/models.py>`__].

# clinicore: A clinical schema

This schema focuses on key clinical data concepts, including patients, treatments, biosamples, and clinical trials with associated artifacts.
In contrast, the related [OMOP](https://github.com/laminlabs/omop) schema is based on the OMOP Common Data Model, which standardizes patient-level observational data.

## Contributing

Please run `pre-commit install` and `gitmoji -i` on the CLI before starting to work on this repository!
shared-architecture 0.5.0
A shared Python library for backend microservices, including models, utilities, and configurations.
Requires Python: >=3.8
Keywords: shared library microservices architecture configuration utilities

# shared-architecture

Shared Python library for **Stocksblitz Microservices Architecture**.

Provides reusable components like:

- ✅ SQLAlchemy ORM models (Activity Log, Broker, Symbol, etc.)
- ✅ Common Enums (UserRole, AccountStatus)
- ✅ Database session management
- ✅ Redis, RabbitMQ, TimescaleDB connections
- ✅ Retry helpers with exponential backoff
- ✅ Keycloak authentication utilities
- ✅ Centralized structured logging
- ✅ Microservice connection management (ConnectionManager)
- ✅ RabbitMQ Publisher utility

---

## 📦 Installation

```bash
pip install shared-architecture==0.3.0
```
nfinance 0.4.22
A simple finance data fetching library for Naver Finance data.
Requires Python: >=3.6

text

# nfinance
```
nfinance/
│
├── nfinance/
│   ├── __init__.py
│   └── stock_data.py
│   └── stock_listing.py
│   └── rsi.py
│   └── financials.py
│
├── tests/
│   ├── __init__.py
│   └── test_stock_data.py
│
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
└── setup.py
```

## 1. 설명
`stock_data.py`는 네이버 파이낸스의 데이터를 가져오는 Python 라이브러리입니다.
`stock_listing.py`는 네이버 파이낸스의 종목 list를 가져오는 Python 라이브러리입니다.
`rsi.py`는 Relative Strength Index를 구하는 Python 라이브러리입니다.

## 2. 설치 방법
pip install nfinance

## 3-1. 사용 예제
```python
import nfinance as nf

ticker = '005930'  # Samsung Electronics Co., Ltd
start_date = '2023-01-01'
end_date = '2023-05-01'

try:
    data = nf.download(ticker, start_date, end_date)
    print(data.head())
except Exception as e:
    print(e)
```
## 3-2. 사용 예제
```python
import nfinance as nf

# 코스피 전체 주식 목록 가져오기
stocks_kospi = nf.StockListing('KOSPI')
df_kospi = stocks_kospi.fetch_stocks()
print(df_kospi)

# 코스닥 전체 주식 목록 가져오기
stocks_kosdaq = nf.StockListing('KOSDAQ')
df_kosdaq = stocks_kosdaq.fetch_stocks()
print(df_kosdaq)

```
## 3-3. 사용 예제
```python
import nfinance

df_annual = nfinance.get_annual_financial('005930')  # 예시: 삼성전자 코드
print(df_annual)
print("df_annual['2019/12']['매출액']", df_annual['2019/12']['매출액'])
print("df_annual.loc['매출액']", df_annual.loc['매출액'])
print("df_annual.loc['매출액'].tolist()", df_annual.loc['매출액'].tolist())
```

## 4. LICENSE

MIT 라이선스를 예로 듭니다. 실제로 사용하려면 올바른 라이선스를 선택해야 합니다.

```plaintext
MIT License

Copyright (c) 2024 lega001

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
llm-model-cost 1.0.0
A package to calculate token costs for LLM models
Requires Python: >=3.6

# LLM Model Cost Calculator

A Python package to calculate token costs for various LLM models based on input and output tokens.

## Installation

```bash
pip install llm_model_cost
```

## Usage

```python
from llm_model_cost import ModelCost

# Calculate cost for a model
costInfo = ModelCost(name="gpt-4", input_tokens=100, output_tokens=50)

# Get cost details
print(f"Input cost: ${costInfo.input_cost:.6f}")
print(f"Output cost: ${costInfo.output_cost:.6f}")
print(f"Total cost: ${costInfo.cost:.6f}")

# Get model information
model_info = ModelCost.get_model_info("gpt-4")
print(f"Max tokens: {model_info['max_tokens']}")
print(f"Provider: {model_info['litellm_provider']}")


# List all available models
models = ModelCost.list_models()
```

## Features

- Calculate token costs for various LLM models
- Get model information including max tokens, costs, and provider details
- List all available models and their capabilities
- Automatic updates from the latest pricing data

## License

MIT License
llama-api-bench 0.0.10
Llama API Benchmark
Requires Python: >=3.10

# llama_api_bench

[![PyPI - Version](https://img.shields.io/pypi/v/llama-api-bench.svg)](https://pypi.org/project/llama-api-bench)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/llama-api-bench.svg)](https://pypi.org/project/llama-api-bench)

## Table of Contents

- [Installation](#installation)
- [License](#license)

## Installation

```bash
pip install llama-api-bench
```

**Install from source**
```bash
pip install -e .

# dev
pip install -e ".[dev]"
```

## Usage

**Run All**
```bash
llama-api-bench run-all
```

**Run Subset**

- Run on a specific criteria for all models and providers
```bash
llama-api-bench run-criteria --criteria tool_call
```

- Run on a specific test case data for all models and providers
```bash
llama-api-bench run-test-case --test-case tool_call_get_weather
```

- Run all test cases on a specific provider
```bash
llama-api-bench run-provider --provider openrouter
```

- Run on a specific test case x model x provider
```bash
# streaming
llama-api-bench run --test-case basic_dont_call_tool --model Cerebras-Llama-4-Scout-17B-16E-Instruct --provider llamaapi --stream

# non-streaming
llama-api-bench run --test-case basic_dont_call_tool --model Cerebras-Llama-4-Scout-17B-16E-Instruct --provider llamaapi --no-stream
```

- Run on specific provider x model
```bash
llama-api-bench run-provider --provider openai --models gpt-4o

llama-api-bench run-provider --provider llamaapi --models Llama-4-Maverick-17B-128E-Instruct-FP8
```

![cli](./assets/cli.png)

## Customization

#### Add a New Test Case / Criteria
1. Add a new test case in [llama_api_bench/data/](./src/llama_api_bench/data/).
2. If the new test case requires a new Test Criteria to run evaluation, add it to [llama_api_bench/core/criterias](./src/llama_api_bench/core/criterias/).

#### Add New Provider
1. Add supported models in [llama_api_bench/models/](./src/llama_api_bench/models/). See an example in [llamaapi.py](./src/llama_api_bench/models/llamaapi.py).
2. Add ProviderConfig in [llama_api_bench/core/providers.py](./src/llama_api_bench/core/providers.py).
3. If the provider requires has a new request format, add it to [get_request_json](./src/llama_api_bench/core/criterias/common.py).
4. If the provider requires a new response format parsing, add its evaluation criteria in [llama_api_bench/core/criterias](./src/llama_api_bench/core/criterias/).

## License

`llama-api-bench` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
markdown-hide-code 0.1.1
Hide code blocks from the rendered markdown output, useful for running tests on your documentation.
Requires Python: >=3.9

# markdown-hide-code

An small extension for Python's [Markdown](https://pypi.org/project/Markdown/) library that
hides code blocks marked with `hide` from the markdown output. This is useful
when developers want to include unit tests in their markdown documentation (e.g., using [pytest-markdown-docs](https://github.com/modal-labs/pytest-markdown-docs/)) but don't want those tests to be visible to documentation readers. I created this extension while developing [Pyoframe](https://bravos-power.github.io/pyoframe/).

~~~
```python {hide}
# This code block will be hidden in the rendered markdown.
```
~~~

## Install

`pip install markdown-hide-code`

## Usage with [`mkdocs`](https://www.mkdocs.org/)

Add the extension to your `mkdocs.yml` configuration:

```yml
markdown_extensions:
  ...
  - pymdownx.superfences
  - attr_list
  - markdown_hide_code  # must appear after superfences and attr_list
    ...
```
> [!WARNING]
> [`pymdownx.superfences`](https://facelessuser.github.io/pymdown-extensions/extensions/superfences/) and [`attr_list`](https://python-markdown.github.io/extensions/attr_list/) are required dependencies and must be listed **BEFORE** `markdown-hide-code`.

Then, to hide a code block simply add `{hide}`:

~~~
```python {hide}
# This code block will be hidden in the output
```
~~~

## Usage directly with the [Markdown](https://pypi.org/project/Markdown/) library

Just add the extension to the list. Order matters (see above warning).

```python
from markdown import Markdown

md = Markdown(extensions=["pymdownx.superfences", "attr_list", "markdown_hide_code"])
...
```

### Notes for contributors (and myself)

Clone the repo and run [`uv sync`](https://docs.astral.sh/uv) and `pre-commit install` to get setup. The core code is all found in `src/markdown_hide_code/main.py`.
equation-solver-ai 1.0.0
A solver for univariate polynomial equations (degree 1-4) with AI support
Requires Python: >=3.10

# Equation Solver

A Python package for solving univariate polynomial equations (degree 1-4) with traditional methods and AI assistance.

## Features

- Solve 1st to 4th degree polynomial equations
- AI-assisted solving using local language models
- Server management for local AI models
- Expression rendering and approximation
- Caching for improved performance

## Installation

```bash
pip install equation-solver
```

## Basic Usage

### Traditional Solving

```python
from equation_solver import EquationSolver

solver = EquationSolver()
coefficients = solver.parse_input({
    "x⁴": "1",
    "x³": "0",
    "x²": "0",
    "x": "0",
    "常数项": "-1"
})

equation, degree = solver.build_equation(coefficients)

if degree > 0:
    solutions = solver.solve_equation(equation)
    processed = solver.process_solutions(solutions)
    print(f"Found {len(processed)} solutions")
```

### AI-Assisted Solving

```python
from equation_solver import EquationSolver, AISolver, ModelServer

# Start AI server
server = ModelServer()
server.start_server(model_path="path/to/model.gguf")

# Wait for server to start
import time
while server.status != "running":
    time.sleep(1)

# Solve with AI
solver = EquationSolver()
ai_solver = AISolver(port=5001)

coefficients = solver.parse_input({
    "x⁴": "1",
    "x³": "0",
    "x²": "0",
    "x": "0",
    "常数项": "-1"
})
equation, _ = solver.build_equation(coefficients)

equation_latex = sp.latex(equation)
ai_response = ai_solver.send_ai_request(equation_latex)
parsed = ai_solver.parse_ai_response(ai_response)

print("AI Solution:", parsed["clean_text"])
print("Solutions:", parsed["solutions"])

# Stop server
server.stop_server()
```

## API Documentation

### EquationSolver
- `parse_input(inputs)`: Parse user input coefficients
- `build_equation(coefficients)`: Build equation from coefficients
- `solve_equation(equation)`: Solve the equation
- `process_solutions(solutions)`: Prepare solutions for display
- `get_cache_key(coefficients)`: Generate cache key for solutions

### AISolver
- `send_ai_request(equation_latex)`: Send request to AI server
- `parse_ai_response(ai_text)`: Parse AI response text

### ModelServer
- `start_server(model_path, port)`: Start model server
- `stop_server()`: Stop model server
- `is_running()`: Check if server is running
- `get_logs(max_lines=100)`: Get server logs

## Dependencies

- SymPy
- Requests
- Matplotlib
- Pillow
- Psutil

## License

MIT License
automl-ai 0.1.4
A short and sweet description of your package.
Requires Python: >=3.7

# Machine Learning Workflow Automation

## Overview
This repository automates various aspects of the machine learning workflow, making model development more efficient and streamlined. The automation script is designed to handle multiple preprocessing steps, hyperparameter tuning, and dataset management dynamically. This allows machine learning practitioners to focus more on model experimentation rather than repetitive tasks.

## Features
The script provides the following automation functionalities:

- **Dynamic Module Importing**: Automatically imports only the required modules based on the current project's needs.
- **Dataset Management**:
  - Loads datasets automatically.
  - Creates three dataset versions:
    - Main pandas DataFrame.
    - A copy of the main dataset.
    - A NumPy representation for numerical operations.
- **Hyperparameter Tuning**:
  - Automates **GridSearchCV** and **RandomizedSearchCV** for hyperparameter optimization.
  - Returns all attributes from the hyperparameter search results.
- **Preprocessing Automation**:
  - **Scaling and Encoding**:
    - Organizes multiple scaling and encoding techniques into their respective classes.
    - Automatically applies the appropriate technique based on the dataset’s characteristics.
- **Exploratory Data Analysis (EDA)**: Performs key statistical and graphical analyses to understand dataset characteristics.
- **Model Visualization**: Uses Scikit-Learn’s visualization API to provide graphical representations of machine learning models.

## Branches
This repository contains four branches:

- **master**: The stable and production-ready branch.
- **test-branch**: Used for testing new features before merging into `master`.
- **version_1.0**: An earlier version of the automation script.
- **version_2.0**: The latest iteration with improvements and optimizations.

## How to Use
1. Clone the repository:
   ```bash
   git clone https://github.com/your-username/repo-name.git
   ```
2. Navigate into the directory:
   ```bash
   cd repo-name
   ```
3. Checkout the desired branch:
   ```bash
   git checkout branch-name
   ```
4. Run the automation script:
   ```bash
   python script.py
   ```

## Contributing
Feel free to fork this repository and make improvements. Contributions are always welcome! If you have a feature request or encounter any issues, please open an issue or submit a pull request.

## License
This project is licensed under the MIT License.

---

Happy coding! 🚀