cryptomood / api Goto Github PK
View Code? Open in Web Editor NEWApi for cryptomood
License: Apache License 2.0
Api for cryptomood
License: Apache License 2.0
What does following error mean? Is the server not available?
details = "failed to connect to all addresses"
debug_error_string = "{"created":"@1636858955.363420818","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3158,"referenced_errors":[{"created":"@1636858955.363419445","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":147,"grpc_status":14}]}"
Using SERVER_ADDRESS = 'apiv1.cryptomood.com:443'
I am struggling to execute your API following this link: https://github.com/cryptomood/api/blob/master/python/Sentiments/HistoricNewsSentiment/client.py
However, I got several bugs especially. In fact I am unable to install the dependencies
Do you have any documentation or a tutorial about your API that I could use
Hi,
You are giving sentiment scores for the app but not the API for BTC
. I think people will be able to try this more because we want to test if your sentiment scores have any correlation for the BTC or not which I can't test having a Free account.
Just a thought and a request!
Cheers
Fahad
Hi, I have tried to run the plot_historic_sentiments.py in python but I got the error message below, do you know what went wrong ? (Please do not assume anything as for my programming skills, I am a beginner).
runcell(0, '/Users/arnaudcisse/Documents/bitcoinProg/plot_historic_sentiments.py')
Traceback (most recent call last):
File "/Users/arnaudcisse/Documents/bitcoinProg/plot_historic_sentiments.py", line 118, in <module>
main()
File "/Users/arnaudcisse/Documents/bitcoinProg/plot_historic_sentiments.py", line 113, in main
candles_wrapper = get_historic_socials_sentiment(channel=channel, requests=requests)
File "/Users/arnaudcisse/Documents/bitcoinProg/plot_historic_sentiments.py", line 74, in get_historic_socials_sentiment
for candle in candle_stream:
File "/opt/anaconda3/lib/python3.7/site-packages/grpc/_channel.py", line 416, in __next__
return self._next()
File "/opt/anaconda3/lib/python3.7/site-packages/grpc/_channel.py", line 706, in _next
raise self
_MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "DNS resolution failed"
debug_error_string = "{"created":"@1592179915.372044000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3962,"referenced_errors":[{"created":"@1592179915.372039000","description":"Resolver transient failure","file":"src/core/ext/filters/client_channel/resolving_lb_policy.cc","file_line":214,"referenced_errors":[{"created":"@1592179915.372038000","description":"DNS resolution failed","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc","file_line":369,"grpc_status":14,"referenced_errors":[{"created":"@1592179915.371978000","description":"C-ares status is not ARES_SUCCESS: Domain name not found","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":254,"referenced_errors":[{"created":"@1592179915.371964000","description":"C-ares status is not ARES_SUCCESS: Domain name not found","file":"src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc","file_line":254}]}]}]}]}"
>
Hi,
I came across this wonderful project and wanted to try it out.
I have 2 questions:
What is the SERVER address? Sorry it's not clear from your docs
I am having issues running this python -m grpc_tools.protoc -I../ --python_out=. --grpc_python_out=. ../types.proto
. Here is my directory structure:
project_directory
|
src
Under project_directory, I have a src directory which holds all the source code. When I run the python -m grpc_tools.protoc -I../ --python_out=. --grpc_python_out=. ../types.proto
I get an error Could not make proto path relative: ../types.proto: No such file or directory
What do I need to do to address these 2 issues?
Cheers
Getting the above error when running this:
import grpc
import src.types_pb2
import src.types_pb2_grpc
from google.protobuf import timestamp_pb2
import time
import pandas as pd
SERVER_ADDRESS = 'apiv1.cryptomood.com:443'
PATH_TO_CERT_FILE = './cryptomood.pem'
def main():
# Create credentials for use with an secured channel
credentials = grpc.ssl_channel_credentials(open(PATH_TO_CERT_FILE, 'rb').read())
# uncomment commands below if token auth is required
call_credentials = grpc.access_token_call_credentials('YOUR_API_KEY')
credentials = grpc.composite_channel_credentials(credentials, call_credentials)
channel = grpc.secure_channel(SERVER_ADDRESS, credentials)
# create stub
stub = types_pb2_grpc.HistoricDataStub(channel)
now = time.time()
seconds = int(now)
to_time = timestamp_pb2.Timestamp(seconds=seconds)
from_time = timestamp_pb2.Timestamp(seconds=to_time.seconds - int(86400 / 2)) # last 12 hours
# in our case we have to use kwarg because `from` is
# is recognized as python keyword so there would syntax be error
# if you want get value you have to use getattr()
historic_request_kwargs = {'from': from_time, 'to': to_time, 'filter': { 'all_assets': True}}
req = types_pb2.HistoricRequest(**historic_request_kwargs)
tweet_stream = stub.HistoricTweets(req)
# dataframe inputs
inputs = []
for tweet in tweet_stream:
# tweet attributes are defined in proto file
author_name = tweet.extended_tweet.author_name
content = tweet.base.content
sentiment = tweet.sentiment.sentiment
inputs.append([author_name, content, sentiment])
df = pd.DataFrame(inputs, columns=['User', 'Content', 'Sentiment'])
print(df)
if __name__ == '__main__':
main()
i'm getting errors when trying to run you python Examples such as client.py. May you explain how to resolve this?
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses"
debug_error_string = "{"created":"@1634662711.250468000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3159,"referenced_errors":[{"created":"@1634662711.250462000","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":147,"grpc_status":14}]}"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.