Skip to main content

Scripts for automating OpenSea operations

Project description

OpenSeaScripts

A suite of Python scripts for using OpenSea where API's are limited. OSS uses Selenium to control a Google Chrome window to find, fetch, and interact with HTML elements on OpenSea's website.

Application

This Python module is intended for uploading many NFT's to OpenSea. Their API does not support uploading, and to avoid manually uploading collections of potentially hundreds of NFT's, this module can be used. I used this to upload my collection of Monkey Men.

This module supports all asset options on OpenSea using the AssetOptions class. Properties, levels, and stats will all be added to your NFT and displayed on the page just like any other NFT.

Installation

pip install OpenSeaScripts

You will also need Google Chrome.

Usage

from OpenSeaScripts.AssetOptions import AssetOptions
from OpenSeaScripts.OSSBrowser import OSSBrowser

# Create a new browser. This will open a Chrome window.
browser = OSSBrowser()

# Use the information displayed here to avoid signing in to MetaMask
# each time the program is run:
print("Browser info:", browser.get_session_data())

# Create a new asset object with the file NFT.png, titled "NFT"
my_asset = AssetOptions("NFT.png", "NFT")
my_asset.set_description("An NFT.")
my_asset.set_external_link("https://www.youtube.com/watch?v=dQw4w9WgXcQ")

# Add attributes to your NFT
my_asset.add_property("Type", "Image")
my_asset.add_property("Color", "Blue")
my_asset.add_level("Number", "1", "4")
my_asset.add_stat("Size", "50", "100")

# Set the asset to upload on the Polygon blockchain
my_asset.set_blockchain("Polygon") # "Ethereum" also works

# You will need to install the MetaMask extension in the browser 
# and connect your wallet to OpenSea before uploading assets.
input("Please sign in to OpenSea using MetaMask. Press Enter when ready... ")

# Perform the uploading process in the browser window
result = browser.upload_asset(my_asset)

# "result" will be False if the upload failed, or the OpenSea URL of the NFT if successful.
# Save this URL: It can be used to automate the selling of the NFT when the module supports this.

if not result:
	print("Upload failed.")
else:
	print("Uploaded asset. URL:", result)

Future Features

  • Better error messages
  • sell_asset function for easy bulk-selling
  • Documentation
  • Example programs

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

OpenSeaScripts-1.0.1.tar.gz (18.3 kB view hashes)

Uploaded Source

Built Distribution

OpenSeaScripts-1.0.1-py3-none-any.whl (19.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page