pynostr
Python library for for Nostr.
This library is using coincurve instead of secp256k1, so pynostr can be used on windows.
Installation
pip install pynostr
Usage
Generate a key
from pynostr.key import PrivateKey
private_key = PrivateKey()
public_key = private_key.public_key
print(f"Private key: {private_key.bech32()}")
print(f"Public key: {public_key.bech32()}")
Test Suite
Set up the test environment
Install the test-runner dependencies:
pip3 install -r test-requirements.txt
Then make the pynostr python module visible/importable to the tests by installing the local dev dir as an editable module:
# from the repo root
pip3 install -e .
Running the test suite
Run the whole test suite:
# from the repo root
pytest
Run a specific test file:
pytest test/test_this_file.py
Run a specific test:
pytest test/test_this_file.py::test_this_specific_test
Pre-commit-config
Installation
$ pip install pre-commit
Using homebrew:
$ brew install pre-commit
$ pre-commit --version
pre-commit 2.10.0
Install the git hook scripts
$ pre-commit install
Run against all the files
pre-commit run --all-files
pre-commit run --show-diff-on-failure --color=always --all-files
Update package rev in pre-commit yaml
pre-commit autoupdate
pre-commit run --show-diff-on-failure --color=always --all-files
Metadata
Release files for pynostr 0.0.4
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 | |
|---|---|---|---|---|
| pynostr-0.0.4.tar.gz | 13.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pynostr-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.1 kB
Release files / pynostr-0.0.4.tar.gz
| Download URL | pynostr-0.0.4.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6522b857b2c6bf2c9502c87ba9bf6ca0d589172a425e82e14fb2b7cf2aa49c89
|
|
BLAKE2b-256 checksum How to use checksums |
87bae2e76bc8498958e443b398a161c524fb48aafb31a05dd3b1e20384ff15e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / pynostr-0.0.4-py3-none-any.whl
| Download URL | pynostr-0.0.4-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76682cd70b225aece02272071ab8a002e9ba6c84e837ba0128c667662e0176e1
|
|
BLAKE2b-256 checksum How to use checksums |
f6e8a8143df6f929aad317175bf57f1ef4fde266a7f4dc1e5b1182ab52039a6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for pynostr 0.0.4
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.