pyOpENWatch
pip install pyOpENWatch
Fetch the NFTs that has been minted on the blockchain, with current tools, NFT data is hard to reach or depends on commercial third party APIs.
This is not desirable for various reasons, PyOpENWatch offers an alternative.
Usage
from pyopenwatch import EthereumNFTWatcher
watcher = EthereumNFTWatcher(host, port, log_level)
watcher.fetch_nfts_until_block(terminal_block_hash, limit, callback)
Here, the pyopenwatch.EthereumNFTWatcher does the heavy lifting, you will have to point it
to an Ethereum node, using the host and port. The node can be a light node.
log_level refers to Python's logging levels
if passed, you can control what sort of information is being logged.
The watcher function traverses the blockchain and finds the NFTs being held inside,
the terminal_block_hash and limit can be provided to limit the number of blocks
the PyOpENWatch will fetch before terminating.
The callback function is the actual driving part of the package, it is a function
with the signature (pyopenwatch.NFT) => None. When the EthereumNFTWatcher finds a new NFT,
it initialises an pyopenwatch.NFT class and calls this callback.
Pass a function that takes found NFTs and process them as they are found.
Logging
My understanding of the Ethereum nodes is that they can be extremely volatile,
and at numerous points significant errors may occur, thes errors are similar to
dropped packages in the TCP protocol, seem to occur when syncing issues occur,
in order to preserve functionality, instead of throwing errors, we log them instead,
the default behaviour of the pyopenwatch.EthereumNFTWatcher is to log these in the
ERROR level.
If you set the logger_level to INFO, newly found NFTs and mint transactions will
be logged. If the logger_level is set to DEBUG the newly fetched transactions and
blocks wil be logged.
Use Case
This Python module was created as a part of a project to create a tool to find stolen images minted as NFTs to help artists recover their stolen art. As you can probably guess, I find NFTs and technology surrounding them less than ideal and I would appereciate if dApp and Blockchain developers would refrain from using this library.
I would also like people who use this technology to limit illegal blockchain activity to get in touch.
I understand that I cannot legally enforce this in any way, this is GPLv3 project, so legally you are free to do whatever as long as you follow the License, but still, I hope my words hold some weight for people.
Release files for pyOpENWatch 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyOpENWatch-1.2.3.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyOpENWatch-1.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.7 kB
Release files / pyOpENWatch-1.2.3.tar.gz
| Download URL | pyOpENWatch-1.2.3.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
caf7b29d2233a9ddf680bd68d189e19b381cffde799ee7fa0c5aa818a4b1c9c7
|
|
BLAKE2b-256 checksum How to use checksums |
c6b481e91c20cc7883fb3e84c091312d81ca4ebb9fe8898dff54b4b7267f8852
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.9.5
|
Release files / pyOpENWatch-1.2.3-py3-none-any.whl
| Download URL | pyOpENWatch-1.2.3-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
610826961f1e59371072aed0cc715d85af9ddf53b98f0e8ee8acbae629fd8996
|
|
BLAKE2b-256 checksum How to use checksums |
d3ff72f3b21a3f9dfac00c5ce385fd53f716de58b68f9642aa16c684dea89c78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.9.5
|