Skip to main content

Python CLI for Nostr

Project description

nostrpy

CI/CD codecov CircleCI

CLI for Nostr

Installation

 pip install nostrpy

Usage

Show nostr version

 nostr --version
nostr, version 0.5.0

Generate a key pair

 nostr key new
{
  "Private key": "nsec1w54...edu3",
  "Public key": "npub1s92...7ckp"
}

Transform a public key to hex format, or from hex format to public key format

 nostr key convert -i 1a60c40a7...b472
{
  "npub": "npub1rfs...c9tg",
  "hex": "1a60c40a7...b472"
}

Publish a message

 nostr message publish -s <the sender nsec key> -m "Hello, publishing a message through nostr CLI."
{
  "Message": "Hello, publishing a message through nostr CLI."
}

Send an encryped direct message

 nostr message send -s <the sender nsec key> -m "Hello, sending an encryped direct message" -p <the receiver npub key>
{
  "Message": "Hello, sending an encryped direct message"
}

Receive message(s)

❯ nostr message receive -p <the npub key to receive the messages>
Hello, publishing a message through nostr CLI.
{
  "Public key": "npub1rfs...c9tg",
  "Events": [
    "Hello, publishing a message through nostr CLI.",
    "Hello, sending an encryped direct message"
  ],
  "Notices": []
}

Development & Test

See the Test Suite README

Feel free to add issues, add PRs, or provide any feedback!

Credits

Repositories:

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

nostrpy-0.5.0.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

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

nostrpy-0.5.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file nostrpy-0.5.0.tar.gz.

File metadata

  • Download URL: nostrpy-0.5.0.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for nostrpy-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1ab97ff04749b40efcba1192e7006dc425f9e3edb511e1460b4d545f0b536a5b
MD5 24ffb2773c18762bd55de6d7e2338238
BLAKE2b-256 ce860be77b9a3a3295b4c09f6d116e3d3704a7d6ab73c33db37c14a732f4866f

See more details on using hashes here.

File details

Details for the file nostrpy-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: nostrpy-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for nostrpy-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d68a5d5ec876bbb46d519a42f342fdd397534090dff2f151b059e4b2a57d5c5
MD5 12788f6441618783aa433907bec7b10c
BLAKE2b-256 4a5374c96e5ff588632f8d6dfe594df44febe466a38ffc081df86971b7a0a6de

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