Skip to content

Commit 8d17868

Browse files
committed
update documentation
1 parent 850a524 commit 8d17868

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

python-lib/tc_etl_lib/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,20 @@ iotam: tc.iota.iotaManager = tc.iota.iotaManager(endpoint = 'http://<iota_endpoi
239239
iotam.send_batch_http(data=[{"<key_1>": "<value_1>", "<key_2>": "<value_2>"}, {"<key_3>": "<value_3>", "<key_4>": "<value_4>"}])
240240
```
241241

242-
Ejemplo de uso de la clase minioManager
242+
Ejemplo de uso de la clase objectStorageManager
243243

244244
```python
245245
# import library
246246
import tc_etl_lib as tc
247247

248-
# declare minioManager and get initialized client
249-
minio_manager = tc.minioManager(endpoint='<minio_endpoint>:<port>',
248+
# declare objectStorageManager
249+
object_storage_manager = tc.objectStorageManager(endpoint='<http/https>://<object_storage_endpoint>:<port>',
250250
access_key='<user>',
251251
secret_key='<password>')
252252

253-
254253
# Upload test-file.txt to python-test-bucket/output/example.txt
255254
# note test-file.txt must exist in the same directory where this example is run
256-
minio_manager.upload_file(bucket_name='python-test-bucket',
255+
object_storage_manager.upload_file(bucket_name='python-test-bucket',
257256
destination_file='/output/example.txt',
258257
source_file="test-file.txt")
259258

@@ -262,13 +261,13 @@ def process_chunk(file_chunk):
262261
print(file_chunk)
263262

264263
# Retrieve example.txt and apply custom method to each 3 bytes chunk
265-
minio_manager.process_file(bucket_name='python-test-bucket',
264+
object_storage_manager.process_file(bucket_name='python-test-bucket',
266265
destination_file='/output/example.txt',
267266
chunk_size=3,
268267
processing_method=process_chunk)
269268

270269
# Remove the bucket created in the upload file method
271-
minio_manager.remove_bucket(minio_client, "python-test-bucket")
270+
object_storage_manager.remove_bucket("python-test-bucket")
272271
```
273272

274273
## Funciones disponibles en la librería
@@ -410,26 +409,26 @@ La librería está creada con diferentes clases dependiendo de la funcionalidad
410409
- :param obligatorio: `data`: Datos a enviar. Puede ser una lista de diccionarios o un DataFrame.
411410
- :raises SendBatchError: Se levanta cuando se produce una excepción dentro de `send_http`. Atrapa la excepción original y se guarda y se imprime el índice donde se produjo el error.
412411

413-
- Clase `minioManager`: En esta clase están las funciones relacionadas con la solución de almacenamiento de objetos MinIO.
412+
- Clase `objectStorageManager`: En esta clase están las funciones relacionadas con la solución de almacenamiento de objetos.
414413

415414
- `__init__`: constructor de objetos de la clase.
416-
- :param obligatorio `endpoint`: enpoint de acceso a MinIO
417-
- :param obligatorio `access_key`: usuario necesario para hacer login en MinIO
418-
- :param obligatorio `secret_key`: contraseña necesaria para hacer login en MinIO
419-
- :param optional `secure`: flag para indicar si la conexión con MinIO usa https (True) o http (False). Por defecto se considera `True` si se omite el parámetro.
415+
- :param obligatorio `endpoint`: enpoint de acceso a nuestro servicio de object storage
416+
- :param obligatorio `access_key`: usuario necesario para hacer login en nuestro servicio de object storage
417+
- :param obligatorio `secret_key`: contraseña necesaria para hacer login en nuestro servicio de object storage
420418
- :raises [ValueError](https://docs.python.org/3/library/exceptions.html#ValueError): Se lanza cuando le falta alguno de los argumentos obligatorios.
421419
- `create_bucket`: crea el bucket si no existe, si existe no hace nada.
422420
- :param obligatorio `bucket_name`: nombre del bucket a crear.
423421
- `remove_bucket`: borra el bucket si existe, si no existe no hace nada.
424422
- :param obligatorio `bucket_name`: nombre del bucket a borrar.
425-
- `upload_file`: sube un fichero a MinIO (si ya existe lo sobreescribe). Si el bucket al que se sube no existe se crea previamente.
423+
- :raises [Exception](https://docs.python.org/3/library/exceptions.html#Exception): Se lanza cuando se captura una excepción en el borrado del bucket
424+
- `upload_file`: sube un fichero (si ya existe lo sobreescribe). Si el bucket al que se sube no existe se crea previamente.
426425
- :param obligatorio `bucket_name`: nombre del bucket donde se va a subir el fichero.
427-
- :param obligatorio `destination_file`: nombre del fichero en MinIO (puede incluir el path SIN el nombre del bucket al inicio).
426+
- :param obligatorio `destination_file`: nombre del fichero en el bucket (puede incluir el path SIN el nombre del bucket al inicio).
428427
- :param obligatorio `source_file`: nombre del fichero local a subir (puede incluir el path).
429-
- :return: objeto con el estado de la subida del fichero.
430-
- `process_file`: procesa un fichero de MinIO por fragmentos y le aplica a cada fragmento la función provista.
428+
- :raises [Exception](https://docs.python.org/3/library/exceptions.html#Exception): Se lanza cuando se captura una excepción en la subida del fichero
429+
- `process_file`: procesa por fragmentos un fichero subido y le aplica a cada fragmento la función provista.
431430
- :param obligatorio `bucket_name`: nombre del bucket donde se va a buscar el fichero.
432-
- :param obligatorio `file`: nombre del fichero en MinIO (puede incluir el path SIN el nombre del bucket al inicio).
431+
- :param obligatorio `file`: nombre del fichero en el bucket (puede incluir el path SIN el nombre del bucket al inicio).
433432
- :param obligatorio `processing_method`: método a aplicar a cada fragmento del fichero.
434433
- :param optional `chunk_size`: tamaño en bytes de cada fragmento del fichero a recuperar. Por defecto 500000 bytes si se omite el argumento
435434
- :raises [Exception](https://docs.python.org/3/library/exceptions.html#Exception): Se lanza cuando se captura una excepción en el procesamiento del fichero
@@ -567,6 +566,7 @@ TOTAL 403 221 45%
567566
## Changelog
568567

569568

569+
- Change: replace `minioManager` backend library to use aws `boto3`
570570
- Add: new class `minioManager` to manage MinIO connection and file processing ([#109](https://github.com/telefonicasc/etl-framework/issues/109))
571571

572572
0.16.0 (September 29th, 2025)

0 commit comments

Comments
 (0)