This project provides a Python-based interface to interact with the Ethereum blockchain and view metadata for NFTs in the Bored Ape Yacht Club (BAYC) collection. Built with Streamlit and powered by Infura, it offers a beginner-friendly way to work with blockchain data using Python.
- Fetch and display NFT metadata using the Token ID.
- Retrieve NFT images stored on IPFS and display them in the app.
- Built with Python and Streamlit for simplicity and interactivity.
- Ethereum mainnet connection via Infura.
-
Homebrew (macOS/Linux)
Homebrew is a package manager that simplifies the installation of dependencies.Installation:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Verify installation:
brew --version
-
xcode-select (macOS only)
Required forWatchdog
, which improves Streamlit performance.Installation:
xcode-select --install
-
Python 3.10 or later
Verify installation:
python3 --version
Installation:
- macOS/Linux (via Homebrew):
brew install python@3.10
- Windows:
Download the installer from python.org.
- macOS/Linux (via Homebrew):
-
Git
Used to clone the repository.Verify installation:
git --version
Installation:
- macOS/Linux (via Homebrew):
brew install git
- Windows:
Install Git for Windows.
- macOS/Linux (via Homebrew):
-
A Code Editor (Recommended: VS Code)
Download and install from Visual Studio Code.Optional: Install the Python extension in VS Code:
- Open VS Code and navigate to Extensions (
Ctrl+Shift+X
orCmd+Shift+X
). - Search for "Python" and click Install.
- Open VS Code and navigate to Extensions (
-
Infura API Key
Sign up at Infura and create a project to get your Infura Project ID.
- Open a terminal.
- Navigate to the Documents folder (optional but recommended):
cd ~/Documents
- Create a folder for your projects:
mkdir projects cd projects
- Clone the repository:
git clone https://github.com/Cryptolyfe/Python-NFT-Viewer.git
- Navigate into the project folder:
cd Python-NFT-Viewer
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
- macOS/Linux:
source venv/bin/activate
- Windows:
venv\Scripts\activate
- macOS/Linux:
- Install dependencies:
pip install -r requirements.txt
- Create a
.env
file in the project directory:touch .env
- Open the
.env
file in a text editor (e.g., VS Code). - Add your Infura Project ID to the
.env
file:INFURA_PROJECT_ID=your_infura_project_id
-
Start the app:
venv/bin/python -m streamlit run nft_viewer.py
-
Open the local URL displayed in your terminal (e.g.,
http://localhost:8501
) in a web browser. -
Enter a Token ID (e.g.,
1
) in the app and click "Fetch NFT" to display the metadata and image. -
Stop the application:
PressCtrl+C
in the terminal.
-
Connection Issues:
- Ensure your Infura Project ID is correct in the
.env
file. - Verify your internet connection.
- Ensure your Infura Project ID is correct in the
-
Dependency Issues:
- Ensure all dependencies are installed using
pip install -r requirements.txt
.
- Ensure all dependencies are installed using
This project is licensed under the AGPL-3.0 License.
For details, see the LICENSE file.