semvec/pypi-packages huggingface dataset:
persian-sms-manager 2.1.2
A package for managing Iranian SMS services

# Iranian SMS Manager

A Python package for managing Iranian SMS services, providing support for multiple SMS providers and a modular,
extensible design.

## Requirements

- Python 3.11+
- requests

## Installation

You can install this package directly from GitHub:

```bash
pip install git+https://github.com/AAbbasRR/persianSMSManager.git
```

Alternatively, clone the repository and install manually:

```bash
git clone https://github.com/AAbbasRR/persianSMSManager.git
cd persianSMSManager
pip install .
```

or

```sh
pip install persian_sms_manager
```

## Usage

This package allows you to send SMS messages, including OTP (One-Time Password) codes, through various SMS services.
Currently, it supports RayganSMS and AnotherSMSService.

## Configuration

You need to configure the SMS service you want to use. Here is an example for RayganSMS and AnotherSMSService.

Example with RayganSMS:

```python
from persian_sms_manager import SMSManager

# Configure RayganSMS
sms_manager = SMSManager(
    service_name="raygansms",
    user_mobile="09123456789",
    username="your_username",
    password="your_password"
)

# Send a message
sms_manager.service.send_message("This is a test message")

# Send OTP code
sms_manager.service.send_otp_code("register")

# Send automatic OTP code
sms_manager.service.send_auto_otp_code()

# Check automatic OTP code
valid = sms_manager.service.check_auto_otp_code("123456")
```

## Adding New SMS Services

To add support for a new SMS service, create a new class in the package that inherits from BaseSMSService and implements
the required methods. Then, update the SMSManager class to include this new service.

### Example

Create a file new_sms_service.py:

```python
from persian_sms_manager.base import BaseSMSService
import requests


class NewSMSService(BaseSMSService):
    def __init__(self, user_mobile, api_key):
        super().__init__(user_mobile)
        self.api_key = api_key

    def send_request(self, endpoint, data):
        data.update({
            "api_key": self.api_key,
        })
        response = requests.post(f"https://new-sms-service.com/{endpoint}", data=data)
        return response.status_code == 200

    def send_message(self, message):
        data = {
            "mobile": self.user_mobile,
            "message": message,
        }
        return self.send_request("send_message", data)

    def send_otp_code(self, title_type):
        otp_code = "12345"
        message = f"your otp: {otp_code}."
        return self.send_message(message)
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE.txt) file for details.

## Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

## Author

Abbas Rahimzadeh - [arahimzadeh79@gmail.com](mailto:arahimzadeh79@gmail.com)

## Acknowledgments

Special thanks to the open-source community for their valuable contributions and resources.
getchlib 1.1.3
Library for reading key presses


# getchlib - library for reading key presses

## Overview
`getchlib` is library for reading key presses and assigning hotkeys.
### Features
1. Full Unicode support
1. Blocking and non-blocking key press reading
1. Cross-platform support
1. Basic hotkeys ( `CTRL-V` or `ALT-A` ) are defined
1. Not interruptable key press reading support ( cannot be interrupted by `CTRL-C`, returns key code instead )
1. Keys like arrow up, arrow left, arrow down, arrow right are defined (for full list, view getchlib.keynames.raw)
### Installation
```
pip install getchlib
```
## Usage
### Key Presses
#### Blocking
```python
import getchlib
key=getchlib.getkey()
```
Waits until user presses a key.
#### Non-Blocking
```python
import getchlib
key=getchlib.getkey(False)
```
Returns first key pressed in time specified by its second argument `tout` ( 0.01 by default ).
#### Not interruptable 
```python
import getchlib
key=getchlib.getkey(catch=True)
```
#### Echo argument (new in v1.0.3)
With `echo=True` characters readed are echoed to the screen.
```python
key=getchlib.getkey(echo=True)

```
### Hotkeys
```python
import getchlib
def function():
	print('hello')
f=getchlib.HotKeyListener()
f.add_hotkey('ctrl-x',function)
f.start()
```
#### Not interruptable
```python
import getchlib
def function():
	print('hello')
f=getchlib.HotKeyListener(catch=True)
f.add_hotkey('a',function)
f.start()
```
#### Non-blocking (linux only)
```python
import getchlib
def function():
	print('hello')
f=getchlib.HotKeyListener(catch=True)
f.add_hotkey('a',function)
...
f.terminate()
```
## License
*`getchlib` is licensed under* ***GPL License***