A collection of python scripts which help you programatically create PNGs or GIFs

Overview

OpenSea PNG/GIF NFT Creator

Description

A collection of python scripts which help you programatically create PNGs or GIFs and their Metadata in bulk with custom rarity rates, upload them to OpenSea & list them for sale.

In /Generate/ is the generator script for programmatically creating images.

In /Upload/ there is an uploader script that logs into your OpenSea account via Selenium and metamask chrome plugin to bulk upload NFT to your collection. This part of the collection was customised from https://github.com/lakshyabatman/Bulk-uploader-NFT

Inside /List/ there are a set of scripts to help you grab all your collection links and metadata information so that you can then set a price in Eth within the AssetLinks.csv and list them for sale. This was quite a tricky issue to solve as there is no bulk sell feature in OpenSea but this does automate the listing process.

Whilst this is an easy, hands-off way of uploading/listing your NFTs it takes time and isn't as efficient as having API access. I might update some of the functionality to use OpenSea's API in the future but for now you may want to run the upload process over night when you don't need your machine.

I've created a few example assets/images for the purpose of demoing this project. Feel free to do what you like with them.

You can check out the OpenSea NFT collection I made with this project here: https://opensea.io/collection/ether-swimmers/

If this proves useful to you or you get NFT rich consider buying me a coffee:

Buy Me A Coffee

Before you get started

Accounts

  • Get a metamask wallet and the Chrome extension.
  • Sign up to OpenSea using a metamask wallet.

Install Requirements

  • pip install -r requirements.txt
  • Make sure you have chrome driver installed.
  • Create .env from .example.env with required keys.

Create your PNG assets

  • Create your assets and put them in folders within the /Assets/ folders.
  • Recommended image size is 300x300 but there is code to resize images automatically.
  • Rename your assets to numbers such as 1.png, 2.png, 3.png etc and put them in the right folders. This makes it easier to work with a dictionary to generate metadata.

Generating your NFTs

Configure the Generator Script

  • Follow the comments in the script.
  • Setup your dictionarys of asset information for NFT metadata.
  • Configure the image output for PNG/GIF.

Start generating

  • Open Execute.py and change the NumberOfNFTS.
  • Run the script.
  • The generator script will put strings of numbers into a GenerationIDs csv this is used to stop duplicate NFTs. If you need to rerun the generator from scratch, make sure to clear the IDs so that you aren't limited.
  • There will be a metadata JSON file for each image. These will need to be joined by running the MergeJson.py file in the /JSON/ folder. (This could probably be fixed to do automatically at the point of generation).
  • All your images should now be in OutputData/Images.

Uploading to OpenSea

Using UploadNFTs.py

Setup your .env file

  • EXTENSION_PATH: In our program, we're running a selenium based browser (chrome driver here) and usually in automated environment we don't have access to extensions, so get the access.
    • Navigate to chrome://extensions/ Click ‘Pack extension’ and enter the local path to the Metamask extension. This will generate a .crx file. Also, make a note of Extension ID.
    • Now the path to this '.crx' file is the value of this field.
  • RECOVERY_CODE: Recovery code of your wallet cause we need to login into your metamask.
  • PASSWORD: Metamask's password.
  • CHROME_DRIVER_PATH: To run chromium, you need to download the chrome driver and it's path will be the value. (https://chromedriver.chromium.org/downloads)

Note on metamask automation:

  • You have to click the "sign" button during user login on opensea for the first time.
  • Sometimes metamask wants additional "sign" auth on actions which when unattended can stop the scripts.
  • If it fails at any point just rerun, the code is designed to keep track of what has already been uploaded/listed and skip that.
  • You may find that when OpenSea's servers slow down (which happens a lot) this can affect Selenium's timings and cause errors as it tries to click things that don't exist. I've accounted for a fair bit of this behaviour but it doesn't account for every situation.

Setup your OpenSea Collection

  • You will need to input your OpenSea collection URL on line 98 & 134 of UploadNFTs.py. Create your OpenSea collection in your account and grab the link.

Run UploadNFTs.py

Listing for sale on OpenSea

This is long winded but worth it.

Run the scripts in the List folder in this order:

getUrls.py

  • Change the collection URL on line 74
  • This gets all (most) the URLs of the NFTs from the collection
  • This takes a while as it has to scroll through the page to overcome the infinite loader. The more images you have, the longer it'll take.
  • Important! - After you've run this do a Remove Duplicates operation in the CSV to get rid of any URLs which are duplicated.

