PowerEngine: A library which calculates signals and electricity.
Installation
python -m pip install powerengine
# OR
python -m pip install git+https://github.com/AaravMalani/powerengine
Usage
from powerengine import Engine
engine = Engine()
engine.add_blocks([
Power(engine, {}, (0, 0, 0)),
Wire(engine, {'facing': None}, (0, 0, 1)),
Wire(engine, {'facing': None}, (0, 0, 2)),
Delayer(engine, {'facing': 'east', 'delay': 5}, (0, 0, 3)),
Wire(engine, {'facing': None}, (0, 0, 4)),
])
engine.run(3, ignore_speed=True, output=False)
Plugin Structure
Each plugin is a directory in the installation/path/plugins directory.
It contains a manifest.json JSON file with the following fields.
| Field | Type | Description |
|---|---|---|
| name | string |
Plugin name |
| version | string |
Plugin version |
| author (optional) | string or array[string] |
The author of the plugin |
| blockTypes | object[string, array[string]] |
An object of the screaming snake case version of the name to the block types defined (each block type being an array of [namespace, id]) |
A plugin is a Python module (it has an __init__.py)
An example plugin would be
main.py
import powerengine
class PizzaBlock(powerengine.Block):
id = ('pizzamod', 'pizzablock')
def update(self, engine : powerengine.Engine):
self.state['facing'] = {
'north': 'south',
'east': 'west',
'south': 'north',
'west': 'east'
}[self.state['facing']]
__init__.py
from .main import PizzaBlock
manifest.json
{
"name": "Pizza Mod",
"version": "1.0.0",
"blockTypes": {"PIZZA_BLOCK": ["pizzamod", "pizzablock"]}
}
Metadata
Release files for powerengine 1.0.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 | Actions |
|---|---|---|---|---|
| powerengine-1.0.0.tar.gz | 5.8 kB | Without provenance | Details for powerengine-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| powerengine-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for powerengine-1.0.0-py3-none-any.whl |
Total release size: 11.7 kB
Release files / powerengine-1.0.0.tar.gz
| Download URL | powerengine-1.0.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84f9db496955fa095079f141ede37aeb22f67a230ed18b0bb82a2fe71ce2b808
|
|
BLAKE2b-256 checksum How to use checksums |
df327ebabb53e290e16ffbc4c4dd84aeea6a409f26681c6ca999dd55b4e98864
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Release files / powerengine-1.0.0-py3-none-any.whl
| Download URL | powerengine-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
605748f3fbac3ea2780797443319e755e12b6fed7124f2e8e6d8db3e6cc0efd1
|
|
BLAKE2b-256 checksum How to use checksums |
aea4e1a6f578efd282bd71b83b5baaeaa2f056bfe2277a9e1f725dcd851d6647
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for powerengine 1.0.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.