Metadata-Version: 2.4
Name: sms-mn
Version: 0.2.0
Summary: Production-ready Python client for sending SMS via Unitel and Mobicom APIs
Author: c1rtkaal
License: MIT
Project-URL: Homepage, https://github.com/Suldee925/sms-mn
Project-URL: Repository, https://github.com/Suldee925/sms-mn
Project-URL: Issues, https://github.com/Suldee925/sms-mn/issues
Keywords: sms,unitel,mobicom,mongolia,otp,notifications
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Telephony
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: respx>=0.21; extra == "dev"
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: twine>=5.1.1; extra == "dev"
Requires-Dist: ruff>=0.9.0; extra == "dev"
Requires-Dist: mypy>=1.11; extra == "dev"
Dynamic: license-file

# sms-mn

Production-ready Python client for sending SMS in Mongolia.

`sms-mn` нь Монголын SMS gateway-уудтай (Unitel, Mobicom) холбогдож мессеж илгээхэд зориулсан Python library юм.  
Provider pattern ашигласан тул өөр операторуудыг нэмэхэд маш хялбар.

---

## Supported Providers

- Unitel Premium Number API
- Mobicom HTTP SMS API

Цаашид дараах операторуудыг нэмэх боломжтой:

- Skytel
- Gmobile

---

## Install

```bash
pip install sms-mn
```

---

## Quick Start

### Unitel SMS илгээх

```python
from sms_mn import SMSClient, UnitelProvider

client = SMSClient(
    provider=UnitelProvider(
        api_key="YOUR_UNITEL_API_KEY",
    )
)

response = client.send(
    to="88112233",
    message="Hello from sms-mn via Unitel"
)

print(response)
client.close()
```

---

### Mobicom SMS илгээх

```python
from sms_mn import SMSClient, MobicomProvider

client = SMSClient(
    provider=MobicomProvider(
        servicename="mms",
        username="engineering",
        sender="139562",
    )
)

response = client.send(
    to="99112233",
    message="Hello from sms-mn via Mobicom"
)

print(response)
client.close()
```

---

## Async Usage

```python
import asyncio
from sms_mn import AsyncSMSClient, UnitelProvider

async def main():
    client = AsyncSMSClient(
        provider=UnitelProvider(api_key="YOUR_API_KEY")
    )

    response = await client.send(
        to="88112233",
        message="async sms"
    )

    print(response)

    await client.aclose()

asyncio.run(main())
```

---

## Response Object

`send()` функц дараах `SMSResponse` object буцаана.

```python
SMSResponse(
    ok=True,
    status_code=200,
    data={"success": True},
    raw_text="...",
    provider="unitel"
)
```

### Fields

| Field | Description |
|------|-------------|
| ok | Request амжилттай эсэх |
| status_code | HTTP response code |
| data | JSON response |
| raw_text | Raw response |
| provider | Ашигласан provider |

---

## Error Handling

Library дараах exception-уудыг ашигладаг.

```python
from sms_mn import (
    SMSValidationError,
    SMSAPIError,
    SMSNetworkError
)
```

Example:

```python
try:
    client.send("99112233", "hello")
except SMSValidationError:
    print("Invalid input")
except SMSAPIError:
    print("SMS API error")
except SMSNetworkError:
    print("Network problem")
```

---

## Project Structure

## Project Structure

```
sms-mn
│
├─ src/
│  └─ sms_mn/
│     ├─ client.py
│     ├─ models.py
│     ├─ exceptions.py
│     ├─ utils.py
│     └─ providers/
│        ├─ base.py
│        ├─ unitel.py
│        └─ mobicom.py
│
├─ tests/
├─ examples/
└─ README.md
```

---

## Development

Clone repository:

```bash
git clone https://github.com/Suldee925/sms-mn
cd sms-mn
```

Create virtual environment:

```bash
python -m venv .venv
```

Activate environment:

Windows

```bash
.venv\Scripts\activate
```

Linux / Mac

```bash
source .venv/bin/activate
```

Install dependencies:

```bash
pip install -e .
```

---

## Run Tests

```bash
pytest
```

---

## Build Package

```bash
python -m build
```

---

## Publish to PyPI

```bash
twine upload dist/*
```

---

## Future Roadmap

Төлөвлөсөн feature-үүд:

- Bulk SMS
- OTP helper
- Delivery status
- Webhook receiver
- Skytel provider
- Gmobile provider

---

## License

MIT License

---

## Author

Created by **Suld-Erdene Erdenebat**

GitHub  
https://github.com/Suldee925
