ezdvm
Easily run any python code behind a DVM on Nostr. Just pick a kind (for basic text-to-text use 5050) and put the code you want to run in the do_work() function. Then run the DVM.
Install from pip
pip install ezdvm
Install from local repo for development on ezdvm
git clone https://github.com/dtdannen/ezdvm.git
cd ezdvm/
python3.12 -m venv venv
source venv/bin/activate
pip install -e .
Create your own DVM
Steps:
- Choose the job request kind in the init function
- Run any python code inside the do_work() function. The
eventarg is the original job request from the user, in the form ofnostr-sdk event, for python examples see here: https://github.com/rust-nostr/nostr/tree/master/bindings/nostr-sdk-ffi/bindings-python/examples
from ezdvm import EZDVM
class HelloWorldDVM(EZDVM):
def __init__(self):
# choose the job request kinds you will listen and respond to
super().__init__(kinds=[5050])
async def do_work(self, event):
return "Hello World!"
if __name__ == "__main__":
hello_world_dvm = HelloWorldDVM()
hello_world_dvm.add_relay("wss://relay.damus.io")
hello_world_dvm.add_relay("wss://relay.primal.net")
hello_world_dvm.add_relay("wss://nos.lol")
hello_world_dvm.add_relay("wss://nostr-pub.wellorder.net")
hello_world_dvm.start()
Testing
Once it's running on your machine, if you are using kind 5050 you can test it here: https://dvmdash.live/playground/
Note that currently you have to use a NIP-07 extension to login first
Metadata
Release files for ezdvm 0.1.2
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 |
|---|---|---|---|---|
| ezdvm-0.1.2.tar.gz | 6.3 kB | Without provenance | Details for ezdvm-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezdvm-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ezdvm-0.1.2-py3-none-any.whl |
Total release size: 12.9 kB
Release files / ezdvm-0.1.2.tar.gz
| Download URL | ezdvm-0.1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
703cfbf12e660f6dc209e31b3f56dcd5c8bf07569800c7d73cf36d7e6170974f
|
|
BLAKE2b-256 checksum How to use checksums |
107423d245706b3ca2cf042424c5ba3dc35d829a6c470fa66026a99b510f2655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Release files / ezdvm-0.1.2-py3-none-any.whl
| Download URL | ezdvm-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fb5302bb5fe03c3aa1ca7697b39b00e041522037c3332e3adff74bd91425cd5
|
|
BLAKE2b-256 checksum How to use checksums |
d334717c7e4afe0a42545e70db8084eb4a18f8fd212c01d5ba2370339a48333a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.1
|
Security for ezdvm 0.1.2
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.