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.2.0.tar.gz (152.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.2.0-py3-none-any.whl (69.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezsnake-0.2.0.tar.gz
  • Upload date:
  • Size: 152.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.2.0.tar.gz
Algorithm Hash digest
SHA256 7f00ee92eaf35c33aa7eb30cae194eb11603d8493be835d0496b145f42d0d4f3
MD5 377ba589b45903c520964070fa88af59
BLAKE2b-256 7ef1d4bb66708a3855fb843618f05f36c61c1241ae3f975d25b5346178085281

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezsnake-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 69.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05aef33ba5808e628cc8f0bdfa2796d881e5bdc001901aab5197da47c380e506
MD5 f35e1831dda40090473ef9d62c2ffdf2
BLAKE2b-256 fb2aa23259de8a834ea57cd8146bd8930dbdc95eaaa17a6a8c068afb379fe94f

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