NOTE: ALTHOUGH THIS PROJECT WORKS, IT IS STILL UNDER HEAVY DEVELOPMENT AND THINGS WILL CHANGE BEFORE v1.0
Python package to access Juungle.net API
$ python -m pip install juungle
$ git clone https://github.com/Juungle/juungle-python.git juungle
$ cd juungle
$ python -m pip -r requirements.txt
Create a file user-config.ini
with juungle.net credentials
in the same directory of your code:
LOGIN_USERNAME="username@email"
LOGIN_PASSWORD="password"
Inside the code
from juungle.nfts import NFTs
nfts = NFTs('username@email', 'password')
from juungle.nft import NFTs
nfts = NFTs()
nfts.available_to_buy = True
nfts.purchased = False
nfts.token_group = 'WAIFU'
nfts.get_nfts()
for nft in nfts.list_nfts:
if nft.price_bch <= 0.01:
print(nft.token_name)
from juungle.nft import NFTS
nfts = NFTs()
nfts.get_my_nfts()
for nft in nfts.list_nfts:
print(nft.token_name)
To query prices we going to use coingecko api
pip install pycoingecko
from juungle.nft import NFTS
from pycoingecko import CoinGeckoAPI
nfts = NFTs()
nfts.get_my_nfts()
# Query price
cg = CoinGeckoAPI()
bch_price = cg.get_price(ids='bitcoin-cash',
vs_currencies=['usd', 'eur'])['bitcoin-cash']
msg = "NFT: {} with price {} USD or {} EUR"
for nft in nfts.list_nfts:
print(msg.format(nft.token_name, bch_price['usd'], bch_price['eur'])
Because tokens/group name are not unique we have to use the HEX id that can be found at the simpleledger.info.
Juungle-python package provides a list of IDs just to make easier of the most common toekns:
Token Name | Token ID |
---|---|
WAIFU | a2987562a405648a6c5622ed6c205fca6169faa8afeb96a994b48010bd186a66 |