I've been using solana-py in python to interact with Solana for a bit now. And I've been wondering if there's a way to update NFT metadata in python. I'd assume you can't do it on solana-py. So I was wondering if there were other libraries I could use to update metadata in python. If there's no way to do it in python I plan on learning rust so I could use that. But it would be much easier to do it in python. If anyone knows how to update NFT metadata please share. Thanks for the help :D
2 Answers
You can try to rewrite Metaplex sdk in python (a lot of people would be grateful)
https://github.com/metaplex-foundation/js
What you're looking for is in
https://github.com/metaplex-foundation/js/blob/main/packages/js/src/plugins/nftModule/updateNft.ts
Here's an example of reading Metaplex data that I wrote:
https://github.com/vicyyn/MetaplexMetadata-js
Updating the NFT is updating the pda to new data that you send. Follow this structure.
https://github.com/metaplex-foundation/js#the-nft-model
IN order to update the pda you have to call Metaplex Token Program and call updateMetadataAccountV2
Hope this helps, good luck!
I used 2 projects to update NFT metadata:
- Metaboss: https://github.com/samuelvanderwaal/metaboss
- arloader: https://github.com/CalebEverett/arloader
But they are both written in rust. So do not know if it will be helpful for you.