Convert files to Base64 and vice versa.
Project description
cord64
cord64 es una librería de Python para convertir archivos a texto en Base64 y viceversa.
Instalación
Para instalar la librería, solo pon en tu terminal:
pip install cord64
Uso A continuación se muestra un ejemplo de cómo usar las funciones convert_archive_to_base64 y base64_to_archive:
from cord64.convert import convert_archive_to_base64, base64_to_archive
# Ruta del archivo a convertir
file_path = "ruta/al/archivo/image.png"
# Carpeta donde se guardará el archivo decodificado
output_folder = "ruta/al/carpeta/output"
# Convertir archivo a Base64
base64_text = convert_archive_to_base64(file_path)
print(f"Archivo en Base64: {base64_text}")
# Convertir Base64 a archivo y guardarlo en la carpeta especificada
output_file_path = base64_to_archive(base64_text, output_folder, "image.png")
print(f"Archivo guardado en: {output_folder}")
Funciones
convert_archive_to_base64(file_path) Convierte un archivo a una cadena de texto en Base64.
- file_path: Ruta del archivo a convertir.
base64_to_archive(base64_text, folder_path, file_name) Decodifica un texto en Base64 y guarda el archivo en la carpeta especificada.
- base64_text: Texto en Base64 a decodificar.
- folder_path: Carpeta donde se guardará el archivo decodificado.
- file_name: Nombre del archivo decodificado.
Licencia Este proyecto está licenciado bajo la Licencia MIT
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
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 cord64-0.1.5.tar.gz.
File metadata
- Download URL: cord64-0.1.5.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af08563e3b42f3c240ed3af8a0592a6044e6a5c2965e9ee520e5793d88efef62
|
|
| MD5 |
3e26903a951199fa741ae53629f04cb9
|
|
| BLAKE2b-256 |
8a190be2b4bbcaa9db69caa2e9efb4c84175cfa55b371d86d0c17e2dcbf1b650
|
File details
Details for the file cord64-0.1.5-py3-none-any.whl.
File metadata
- Download URL: cord64-0.1.5-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5ca7e845bf9ab38005838aa920c1248c382bdbfc1e17ec81a07afd4fb660912
|
|
| MD5 |
5d2433d9abb95d8501a792990100ca1a
|
|
| BLAKE2b-256 |
2288560f4d261b9aecb3c484e60e1076fd86cc3aa4589f59e6921fc214d77a93
|