Giter Site home page Giter Site logo

api's People

Contributors

cryptomood avatar jancimertel avatar paprikadobi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

api's Issues

StatusCode.UNAVAILABLE

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'

Consider giving sentiment scores for BTC

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

API issue running plot_historic_sentiments.py

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}]}]}]}]}"
>

2 Issues

Hi,

I came across this wonderful project and wanted to try it out.
I have 2 questions:

  1. What is the SERVER address? Sorry it's not clear from your docs

  2. 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

AttributeError: 'HistoricDataStub' object has no attribute 'HistoricTweets'

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()

API Error

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}]}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.