Metadata-Version: 2.1
Name: intlib.py
Version: 0.0.3
Summary: Integroh Connector Python Library
Author-email: Marçal Junior <marssaljr@gmail.com>
Project-URL: Homepage, https://github.com/integroh/intlib.py
Project-URL: Issues, https://github.com/integroh/intlib.py/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Requires-Python: >=3.11.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests

# Integroh Connector Python Library

This Python library, `IntegrohConnector`, is designed to handle API requests and responses for the Integroh service. The Integroh service integrates with other services like Keycloak and Dropbox.

## Installation

To install the library, you can use pip:

```bash
pip install initlib.py
```

## Usage

Here is a basic example of how to use the `IntegrohConnector` class:

```python
from integroh_connector import IntegrohConnector

connector = IntegrohConnector()
service_data = {
    'username': 'your_username',
    'password': 'your_password'
}
response = connector.connect('keycloak', 'POST', service_data)
```

you need to creata a integroh.ini file in root like this:
```json
{
    "api_key": "1234567890abcdef",
    "base_url": "http://localhost:5000/connect/"
}
```

## Methods

The `IntegrohConnector` class provides the following methods:

- `__init__`: Initializes the connector with default values.
- `validate_service`: Validates the provided service.
- `validate_request_type`: Validates the provided request type.
- `load_initfile`: Loads the configuration from a file named `integroh.ini`.
- `request_service`: Makes an API request to the specified service.
- `validate_service_data`: Validates the provided service data.
- `connect`: Main method to connect to a service.

## Exceptions

The library defines the following exceptions:

- `ValidationError`: Raised when there is a validation error.
- `ConError`: Raised when there is a connection error.

## Documentation

For more detailed information, please refer to the [official documentation](https://integroh.com/docs/integroh-connector-python).

## Contributing

Contributions are welcome. Please submit a pull request or create an issue to discuss the changes.

## License

This project is licensed under the GPL-3.0 License.
