Skip to main content

A Python library for unit definitions and conversions in engineering applications

Project description

LEBSTA Units

Una librería Python para definiciones de unidades y conversiones en aplicaciones de ingeniería.

Instalación

Instalación en modo desarrollo (recomendado para desarrollo local)

pip install -e .

Instalación normal

pip install .

Uso

Importación básica

import lebsta_units as units

# Usar las unidades
fuerza = 100 * units.kN
presion = 25 * units.MPa
longitud = 5 * units.m

Importación selectiva

from lebsta_units import kN, MPa, m, cm

fuerza = 100 * kN
presion = 25 * MPa
longitud = 5 * m

Importación completa

from lebsta_units import *

fuerza = 100 * kN
presion = 25 * MPa

Unidades Disponibles

Unidades Base

  • m - Metro
  • kg - Kilogramo
  • s - Segundo

Constantes Físicas

  • g - Aceleración de la gravedad (9.8066 m/s²)

Unidades de Masa

  • ton - Tonelada (1000 kg)

Unidades de Dimensión

  • cm - Centímetro
  • mm - Milímetro
  • inch - Pulgada
  • ft - Pie

Unidades de Fuerza

  • N - Newton
  • kN - Kilonewton
  • kgf - Kilogramo-fuerza
  • tonf - Tonelada-fuerza
  • kip - Kilo-libra fuerza

Unidades de Presión

  • Pa - Pascal
  • kPa - Kilopascal
  • MPa - Megapascal
  • psi - Libras por pulgada cuadrada
  • ksi - Kilo-libras por pulgada cuadrada

Ejemplos

Conversión de unidades

import lebsta_units as units

# Convertir de kN a N
fuerza_kN = 50 * units.kN
fuerza_N = fuerza_kN / units.N
print(f"50 kN = {fuerza_N} N")  # 50 kN = 50000.0 N

# Convertir de MPa a psi
presion_MPa = 10 * units.MPa
presion_psi = presion_MPa / units.psi
print(f"10 MPa = {presion_psi:.2f} psi")  # 10 MPa = 1450.38 psi

# Convertir de metros a pies
longitud_m = 10 * units.m
longitud_ft = longitud_m / units.ft
print(f"10 m = {longitud_ft:.2f} ft")  # 10 m = 32.81 ft

Cálculos con unidades

import lebsta_units as units

# Cálculo de esfuerzo (σ = F/A)
fuerza = 100 * units.kN
area = 0.05 * units.m**2
esfuerzo = fuerza / area

# Convertir a MPa
esfuerzo_MPa = esfuerzo / units.MPa
print(f"Esfuerzo: {esfuerzo_MPa} MPa")

Licencia

MIT License

Versión

1.0.0

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

lebsta_units-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

lebsta_units-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file lebsta_units-1.0.0.tar.gz.

File metadata

  • Download URL: lebsta_units-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for lebsta_units-1.0.0.tar.gz
Algorithm Hash digest
SHA256 01fe72a0f34a8f77cafcf7b4ac0dae1fca87a833aadd6d5b32c22e6635289441
MD5 a5863cf2a558678dfa4a8f716548e98f
BLAKE2b-256 9069afb15d6e2541febf056deb6b25be5bbbea3a7cf196d14d6cc5e7fc5d662d

See more details on using hashes here.

File details

Details for the file lebsta_units-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lebsta_units-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for lebsta_units-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b17add612e9274ab972b8d544dbf4de0a093b412a04b8352c0b0d28ae1797cd
MD5 d2fc0a7cbb04ada24eecd8e887d8f6de
BLAKE2b-256 c350e4336634a99dc8b37337c0c0e2c138b805943e6c9ea0e1bc140d7a108b4f

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