Skip to main content

ezsnake is a Python package for working with NetCDF files, a framework for working with python-docx, openpyxl, and also MATLAB datenum conversions into pandas Datetime format, providing an easy-to-use interface for data manipulation and analysis.

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.1.0.tar.gz (89.7 kB view details)

Uploaded Source

Built Distribution

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

ezsnake-0.1.0-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezsnake-0.1.0.tar.gz
  • Upload date:
  • Size: 89.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ezsnake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 56b4738f99e57129cd2bce9c6398a8348cda9047da7999f2b3ed12d647aa64e4
MD5 ec9bb07e714b438a3e1888b122d702ac
BLAKE2b-256 61734a87ba87a457956419c4f4c495fab07e59553dc57218187b9bdc65f52b7f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ezsnake-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 447f0200212ff15d4e7d6c015525d9a6525067c54e451de90e4532cfa25a7e14
MD5 9fe3fa04dbc532cd8f9403041b7aab08
BLAKE2b-256 65d8decce645057123dc399378c01371d72c3abaf74dca432780b90014c310ef

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