Skip to main content

A Python library for electronic formulas and signal processing

Project description

Voltops

Voltops is a Python library built for electronics and signal processing enthusiasts. Whether you're an engineer, student, or hobbyist, this package offers intuitive functions for working with electrical formulas and analyzing signals with ease. Every function is physics-aware—values carry metadata (DC/AC, RMS/peak, phase, frequency) so you catch mistakes before they propagate.


Installation

pip install voltops

Quick Start

Basic Electronic Formulas

from voltops.formulas.basic import BasicFormulas

# Calculate voltage using Ohm's Law: V = I * R
voltage = BasicFormulas.ohms_law(current=2, resistance=5)
print(f"Voltage: {voltage.value} V (kind={voltage.metadata.kind})")

# Calculate power: P = V * I
power = BasicFormulas.power(voltage=voltage, current=2)
print(f"Power: {power.value} W")

Frequency Spectrum Analysis

import numpy as np
from voltops.signal_processing.transforms import Transforms

# Generate a simple sine wave signal
t = np.linspace(0, 1, 1000, endpoint=False)
signal = np.sin(2 * np.pi * 10 * t)

# Get the frequency spectrum
freqs, amps = Transforms.frequency_spectrum(signal, sampling_rate=1000)

Filtering Signals

from voltops.signal_processing.filters import Filters

# Create a signal with multiple frequency components
t = np.linspace(0, 1, 1000, endpoint=False)
signal = np.sin(2 * np.pi * 10 * t) + 0.5 * np.sin(2 * np.pi * 20 * t)

# Apply a low-pass filter with a cutoff at 15 Hz
filtered_signal = Filters.low_pass_filter(signal, cutoff=15, sampling_rate=1000)

Features

  • Physics-aware quantities: Voltage, Current, Resistance/Impedance, Power, Frequency, and Phase objects with waveform metadata.
  • Electronic Formulas: Ohm's Law, power, and more—now returning safe quantity objects.
  • Signal Processing: FFT, DFT, filtering, and spectral analysis.
  • Extensible API: Easy-to-use, modular design for seamless integration.

Learn more about the design direction in docs/philosophy.md.

Contributing

Contributions are welcome!
If you'd like to report a bug, request a feature, or contribute code, feel free to open an issue or submit a pull request on GitHub.

Maintainers

This library is actively developed and maintained by Madhur Thareja.

License

Licensed under the MIT License.
Feel free to use, modify, and distribute this library.

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

voltops-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

voltops-0.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: voltops-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for voltops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 67eadad4047a61cb5bed20547231326b1c357ebce2731dddf26aa2c03cc765bd
MD5 55eca02129c9164ee002f729294e6a8f
BLAKE2b-256 fb49b2b5cdaa1a7841f56a38bc68348e4c8404d4e78a06f5d713e205361d93d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: voltops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for voltops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b9eb0a54dc5b6de0ecfa6ef16614bf13467acb94750b603bb30672d9c9d3ee8
MD5 32eb64af127ef5f9ca783abac9fdcbaa
BLAKE2b-256 511d0e91823ccfbbfbff91fbb1889d023b1253b1a539da9be3bf5986bdb32a24

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