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
Built Distribution
Hashes for OpenSeaScripts-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4858ea9983b843b48bf962fe7fb0d121fb5ae029ffae642d31fa2e14a67e000d |
|
MD5 | 9e8a1b379be725a052f1ada1fb1d9af7 |
|
BLAKE2b-256 | e1e148e785f43c65e20341f2ce389f31e98a405a142f4d49e9b2b974bef1b095 |