Fetch NFTs that were minted in the blockchain
Project description
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.
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
Built Distribution
File details
Details for the file pyOpENWatch-1.2.3.tar.gz
.
File metadata
- Download URL: pyOpENWatch-1.2.3.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | caf7b29d2233a9ddf680bd68d189e19b381cffde799ee7fa0c5aa818a4b1c9c7 |
|
MD5 | 8f1abae3afd89e01a972a3bbe92073be |
|
BLAKE2b-256 | c6b481e91c20cc7883fb3e84c091312d81ca4ebb9fe8898dff54b4b7267f8852 |
File details
Details for the file pyOpENWatch-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: pyOpENWatch-1.2.3-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 610826961f1e59371072aed0cc715d85af9ddf53b98f0e8ee8acbae629fd8996 |
|
MD5 | 278c5245f88262ec140524d20626a772 |
|
BLAKE2b-256 | d3ff72f3b21a3f9dfac00c5ce385fd53f716de58b68f9642aa16c684dea89c78 |