VoltKit: A Python toolkit for electrical and electronics engineering
Project description
⚡ VoltKit — The Open Toolkit for Electrical & Electronics Engineering
VoltKit is an open-source Python library designed to make electrical and electronics engineering more practical, visual, and beginner-friendly.
From Ohm's Law to Phasor Diagrams, from FFTs to Streamlit-powered simulations — VoltKit helps students, educators, and makers bring theoretical concepts to life using code.
🚀 Why VoltKit?
Electrical engineering is filled with complex formulas and repetitive calculations. VoltKit simplifies this by:
- Providing clean and tested Python functions for core EE concepts
- Offering ready-made simulators and calculators
- Including beautiful interactive visualizations using Streamlit
- Helping students build real projects, faster
🧩 Features (So Far)
| Version | Highlights |
|---|---|
| v0.1 | Ohm’s Law, Series & Parallel Resistors, RLC impedance |
| v0.2 | AC Power: Real, Reactive, Apparent, Power Factor |
| v0.3 | Signal generation (sine, square, triangle, DC) |
| v0.4 | Filters (Low-pass, High-pass), Bode Plots |
| v0.5 | FFT Analysis, RC Step Response |
| v1.0 | Phasor Math, RL/RC/RLC Phasor Diagrams, Time-domain Signal |
| Generator | |
| v1.0.1 | Real Signal Importing in (csv, wav) formets, Harmonics,scaling, Signal Stats, Plotting Signal |
⚙️ Installation
pip install voltkit
Or you can also
Clone the repo and install in development mode:
git clone https://github.com/ShobhitBhardwaj763/voltkit.git
cd voltkit
pip install -e .
Voltkit v1.0 Collab Notebook with examples
🧪 Usage Examples
Ohm's Law
from voltkit.core import voltage, resistance, current
# voltage(i,r)
# resistance(v,i)
# current(v,r)
v = voltage(2, 5) # 10 volts
r = resistance(10,2) # 5 ohms
i = current(10,5) # 2 amps
RLC Impedance
from voltkit.core import resistor, inductor, capacitor
z_r = resistor(100) # 100 Ω
z_l = inductor(10e-3, freq=1000) # 62.8j Ω
z_c = capacitor(1e-6, freq=1000) # -159.1j Ω
Phasor Diagram for RL Circuit
from voltkit.core import plot_rl_phasor_diagram
plot_rl_phasor_diagram(R=10, L=0.1, I=1, f=50)
Generate a Sine Wave
from voltkit.core import sine_wave
t, y = sine_wave(freq=50, duration=1, sample_rate=1000, amp=5)
To Plot the sin wave
from voltkit.core import sine_wave
import matplotlib.pyplot as plt
t, y = sine_wave(freq=50, duration=1, sample_rate=1000, amp=5)
plt.figure(figsize=(12, 8))
plt.plot(t, y, label='Sine Wave')
plt.ylabel('Voltage (V)')
plt.legend()
plt.grid()
plt.show()
Real Signal Processing (v1.0.1)
Load, analyze and visualize real-world signals easily:
from voltkit.core import (load_csv_signal, add_harmonics, scale_signal, compute_rms, peak_to_peak, signal_energy, compute_thd, plot_signal)
# Load signal from CSV file and plot signal
t,y = load_csv_signal("signal.csv")
plot_signal(t,y, title="Sample Signal")
# Add Harmonics
# Base signal with harmonics
harmonics_dict = {3: 0.5, 5: 0.3} # Add 3rd and 5th harmonics
t,y = sine_wave(freq=50, amp=5, duration=0.1, fs=5000 )
t,y_harmonic = add_harmonics(t,y, freq, harmonics_dict)
plot_signal(t,y_harmonic, title="Signal with Harmonics")
# Scale the harmonic signal
y_scaled = scale_signal(y_harmonic, factor=2.0)
plot_signal(t, y_scaled, title="Scaled Signal (x2)")
# Analyze the signal
print("RMS", compute_rms(y_scaled))
print("Total Harmonics Distortion": compute_thd(y_scaled))
🖥️ Explore Interactivily
Visit our live **VoltKit Simulation Website** built with Streamlit:
👉 [https://voltkit-web.streamlit.app](https://voltkit-web.streamlit.app)
No installation needed, just open in your browser and visualize concepts!
🧪 Available Simulations on Website
- Signal Generator
- Bode Plot Explorer
- FFT Analyzer
- RC Circuit Visualizer
- Phasor Diagram Tool
Example files to understand
basic_usage.pysignal_genrator.pyrc_response.pypower_analysis.pyphasor_diagram_example.pyplot_bode_rlc.pyphasor_demo.pylowpass_filter_demo.pyfft_analysis.pyac_vs_dc_example.pysignal_analysis_example.pysignal_transform_example.pysignal_stats_example.py
To run example files, use this method
cd voltkit
python examples/example_file_name.py
Or just open the rulebook google collab notebook
Who Is It For?
- Students learning EE/ECE fundamentals
- Teachers building visual classroom demos
- Makers building small projects and simulations
🤝 Contributing
Want to contribute or request a feature?
- Submit a PR or open an issue
- Reach me directly at:
voltkit.dev@gmail.com
📜 License
This project is licensed under the MIT License.
Acknowledgements
NumPy - numerical computing SciPy - scientific functions Pandas - data handling Streamlit - interactive web apps Matplotlib - plotting
Special thanks to the open-source community.
VoltKit was started with one goal:
To empower electrical engineers to learn and build faster with Python.
If this helped you, feel free to ⭐ star the repo or share it with your peers.
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 voltkit-1.1.0.tar.gz.
File metadata
- Download URL: voltkit-1.1.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
258351620b06c44cd3e990beb5284d97e959b15eb4192fe0080078bfa2fa3857
|
|
| MD5 |
0ccf52616ef3c784f56f45e2a86f1dd4
|
|
| BLAKE2b-256 |
1c80cb3079a5eebd87c055fbff3cc46c58398c3c73380d1806b871c2b5750202
|
File details
Details for the file voltkit-1.1.0-py3-none-any.whl.
File metadata
- Download URL: voltkit-1.1.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e65f811206a58ebee952b67aded8ee64292c8645f9be72dbf01238c2f4ee97b
|
|
| MD5 |
f90d8c8ba15161dfd963b52e06a4bb5a
|
|
| BLAKE2b-256 |
063d8bb21fce5d7a24218d23d5b703da479389dbd41d565264ce90d631da5aba
|