Metadata-Version: 2.1
Name: registerrecordobject
Version: 0.0.1
Summary: Register Record Object
Author: Nico Wolyniec
Author-email: nawolyniec@teys.es
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests (>=2.31)
Requires-Dist: aiohttp

# Register Record Object
Register Record Object is a Python package that simplifies the process of registering metrics and testing a service through HTTP requests.
There is a synchronous and an asynchronous version of the object.

## Installation
To use this module, you need to have Node.js installed on your machine. Then, you can install it using npm:

```bash
pip install recordregisterobject
```
## Usage
1. Import the package into your project:
```python
from registerrecordobject import RegisterRecordObjectSync
```
2. Create an instance of RegisterRecordObject by providing the base URL of your service:
```python
registerRecord = RegisterRecordObjectSync('http://localhost:3001/');
```
3. Use the register method to send metrics data:
```python
registerRecord.register({ "key1": 'value1', "key2": 'value2', "timestamp": time.time(), "service": 'service1' })
```
4. Use the test method to test your service:
```python
response = registerRecord.test()
assert(response.status_code == 200)
```
Ensure that your service has the corresponding endpoints for metrics registration and testing.


Full code example:
```python
from registerrecordobject import RegisterRecordObjectSync
from registerrecordobject import RegisterRecordObjectAsync
def run_sync():
    register_record = RegisterRecordObjectSync(url="http://localhost:3001")
    response_test = register_record.test()
    assert(response_test.status_code == 200)

    response_register = register_record.register(data={"test": "test", "service": "test-python"})
    assert(response_register.status_code == 200)

async def run_async():
    register_record = RegisterRecordObjectAsync(url="http://localhost:3001")
    response_test = await register_record.test()
    assert (response_test.status == 200)

    response_register = await register_record.register(data={"test": "test", "service": "test-python"})
    assert (response_register.status == 200)  
    
```
License
This project is licensed under the MIT License - see the LICENSE file for details.

Feel free to customize this README to include more details or specific instructions related to your project.
