Skip to main content

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.

Visita el repositorio en Github

Link al repo: GitHub

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rse_api_client-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rse_api_client-0.1.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file rse_api_client-0.1.2.tar.gz.

File metadata

  • Download URL: rse_api_client-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for rse_api_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 42a65ddee049412105281df8cc20a42589f45caef153ae2e7e3fa4df350cacb6
MD5 4bed5eeda1ae9dbaae0956fe29396bb7
BLAKE2b-256 fe128b23908e0087dac9a170f3895d0a57562d3c493563d70046c820828a7d07

See more details on using hashes here.

File details

Details for the file rse_api_client-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rse_api_client-0.1.2-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

Hashes for rse_api_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f5d78463cf87ba6b70c89c84195579677402d1e0da3db896f2cdbf3fb619a4a
MD5 243696d7b246197dafc60cbb6eac6a1f
BLAKE2b-256 19d7d711d5b71473599d1d999809ca2f1e786b60fd8197b261ca6c1c15cda6d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page