Skip to main content

ML Uploader

ML Uploader es un paquete que permite subir archivos a un servidor mediante una API y verificar si un nombre personalizado ya existe antes de subirlo.

Características

  • Subida de archivos con nombre personalizado y tiempo de expiración
  • Verificación de nombres duplicados antes de la subida
  • Soporte para mostrar el progreso de la subida

Instalación

Desde la raíz del proyecto (donde se encuentra setup.py), ejecuta:

pip install .


Uso

Verificar si un nombre personalizado ya existe

Antes de subir un archivo, puedes comprobar si un nombre ya está registrado en el servidor:

import ml_uploads

# URL del endpoint de verificación
url_check = "https://marco-ml.com/files/api/check.php"
custom_name = "ejemplo_archivo"

# Verificación
if ml_uploads.check_custom_name(url_check, custom_name):
	print(f"El nombre '{custom_name}' ya existe en el servidor.")
else:
	print(f"El nombre '{custom_name}' está disponible.")

Subir un archivo al servidor

Para subir un archivo al servidor, especifica la ruta del archivo y opcionalmente un nombre personalizado y el tiempo de expiración.

import ml_uploads

# URLs de la API
upload_url = "https://marco-ml.com/files/api/upload.php"

# Parámetros de la subida
file_path = "ruta/del/archivo.txt"
custom_name = "mi_archivo"
expire_time = 24  # Expiración en horas

# Subir el archivo
try:
	response = ml_uploads.upload_file(
		file_path=file_path,
		upload_url=upload_url,
		custom_name=custom_name,
		expire=expire_time
	)

	# Extraer solo el enlace de descarga
	download_link = response.get("download_link", "No disponible")
	print("Archivo subido con éxito. Enlace de descarga:", download_link)
except Exception as e:
	print("Error al subir el archivo:", e)

Mostrar progreso de subida

Puedes pasar una función de callback para ver el progreso de la subida:

def progress_callback(progress):
	print(f"Subida en progreso: {progress}%")

ml_uploads.upload_file(
	file_path="ruta/del/archivo.txt",
	upload_url="https://marco-ml.com/files/api/upload.php",
	custom_name="mi_archivo",
	expire=24,
	progress_callback=progress_callback
)

Metadata

Release files for ml-uploads 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml-uploads 0.1.0
File Size Uploaded Provenance
ml_uploads-0.1.0.tar.gz 4.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ml-uploads 0.1.0
File Interpreter ABI Platform
ml_uploads-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / ml_uploads-0.1.0.tar.gz

Download URL ml_uploads-0.1.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a52005326739d9ba3ee2eba8bd479beb4e5334e01fad87f875f7a2424ea02895
BLAKE2b-256 checksum
How to use checksums
1aa815e1ccc0a6bc5492108c98922ad177bf9f492e15be4a1920d2c57cc76cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / ml_uploads-0.1.0-py3-none-any.whl

Download URL ml_uploads-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b9e22180d8b3b1638160510fc574c133bf0d08548351b8a0142cfe1e42e4160
BLAKE2b-256 checksum
How to use checksums
180f0a0d1e346b2d0b9551aae033ae59270a871cd6a0e367ea530b591b8f44d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for ml-uploads 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page