Metadata-Version: 2.4
Name: nutricare-data-packages
Version: 0.1.0
Summary: Nutricare data access package
Author: Nutricare Team
Project-URL: Homepage, https://example.com
Project-URL: Repository, https://example.com/nutricare-data-packages
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pymongo>=4.0.0

# nutricare-data-packages

Nutricare 的数据访问基础包，封装 MongoDB 仓储与本地存储抽象基类。

## 安装

```bash
pip install nutricare-data-packages
```

## 快速使用

```python
from pathlib import Path

from nutricare_data_packages import MetadataStore, StorageBase

store = MetadataStore(
    mongodb_url="mongodb://localhost:27017",
    db_name="nutricare",
    auth_source="admin",
)

class ReportStorage(StorageBase):
    @property
    def storage_subdir(self) -> str:
        return "reports"

    def _write_impl(self, relative_path: str, data: bytes) -> Path:
        target = self.resolve_path(relative_path)
        target.parent.mkdir(parents=True, exist_ok=True)
        target.write_bytes(data)
        return target
```

## 本地构建与发布

```bash
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*
```

## 说明

- 包名（pip 安装名）：`nutricare-data-packages`
- 导入名（Python import）：`nutricare_data_packages`
