Metadata-Version: 2.4
Name: RahkaranPythonAPI
Version: 0.1.1
Summary: A Python client for the Rahkaran API
Home-page: https://github.com/ehsanre1376/RahkaranPythonAPI
Author: Ehsan Rezaei
Author-email: ehsanre@systemgroup.net
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: rsa>=4.7.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0.0; extra == "dev"
Requires-Dist: black>=20.8b1; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: flake8>=3.9.0; extra == "dev"
Requires-Dist: mypy>=0.800; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Rahkaran API Client

A Python client library for interacting with the Rahkaran API.

## Installation

```bash
pip install rahkaran-api
```

## Quick Start

```python
import json
from rahkaran_api import RahkaranAPI, RahkaranConfig

# Create config object
config = RahkaranConfig(
    rahkaran_name="code",
    server_name="localhost",
    port="80",
    username="admin",
    password="admin"
)

# Initialize the client with config
client = RahkaranAPI(config)



# Make GET request for demonstration
try:
    response = client.get(
        "/General/AddressManagement/Services/AddressManagementWebService.svc/GetRegionalDivisionList"
    )
    print(json.dumps(response, ensure_ascii=False, indent=2))    
except Exception as e:
    print(f"Error occurred: {str(e)}")

# Data for creating a party
data = [{"Type ": 1, "FirstName": "Ehsan", "LastName": "Rezaei"}]
# Make Post request
try:
    response = client.post(
        "/General/PartyManagement/Services/PartyService.svc/GenerateParty",
        data
        )
    print(json.dumps(response, ensure_ascii=False, indent=2))    
except Exception as e:
    print(f"Error occurred: {str(e)}")

```

## Features

- Secure authentication with RSA encryption
- Automatic session management
- Connection pooling and retry mechanism
- Configurable SSL verification
- Comprehensive error handling
- Automatic rate limiting
- Request timeout configuration

## Development

To set up the development environment:

```bash
# Clone the repository
git clone https://github.com/yourusername/rahkaran-api.git
cd rahkaran-api

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install development dependencies
pip install -e ".[dev]"
```

## Running Tests

```bash
pytest tests/
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
