metadata.pulling

Command Line

usage: pulling.py [-h] [-c CONTRACT] [--uri_base URI_BASE]
                  [--uri_suffix URI_SUFFIX] [--collection COLLECTION]
                  [--supply_func SUPPLY_FUNC] [--name_func NAME_FUNC]
                  [--uri_func URI_FUNC] [--lower_id LOWER_ID]
                  [--upper_id UPPER_ID] [--max_supply MAX_SUPPLY]
                  [--ipfs_gateway IPFS_GATEWAY]
                  [--web3_provider WEB3_PROVIDER]
                  [-b {arbitrum,avalanche,binance,ethereum,fantom,optimism,polygon}]
                  [-t THREADS] [--skip_ipfs_folder]
-h, --help

show this help message and exit

-c <contract>, --contract <contract>

Collection contract address (use if want to infer params from contract).

--uri_base <uri_base>

URI base. Not used if contract is provided. (use if want to pull direct from URL).

--uri_suffix <uri_suffix>

URI suffix. Not used if contract is provided. (default: No suffix).

--collection <collection>

Collection name. (Required if pulling direct from URL. Otherwise will infer if not provided).

--supply_func <supply_func>

Total supply contract function. Not used if pulling direct from URL. (default: “totalSupply”).

--name_func <name_func>

Collection name contract function. Not used if pulling direct from URL. (default: “name”).

--uri_func <uri_func>

URI contract function. Not used if pulling direct from URL. (default: “tokenURI”).

--lower_id <lower_id>

Lower bound token id. (Required if pulling direct from URL. Otherwise will infer if not provided).

--upper_id <upper_id>

Upper bound token id. (Required if pulling direct from URL. Otherwise will infer if not provided).

--max_supply <max_supply>

Max token supply. (Required if pulling direct from URL. Otherwise will infer if not provided).

--ipfs_gateway <ipfs_gateway>

IPFS gateway. (default: None).

--web3_provider <web3_provider>

Web3 Provider. (Recommended provider is alchemy.com. See Discord for additional details)

-b {arbitrum,avalanche,binance,ethereum,fantom,optimism,polygon}, --blockchain {arbitrum,avalanche,binance,ethereum,fantom,optimism,polygon}

Blockchain where the contract is located. (default: ethereum)

-t <threads>, --threads <threads>

Number of threads to use for downloading metadata. (default: 6)

--skip_ipfs_folder

Skip IPFS folder download.


Internal functions

metadata.pulling.fetch(token_id, metadata_uri, filename)
Parameters
  • token_id (int) –

  • metadata_uri (str) –

  • filename (str) –

Return type

None

metadata.pulling.fetch_all_metadata(token_ids, collection, uri_func, contract, abi, uri_base, uri_suffix, blockchain, threads, skip_ipfs_folder)
Parameters
  • token_ids (Union[list, range]) –

  • collection (str) –

  • uri_func (str) –

  • contract (Contract) –

  • abi (list) –

  • uri_base (str) –

  • uri_suffix (str) –

  • blockchain (str) –

  • threads (int) –

  • skip_ipfs_folder (bool) –

Return type

list

metadata.pulling.pull_metadata(args)
Parameters

args (Namespace) –

Return type

None