jsup.GEN - working on image-to-image generation with AI

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-gen-working-on-image-to-image-generation-with-ai Hello, this is @joviansummer(witness: @jswit). I'd like to share what I'm working on regarding my experintal jsup.GEN project, which tries to connect image generation AI with Steemit. Currently, jsup.GEN provide function to generate image from test prompt(txt2img). This function is interesting, but it's not easy to generate exactly what you want because you need to explain the image in detail with multiple keywords in English. Thus, I think it's more useful to have a function to generate image from existing reference image. I'm working on this image-to-image function, and thinking about two methods to implement it. The first method is to provide 2 commands as follows: !gen_t : This command focuses more on text prompt than reference image. The result may be quite different from reference because text prompt will have much more in...

파이썬으로 업비트 거래소의 스팀 가격 조회

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/6bstk5


업비트(Upbit) 거래소에서 코인 시세 조회를 위한 API를 제공하는데요. 이를 이용해서 스팀 가격을 조회하는 작업을 파이썬으로 수행할 수 있습니다.

@jswit 증인 노드에서 스팀 가격을 공시해야 하는데, 업비트의 스팀 시세를 이용하기 위해 필요한 부분입니다.

달러 기준으로 시세를 공시해야 하므로 업비트의 BTC-STEEM 시세와 USDT-BTC 시세를 가져온 후 USDT-STEEM 시세를 계산하여 공시하려고 합니다.

파이썬의 requests 모듈을 이용해서 업비트에 API 요청을 보내면 json 형식으로 응답이 오는데요, 이것을 딕셔너리로 변환하여 작업합니다.

import requests

# 업비트 API 접속 주소 (BTC-STEED, USDT-BTC)
ticker_url = "https://api.upbit.com/v1/ticker?markets=BTC-STEEM,USDT-BTC"

# HTTP GET 요청으로 접속하여 응답 수신
response_raw = requests.get(ticker_url)
# json 형식의 응답을 딕셔너리(dict) 형식으로 변환
response = response_raw.json()

# BTC-STEEM 시세
btc_steem_price = response[0]['trade_price']
# USDT-BTC 시세
usdt_btc_price = response[1]['trade_price']
# USDT-STEEM 시세 계산
steem_price = btc_steem_price * usdt_btc_price

print('STEEM 가격:', steem_price)

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기