Skip to main content

ohmslaw

PyPI - Downloads PyPI - License Documentation Status GitHub Tag

Python3 library for calculations using Ohm's law

Ohms law is an important and fundamental rule to remember when working with resistors and electronics in general. It defines the relationship between the components’ current I in amps (A), voltage V in volts (V) and resistance R in ohms (Ω). Ohm’s law consists of three mathematical equations that explain the relationship between current, voltage and resistance. If you know two of these values.

Quickstart:

install

pip install ohmslaw

import

from ohmslaw import Ohms

you can calculate the resistors in series, passing the values ​​in the series() method

>>> from ohmslaw import Ohms
>>>
>>> R1, R2, R3 = 280, 450, 100
>>>
>>> o = Ohms()
>>> series = o.series(R1, R2, R3)
>>>
>>> print("Resistors in series = ", series)
Resistors in series =  830
>>>

current multiplied by resistance = voltage

>>> o = Ohms()
>>> results = o.volts(I=12, R=4)
>>> 
>>> print(results)
48
>>> 

voltage Divided by resistance = current

>>> o = Ohms()
>>> results = o.current(V=12, R=4)
>>> 
>>> print(results)
3.0
>>> 

voltage divided by current = resistance

>>> o = Ohms()
>>> results = o.resistance(V=48, I=4)
>>> 
>>> print(results)
12.0
>>> 

Watts

>>> o = Ohms()
>>> results = o.watts(I=2, R=15)
>>> 
>>> print(results)
60
>>> 

Metadata

Release files for ohmslaw 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ohmslaw 2.1.2
File Size Uploaded
ohmslaw-2.1.2.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ohmslaw 2.1.2
File Interpreter ABI Platform
ohmslaw-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.4 kB

Release files / ohmslaw-2.1.2.tar.gz

Download URL ohmslaw-2.1.2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
131f5e5836069eeb4a9543889e4d0552c7f37e944210c1ac5c75e33eec770d8d
BLAKE2b-256 checksum
How to use checksums
06165af7f5ba1c068aa43b16aae9acfbcf489b3e5beb48f2691182ecd993932e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.6

Release files / ohmslaw-2.1.2-py3-none-any.whl

Download URL ohmslaw-2.1.2-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d93b48cd6393ac74f271f66ed329ec478c9681c501e6211e93149ccbc3401aa
BLAKE2b-256 checksum
How to use checksums
c95412d017b884170f2a79df489db03dc9d609836bc22ddfd1d8781e81837453
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page