semvec/pypi-packages huggingface dataset:
fileutils-nandu 0.2.0
Simple file handling utilities for Python
License: MIT
Requires Python: >=3.8
Keywords: file, utils, file-handling, python

# fileutils-nandu

fileutils-nandu is a lightweight and practical Python utility package that provides commonly used file-handling operations through a clean and reusable API.  
The package is designed to reduce repetitive boilerplate code for everyday file operations in scripts, automation tasks, and small projects.

---

## Features

### Basic File Operations
- Read text files
- Write text files
- Append content to files
- Check whether a file exists
- Count the number of lines in a file

### Advanced File Utilities
- Copy files from one location to another
- Delete files safely
- Get file size in bytes or kilobytes
- List files in a directory using wildcard patterns (for example, `*.txt`)

---

## Installation

Install the package directly from PyPI:

```bash
pip install fileutils-nandu
```

---

## Basic Usage

```python
from fileutils import write_file, read_file, line_count

write_file("example.txt", "Hello\nWorld")
print(read_file("example.txt"))
print(line_count("example.txt"))
```

Output:
```
Hello
World
2
```

---

## Advanced Usage

```python
from fileutils import copy_file, delete_file, file_size, list_files

copy_file("example.txt", "example_copy.txt")

print(file_size("example.txt"))              # size in bytes
print(file_size("example.txt", unit="kb"))   # size in kilobytes

print(list_files(".", "*.txt"))

delete_file("example_copy.txt")
```

---

## Available Functions

| Function | Description |
|--------|-------------|
| read_file(path) | Reads and returns the content of a file |
| read_lines(path) | Returns file content as a list of lines |
| write_file(path, content) | Writes content to a file |
| append_file(path, content) | Appends content to an existing file |
| file_exists(path) | Checks if a file exists |
| line_count(path) | Returns the number of lines in a file |
| copy_file(src, dst) | Copies a file from source to destination |
| delete_file(path) | Deletes a file if it exists |
| file_size(path, unit) | Returns file size in bytes or KB |
| list_files(directory, pattern) | Lists files matching a pattern |

---

## Project Structure

```text
fileutils/
├── reader.py     # File reading utilities
├── writer.py     # File writing utilities
├── utils.py      # Advanced file operations
└── __init__.py   # Public package interface
```

---

## Why This Package

- Avoids rewriting common file-handling logic
- Clean and beginner-friendly API
- Useful for automation, scripting, and small projects
- Lightweight and dependency-free

---

## License

MIT License

---

## Author

Nandu
sqlite-cdc 0.1.0
SQLite CDC 同步引擎 - 支持存量和增量同步到 MySQL/Oracle
License: MIT
Requires Python: >=3.11
Keywords: cdc, mysql, oracle, replication, sqlite, sync

# SQLite CDC 同步引擎

[![Build status](https://ci.appveyor.com/api/projects/status/lwf6pldcpdeyt6lk/branch/master?svg=true)](https://ci.appveyor.com/project/Wingsgo/sqlite-cdc/branch/master)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

SQLite CDC 同步引擎是一个 Python 库和 CLI 工具，用于将 SQLite 数据库的变更实时同步到 MySQL 或 Oracle 数据库。
代码由[Claude Code](https://github.com/anthropics/claude-code) + Kimi-K2.5 + [spec-kit](https://github.com/github/spec-kit) 生成，人工进行少量微调与验证，用于体验Vibe Coding能力，同时作为小规模场景下生产环境使用。

## 特性

- **CDC 变更捕获**: 通过审计日志表捕获 SQLite 数据变更
- **双模式同步**: 支持存量数据全量同步和增量实时同步
- **多目标支持**: 可同时同步到多个 MySQL/Oracle 目标库
- **字段映射**: 支持字段名映射和值转换
- **最终一致性**: 断点续传、幂等写入保证 exactly-once 语义
- **CLI + 库**: 既可作为命令行工具使用，也可作为 Python 库集成

## 快速开始

### 安装

```bash
pip install sqlite-cdc
```

### 命令行使用

```bash
# 生成配置模板
sqlite-cdc init sync.yaml

# 执行同步（存量 + 增量）
sqlite-cdc sync --config sync.yaml --mode full
```

### Python 库使用

```python
import asyncio
from sqlite_cdc import SyncEngine, load_config

async def main():
    config = await load_config("sync.yaml")
    engine = SyncEngine(config)
    await engine.start()

if __name__ == "__main__":
    asyncio.run(main())
```

## 配置示例

```yaml
source:
  db_path: "./app.db"
  tables: ["users", "orders"]

targets:
  - name: "mysql_prod"
    type: "mysql"
    connection:
      host: "localhost"
      port: 3306
      database: "backup"
      username: "${MYSQL_USER}"
      password: "${MYSQL_PASSWORD}"

mappings:
  - source_table: "users"
    target_table: "users_backup"
    field_mappings:
      - source_field: "email"
        converter: "lowercase"

batch_size: 100
checkpoint_interval: 10
```

## 文档

- [快速开始指南](docs/quickstart.md)
- [API 参考](docs/API.md)
- [配置详解](docs/configuration.md)

## 开发

```bash
# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
make test

# 代码检查
make lint

# 格式化代码
make format
```

## 许可证

MIT License