getProperties.py

  • This gets all the Metadata attributes & their % rarity for the NFT URLs and throws them into AssetLinks.csv.

Important - Price your NFTs

  • Inside AssetLinks.csv add prices to your NFTs in Ethereum before runing

Run list.py

  • This should just run

Phew, you are done and now have a collection of shiny NFTs on OpenSea! Congrats

You might also like...
Png2Jpg tool will help you convert from png image format to jpg images format.

PNG 2 JPG All codes assume running from root directory. Please update the sys path at the beginning of the codes before running. Over View Png2Jpg too

This is a new web-based photo management application. Run it on your home server and it will let you find the right photo from your collection on any device. Smart filtering is made possible by object recognition, location awareness, color analysis and other ML algorithms.
TRREASURE_IMAGE is python lib by which you can hide anything in a .jpg image with Command-Line Interface[cli] feature

TRREASURE_IMAGE TRREASURE_IMAGE is a python third-party library with Command-Line Interface[cli] feature. Table of Contents General Info Python librar

This is a python project which detects color of an image when you double click on it.

This is a python project which detects color of an image when you double click on it. You have to press ESC button to close the pop-up Image window. There are mainly two library CV2 and Pandas that are used in this project.

PyGtk Color - A couple of python scripts to select a color (for scripting usage)
PyGtk Color - A couple of python scripts to select a color (for scripting usage)

Selection Scripts This repository contains two scripts to be used within a scripting project, to aquire a color value. Both scripts requir

This will help to read QR codes using Raspberry Pi and Pi Camera

Raspberry-Pi-Generate-and-Read-QR-code This will help to read QR codes using Raspberry Pi and Pi Camera Install the required libraries first in your T

API to help generating QR-code for ZATCA's e-invoice known as Fatoora with any programming language

You can try it @ api-fatoora api-fatoora API to help generating QR-code for ZATCA's e-invoice known as Fatoora with any programming language Disclaime

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.

python-barcode python-barcode provides a simple way to create barcodes in Python. There are no external dependencies when generating SVG files. Pillow

NFT collection generator. Generates layered images

NFT collection generator Generates layered images, whole collections. Provides additional functionality. Repository includes three scripts generate.py

Owner
Tom
https://www.buymeacoffee.com/tomhar
Tom
AutoGiphyMovie lets you search giphy for gifs, converts them to videos, attach a soundtrack and stitches it all together into a movie!

AutoGiphyMovie lets you search giphy for gifs, converts them to videos, attach a soundtrack and stitches it all together into a movie!

Satya Mohapatra 18 Nov 13, 2022
Make GIFs from time-stacked xarray.DataArrays (time, [optional band], y, x), dead-simple.

GeoGIF Make GIFs from time-stacked xarray.DataArrays (time, [optional band], y, x), dead-simple. from geogif import gif, dgif gif(data_array) dgif(das

Gabe Joseph 47 Dec 22, 2022
A quick and dirty QT Statusbar implementation for grabbing GIFs from Tenor, since there is no offical or unofficial one I found. This was intended for use under Linux, however it was also functional enough on MacOS.

Statusbar-TenorGIF App for Linux A quick and dirty QT Statusbar implementation for grabbing GIFs from Tenor, since there is no offical one and I didnt

Luigi DaVinci 1 Nov 1, 2021
Anime2Gif - an algorithm that detects scenes in a video and generates gifs from it

Anime2Gif Anime2Gif is an algorithm that detects scenes in a video and generates gifs from it. How to use To use it, first, you'll need to install it'

null 1 Dec 9, 2021
🖼️ Draw Images or GIFs in your terminal

Drawitor Draw Images/GIFs in your terminal. Install pip install drawitor CLI Tool drawitor cat_dancing.gif Library The library is written in a simple

Eliaz Bobadilla 7 Dec 15, 2022
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

Kartikay Bhutani 8 Sep 21, 2022
👾 Python project to help you convert any image into a pixel art.

?? Pixel Art Generator Python project to help you convert any image into a pixel art. ⚙️ Developer's Guide Things you need to get started with this co

Atul Anand 6 Dec 14, 2022
DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics

DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics.

Frederik Berlaen 344 Jan 6, 2023
HtmlWebShot - A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features.

A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features

Danish 24 Dec 14, 2022
This repository will help you get label for images in Stanford Cars Dataset.

STANFORD CARS DATASET stanford-cars "The Cars dataset contains 16,185 images of 196 classes of cars. The data is split into 8,144 training images and

Nguyễn Trường Lâu 3 Sep 20, 2022