mumpy
NumPy you know. Speed you feel. Tools you actually need.
mumpy is a drop-in, NumPy-compatible library that goes further: multithreaded compute, fused operations, plus a built-in toolkit for data loading, SQL databases, dataframes, statistics, preprocessing, classic ML and tiny deep learning — with zero hard dependencies beyond NumPy.
import mumpy as mp
# 1) Faster NumPy (parallel ufuncs + fused ops)
a = mp.arange(10_000_000)
b = mp.sqrt(a) # multithreaded over all cores
c = mp.fma(a, b, 1.0) # a*b+c in a single pass, half the peak memory
# 2) Databases (sqlite built-in; postgres/mysql via SQLAlchemy, OLAP via DuckDB)
db = mp.db.connect("data.db")
db.create_table("users", {"id": "INTEGER PRIMARY KEY", "name": "TEXT", "age": "INTEGER"})
db.insert_many("users", [{"name": "ada", "age": 36}])
ages = db.read_numpy("SELECT age FROM users")
# 3) Lightweight DataFrame for analysts (no pandas required)
df = mp.frame.DataFrame({"age": [20, 30, 40], "salary": [100, 200, 300]})
df.describe()
df.groupby("age").mean()
df.query("age > 25")
# 4) Classic ML with a scikit-learn-like API (pure NumPy)
model = mp.ml.LogisticRegression().fit(X_train, y_train)
pred = model.predict(X_test)
# 5) Tiny deep learning (pure NumPy)
net = mp.nn.Sequential([mp.nn.Dense(4, 16), mp.nn.ReLU(), mp.nn.Dense(16, 1)])
net.fit(X, y, epochs=200, lr=0.01)
Why faster than NumPy?
| Technique | Detail |
|---|---|
| Parallel ufuncs | Compute-bound element-wise ops (sqrt/exp/sin/cos/…) split across a thread pool |
| Fused ops | fma/fms/fnma/lerp instead of a*b+c (half the peak memory, one pass) |
| Parallel FFT | scipy.fft with workers=-1 when SciPy is installed |
einsum(optimize=True) |
Faster contraction paths |
| Contiguous linalg | batch_matmul/cho_solve/ridge_solve ensure cache-friendly layouts |
Honest note: bandwidth-bound reductions (
sum/mean) delegate to NumPy directly — a single thread already saturates RAM bandwidth, and threading only adds overhead there.
Modules
| Module | For | Highlights |
|---|---|---|
mp.io |
Everyone | load_csv/save_csv/load_npy/load_npz/load_json/memmap/load_parquet/load_excel/read_auto |
mp.db |
Backend devs & analysts | connect/read_numpy/read_pandas/write_numpy/from_csv/query/to_parquet |
mp.frame |
Data analysts | DataFrame/filter/sort/groupby/merge/describe/corr/read_csv/read_sql/to_pandas |
mp.stats |
Exploratory analysis | describe/corr/zscore/iqr_outliers/histogram/skew/kurtosis/crosstab |
mp.preprocessing |
Data science | StandardScaler/MinMaxScaler/RobustScaler/OneHotEncoder/LabelEncoder/SimpleImputer/train_test_split/Pipeline |
mp.metrics |
Model evaluation | mse/rmse/mae/r2/accuracy/precision/recall/f1/confusion_matrix/roc_auc/log_loss |
mp.ml |
Machine learning | LinearRegression/Ridge/LogisticRegression/KNN/NaiveBayes/DecisionTree/RandomForest/KMeans/PCA |
mp.nn |
Deep learning | Sequential/Dense/ReLU/Sigmoid/Tanh/Softmax/Dropout/Adam/SGD/MSE/BCE/CrossEntropy |
mp.viz |
Quick plots | hist/scatter/line/heatmap/corr_heatmap (matplotlib, optional) |
mp.utils |
Everyone | seed/timer/timeit/one_hot/standardize/fill_nan/memory_usage |
Installation
pip install mumpy-toolkit # core (numpy only)
pip install "mumpy-toolkit[fast]" # + scipy for parallel FFT
pip install "mumpy-toolkit[all]" # scipy, pandas, pyarrow, sqlalchemy, duckdb, matplotlib
From source:
git clone https://github.com/salim-studio/mumpy.git
cd mumpy
pip install -e ".[all]"
Compatibility
mumpy.ndarraysubclassesnp.ndarray— any NumPy-consuming code accepts it unchanged.mp.asnumpy(x)returns a plain zero-copynp.ndarrayview.mp.set_workers(1)reproduces pure-NumPy behavior for fair comparison.DataFrame.to_pandas()/from_pandas()bridge to pandas;Databaseworks with stdlib sqlite and optionally SQLAlchemy (PostgreSQL/MySQL) and DuckDB.- Migrating from the old name?
import cumpystill works via a compatibility shim.
Benchmarks & tests
python benchmarks/bench.py
python -m pytest tests/ -q
python examples_mumpy.py # end-to-end: synthetic data -> DB -> DataFrame -> ML
End-to-end example (synthetic data → DB → ML)
import numpy as np
import mumpy as mp
rng = np.random.default_rng(0)
X = rng.normal(size=(200, 3))
y = (X[:, 0] + X[:, 1] > 0).astype(int)
with mp.db.connect(":memory:") as db:
db.write_numpy("data", np.column_stack([X, y]), columns=["f0", "f1", "f2", "label"])
df = mp.frame.DataFrame.read_sql("SELECT * FROM data", db)
print(df.describe())
Xtr, Xte, ytr, yte = mp.ml.train_test_split(
df.to_numpy(["f0", "f1", "f2"]), df["label"].to_numpy(), test_size=0.2)
acc = mp.metrics.accuracy(
yte, mp.ml.LogisticRegression(lr=0.5, epochs=500).fit(Xtr, ytr).predict(Xte))
print("accuracy:", acc)
Roadmap
- PyPI release + versioned changelog
- Optional Rust/Numba backend for ufuncs
-
mp.sqlquery builder + lazy frames - More estimators (Gradient Boosting, Isolation Forest)
- ONNX export for
mp.nn
Contributing
See CONTRIBUTING.md. Bug reports and feature requests are welcome via issues — please use the templates.
License
MIT — see LICENSE. © salim-studio.
Metadata
Release files for mumpy-toolkit 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mumpy_toolkit-0.2.0.tar.gz | 39.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mumpy_toolkit-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.3 kB
Release files / mumpy_toolkit-0.2.0.tar.gz
| Download URL | mumpy_toolkit-0.2.0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad308e3caa7b353cbfc90b9429821bfbde955aea56fb8ad71ce5ca879ed19a20
|
|
BLAKE2b-256 checksum How to use checksums |
c62ca54aa13724068f78925097399654da086881d442d2a90fd9a36362f4d8c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / mumpy_toolkit-0.2.0-py3-none-any.whl
| Download URL | mumpy_toolkit-0.2.0-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
731676be4d2a639a2304c58f104a89a828426676e2bcf4d0998dcb56ac33ea34
|
|
BLAKE2b-256 checksum How to use checksums |
6e6c382e6584603069126245d280fc1ed1f3dc9f2f9bab85548c4ccfc2a3cb8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for mumpy-toolkit 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.