Skip to main content

Paquete Python para manipulación sencilla de Word, datos y NetCDF. Python package for easy handling of Word, data, and NetCDF files. Doc: https://github.com/Fernandojbf123/ezsnake

Project description

ezsnake

Librería de utilidades científicas en Python para NetCDF, manipulación avanzada de Word, utilidades geográficas y funciones tipo MATLAB.


📦 Módulos principales

1. NetCDF (ezsnake.netcdf)

Lectura, exploración y escritura de archivos NetCDF usando netCDF4.

Funciones principales:

  • load_nc(ruta, variable=None)
  • view_att(ruta, variable=None)
  • dict2nc(ruta, data)

2. Word Template Writer (ezsnake.word_template_writer)

Automatización avanzada de plantillas Word (.docx): inserción de figuras, referencias cruzadas, reemplazo de variables, tablas y documentos externos.

API pública:

  • insertar_figuras_en_plantilla(doc, diccionario_de_reemplazos)
  • insertar_referencias_cruzadas_en_plantilla(doc, diccionario_de_reemplazos)
  • reemplazar_texto_en_plantilla(doc, diccionario_de_reemplazos)
  • insertar_documento_externo_en_plantilla(doc, diccionario_de_reemplazos)
  • rellenar_tablas_en_plantilla(doc, diccionario_de_reemplazos)
  • reemplazar_variables_en_tablas(doc, diccionario_de_reemplazos)

3. MATLAB-like (ezsnake.matlab)

Funciones científicas compatibles con MATLAB para estadística, distribuciones y conversión de fechas:

Funciones principales:

  • betacdf, betafit, betainv, betalike, betapdf, betaln
  • datenum_to_datetime, datenum_to_pd_datetime
  • distchck, hist
  • logncdf, lognfit, lognlike, lognpdf, lognrnd, lognstat
  • normcdf, normfit, normlike, normpdf, norminv

4. Utilidades (ezsnake.utils)

Funciones para cálculos geográficos, manipulación de datos y utilidades varias:

Funciones principales:

  • uv2polar(u, v)
  • polar2uv(dir_deg, spd)
  • grados_a_km_lat(delta_lat)
  • grados_a_km_lon(delta_lon, latitud)
  • distancia_entre_dos_puntos(lon2, lat2, lon1, lat1, unidad='km')
  • calcular_tiempo_de_viaje(lon2, lon1, lat2, lat1, velocidad, unidad='km')
  • timestamp_a_texto_espanol(fecha, mes_y_anio)
  • get_excel_variables_name(df_datos_documento)
  • get_excel_variable_values(df_datos_documento, nombre_variable)

🚀 Instalación

Desde PyPI:

pip install ezsnake

Desde el repositorio (editable):

pip install -e .

📋 Requerimientos

  • Python >= 3.11
  • netcdf4 >= 1.7.4
  • numpy >= 2.0
  • openpyxl >= 3.1
  • pandas >= 2.0
  • python-docx >= 1.1
  • scipy >= 1.17.1

📝 Ejemplo de uso

from ezsnake.netcdf import load_nc, view_att, dict2nc

# Cargar todas las variables de un archivo NetCDF
data = load_nc('archivo.nc')

# Cargar una variable específica
temperatura = load_nc('archivo.nc', 'temperature')

# Ver atributos de una variable
attrs = view_att('archivo.nc', 'temperature')

# Crear un archivo NetCDF desde un diccionario
data_dict = {
    'global_atributes': {'title': 'Mi archivo NetCDF'},
    'temperature': {
        'value': np.array([[1, 2], [3, 4]]),
        'dims': ['time', 'lat'],
        'units': 'Celsius'
    }
}
dict2nc('nuevo_archivo.nc', data_dict)

👤 Autor y créditos


by BelloDev
agregado 2026/05/25
ultima revision 2026/05/25


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

ezsnake-0.3.6.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

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

ezsnake-0.3.6-py3-none-any.whl (67.8 kB view details)

Uploaded Python 3

File details

Details for the file ezsnake-0.3.6.tar.gz.

File metadata

  • Download URL: ezsnake-0.3.6.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ezsnake-0.3.6.tar.gz
Algorithm Hash digest
SHA256 2f433e71d8f83c2e81935ca27b10f2f72fcaa1147589418e3431965bddfd9013
MD5 5fc7eab5c84bd2b73743f60b9fe5cd93
BLAKE2b-256 408d30ae732e4d0660eda86241b7fc931fa1770637d4c211f63dec29f46a805f

See more details on using hashes here.

File details

Details for the file ezsnake-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: ezsnake-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 67.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ezsnake-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f3a9a3580e8ec305899d6e0cc31b94da98685769dbedc7cf8e23231ae842fcf6
MD5 d9ceca6133f1f29c76c5efb3f771c128
BLAKE2b-256 337dc7c3567dbf30745d4a5573b08a88f734622cf9070084f019dbb863cf1941

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