A client for RSE API
Project description
RSE API CLIENT
Este es un módulo para interactuar con la API RSE. Es una implementación básica para simplemente agregar el módulo, instalar las dependencias, agregar los valores correspondienetes en el archivo .env para luego hacer uso de la funcionalidad.
Instalación
1. Crear y Activar un Entorno Virtual
Primero, crea y activa un entorno virtual:
# Crear un entorno virtual
python -m venv venv
# Activar el entorno virtual (Windows)
venv\Scripts\activate
# Activar el entorno virtual (MacOS/Linux)
source venv/bin/activate
# Desactivar el entorno virtual (Windows)
deactivate
2. Instala las dependencias
Las dependencias que se instalarán son:
- requests
- python-dotenv
Para ello ejecuta el siguiente comando:
pip install .
Configuración
Ejecuta el siguiente comando o copia tu editor el archivo .env.example y renombralo .env
Dentro estan los valores que se necesitan para realizar las peticiones RSE API.
Comando
cp .env.example .env
Valores dentro de .env.example
En tu nuevo archivo .env, cambia por los que correspondan. Esto es lo básico la idea sería ir agregando los endpoints que necesites para luego pasarle a la función para realizar la petición.
URL=https://api.rse.example.com
USERNAME=tu_usuario
PASSWORD=tu_clave
ENDPOINT_JOBS=jobs
Uso del Módulo
Para hacer uso del módulo en cualquier script de Python y especificar el endpoint que deseen:
from rse_api_client import RSEAPIClient
client = RSEAPIClient()
response = client.make_request('get', 'jobs')
print("Response:", data)
Ejecutar Test
python -m unittest discover -s tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rse_api_client-0.1.1.tar.gz.
File metadata
- Download URL: rse_api_client-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029c35c53a0298a869091c842584bed4cd1de9e31b5fb30c01a93ace0b53b78a
|
|
| MD5 |
2d3aa9149262565d4e189fe911352e91
|
|
| BLAKE2b-256 |
312eaa84f77a30b7a8620e3ee4cbf619d65e37637c975cf7286f5c5c75c53eb2
|
File details
Details for the file rse_api_client-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rse_api_client-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a795ac641dd2db15059de9a41d9146ada97744cc3a1bdb327b3c2bea9ce4d9aa
|
|
| MD5 |
4b9c6b7e73aaee78cefbc53a8ca0f1e7
|
|
| BLAKE2b-256 |
a5f5dc0b87a33dd9d6f7b93f167cf97a1b98c9500acace5a0dd83786d68c294b
|