A Python library for mathematical operations, unit conversions, currency conversions, and translations
Project description
🔢 Numo: Your Smart Mathematical Companion
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:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file numo-0.2.1.tar.gz.
File metadata
- Download URL: numo-0.2.1.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73ca29dbe97c44dd87a9726e6ad2979e51b6ee4c818e399704dd1493f47969b6
|
|
| MD5 |
8b3a0614941eb7021ea7975da4192c25
|
|
| BLAKE2b-256 |
8e248f58a90e42c0792f4f07c97c34b4a2e10e60fcb8a3e3695c37116d2611eb
|
File details
Details for the file numo-0.2.1-py3-none-any.whl.
File metadata
- Download URL: numo-0.2.1-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
863675fa33a7d5cd4522b5bc0d3eebad954bb0f0df1f58840ed00f9f7cd94c1f
|
|
| MD5 |
a8e78900fbc8d5998a8e089207e9e2a6
|
|
| BLAKE2b-256 |
116eae9e16e595e78294d57b6ebe751d6f10dd81d1f3d0a2327e059562f8b23e
|