Skip to main content

python3 library for Ohms law.

Project description

ohmslaw

PyPI - Downloads PyPI - License Documentation Status GitHub Tag

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

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
>>> 

find the resistance value to limit the electrical voltage of a circuit

>>> o = Ohms()
>>> results = o.find_resistor(source=48, 
...                           component_voltage=12,
...                           component_current=1)
>>> 
>>> print(results)
36.0
>>> 

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

ohmslaw-1.1a0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

ohmslaw-1.1a0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file ohmslaw-1.1a0.tar.gz.

File metadata

  • Download URL: ohmslaw-1.1a0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for ohmslaw-1.1a0.tar.gz
Algorithm Hash digest
SHA256 634f3b5c72c6a2e2564dbd3bd10294bfc8e7e150dd44930f87dabda1631edeeb
MD5 b6136d311d4f7bc1774e5b5014c2804b
BLAKE2b-256 78a7b447813d4b98e4b46b7e5e60a8dc0ef3e5f8c1f0ff48d9f696098699a2ae

See more details on using hashes here.

File details

Details for the file ohmslaw-1.1a0-py3-none-any.whl.

File metadata

  • Download URL: ohmslaw-1.1a0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.6

File hashes

Hashes for ohmslaw-1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 7dfc9035953d4c296c4ef56544a0d6eb8792257590735ff9af50f2ab15328b79
MD5 f39e7a165107957b2f564ec172cad027
BLAKE2b-256 7c60d1cd7445f4b52d61cce4dc281d54bd09e27145b7e880c9124a9abdbaae66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page