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.1.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.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lebsta_units-1.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 022aca202c1901f2140b743c5f570caf23c196154ce7b4dd42d8d1bdc2dddd82
MD5 0a3849817e1cce39fcb6723d12ff9862
BLAKE2b-256 b17c8e219cc976172742c8d056f996e4ecfed3144d0b9f73499887a50f0e1f5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lebsta_units-1.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5c1406820a1f7ab8053dd8402c48d3874e41f062962982bd14251850b3dbac8
MD5 d5b7f072066973f5b5469b64e3f77c56
BLAKE2b-256 d2dbab6e9f62cf3847076122eb26c5977617ad74fd09c7d848d3f43f24d85661

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