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.12.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.12-py3-none-any.whl (69.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezsnake-0.3.12.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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.12.tar.gz
Algorithm Hash digest
SHA256 b1646f11775d5951eeba6b0559a072203436e9305526b6187e15237ba808479e
MD5 6d89817becc13f703d83366331e2343e
BLAKE2b-256 c8b2a08e52a75b03f9c023276f9f8ff787c4a973ffbf866a0f9cca185b983cfb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezsnake-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 69.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4a0a67a09c6910334c1f70fa20c55053f2558b98d0aba2d817f19533d69c61bc
MD5 f0375846276848212d3f6daf7b8ceabc
BLAKE2b-256 d8ff56af838b07fe536f88bda2c57b4bfdb81feb2ae2c6254b0bbd45a27f4da0

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