Skip to main content

A Python library for mathematical operations, unit conversions, currency conversions, and translations

Project description

🔢 Numo: Your Smart Mathematical Companion

PyPI version License: MIT Python 3.8+

Numo is a powerful, intuitive Python library that brings mathematics to life. It combines mathematical operations, unit conversions, currency exchanges, and translations into a single, elegant package. Whether you're a student, developer, or data scientist, Numo makes complex calculations and conversions feel natural and straightforward.

✨ Key Features

🧮 Smart Mathematical Expression Evaluation

  • Safe and intelligent expression parsing
  • Support for complex mathematical operations
  • Built-in protection against dangerous operations
from numo import Numo
numo = Numo()

# Basic calculations
await numo.calculate("2 * (3 + 4)")  # Returns "14.0"
await numo.calculate("2^3 + 4")      # Returns "12.0"

# Use mathematical constants
await numo.calculate("2 * pi")       # Returns "6.28318530717959"
await numo.calculate("e^2")          # Returns "7.3890560989307"

📐 Comprehensive Function Library

Built-in mathematical and statistical functions:

# Statistical functions
await numo.calculate("avg(1, 2, 3, 4)")     # Returns "2.50"
await numo.calculate("std(1, 2, 3, 4)")     # Returns "1.29"

# Mathematical functions
await numo.calculate("sin(pi/2)")           # Returns "1.00"
await numo.calculate("log10(100)")          # Returns "2.00"
await numo.calculate("sqrt(16)")            # Returns "4.00"

Available functions include:

  • Basic: abs, round, floor, ceil
  • Statistical: sum, avg, min, max, median, var, std
  • Trigonometric: sin, cos, tan, asin, acos, atan
  • Advanced Math: pow, sqrt, log, log10, exp, fact, gcd

📏 Intuitive Unit Conversions

Convert between various units seamlessly:

# Length conversions
await numo.calculate("5.5 km to miles")    # Returns "3.42"
await numo.calculate("72 inch to cm")      # Returns "182.88"

# Weight/Mass conversions
await numo.calculate("100 kg to lbs")      # Returns "220.46"
await numo.calculate("16 oz to grams")     # Returns "453.59"

# Temperature conversions
await numo.calculate("32 F to C")          # Returns "0.00"
await numo.calculate("100 C to F")         # Returns "212.00"

# Digital storage
await numo.calculate("1.5 GB to MB")       # Returns "1536.00"

💱 Real-time Currency Conversion

Up-to-date currency conversion with major world currencies:

# Currency conversions
await numo.calculate("100 USD to EUR")     # Real-time conversion
await numo.calculate("1000 JPY to GBP")    # Real-time conversion
await numo.calculate("50 EUR to TRY")      # Real-time conversion

🌍 Language Translation

Quick and accurate translations:

# Simple translations
await numo.calculate("hello in spanish")    # Returns "hola"
await numo.calculate("good morning in french")  # Returns "bonjour"

📝 Smart Variable Management

Define and use variables in your calculations:

# Variable definitions and operations
results = await numo.calculate([
    "radius = 5",
    "area = pi * radius^2",
    "circumference = 2 * pi * radius",
    "area"                          # Returns "78.54"
])

# Using predefined constants
await numo.calculate("phi * 10")    # Golden ratio * 10
await numo.calculate("sqrt2 * 5")   # √2 * 5

Built-in constants include:

  • Mathematical: pi, e, tau, phi (golden ratio)
  • Common values: sqrt2, sqrt3
  • Angles: deg30, deg45, deg60, deg90, deg180, deg360
  • Scientific: c (speed of light), g (gravity), h (Planck constant)

🚀 Installation

pip install numo

🎯 Quick Start

from numo import Numo

# Create a Numo instance
numo = Numo()

# Start calculating!
result = await numo.calculate("5 km to miles")
print(result)  # "3.11"

# Chain operations
results = await numo.calculate([
    "distance = 100",              # Store variable
    "time = 9.58",                # Usain Bolt's record
    "speed = distance / time",     # Calculate speed
    "speed km/h to mph"           # Convert to mph
])

🛠️ Advanced Usage

Custom Variable Management

# Define and use custom variables
await numo.calculate([
    "tax_rate = 0.18",
    "price = 100",
    "tax = price * tax_rate",
    "total = price + tax",
    "total"                        # Returns "118.00"
])

Complex Calculations

# Combine multiple features
await numo.calculate([
    "radius = 10 cm to m",         # Unit conversion
    "volume = (4/3) * pi * radius^3",  # Mathematical expression
    "volume m^3 to liters"         # Another conversion
])

🤝 Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🌟 Star Us!

If you find Numo helpful, please consider giving us a star on GitHub! It helps us know that you find the project useful and encourages further development.

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

numo-0.2.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

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

numo-0.2.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: numo-0.2.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for numo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f866bb564c45569130f0a0b27db090156d1b0d5cc6542ab1cad15c5516daef48
MD5 0fcd07f358744427d6292df6636ef558
BLAKE2b-256 66118775fd15252b4dcd1a43cae615d3420c289e738357afa13be0bbe0658193

See more details on using hashes here.

File details

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

File metadata

  • Download URL: numo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.6

File hashes

Hashes for numo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8301f49afe66f0918b8c0ccbb6df369b129724f862ed47b73588ae67182cdab7
MD5 a8091025189a5e6f0b625a97254b2ed6
BLAKE2b-256 5429d2af9ca4322d9be677eb72eaf8183e09c511fb73eb7805053252eaafacca

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