Code Monkey home page Code Monkey logo

Comments (8)

eprbell avatar eprbell commented on May 31, 2024

You need to use the development workflow:

Let me know if you need any more information.

from dali-rp2.

macanudo527 avatar macanudo527 commented on May 31, 2024

I tried that initially, but thought I had to do something different to get it to see the config ini file. When I typing either of the following, I get an error:

dali -s -o output -p test_ binance_config.ini
dail -s -o output -p test_ test_config.ini

This is the error:

ERROR: No plugin configuration found in config file. Exiting...

I interjected a print command into dali_main.py, so I know I'm running my cloned version. It just doesn't seem to want to read config files. I don't have much experience with Python dev environments like this, so there is a good chance I'm doing something wrong.

I have all the test files, so it should work.

from dali-rp2.

eprbell avatar eprbell commented on May 31, 2024

No worries, we'll figure it out. What is the name of the new plugin and where does it reside? Assuming it's binance.py and it sits in src/dali/plugin/input/rest/, you need to add a section to your .ini file that looks like this:

[dali.plugin.input.rest.binance]
account_holder = joe
api_key = <redacted...>
api_secret = <redacted...>

The key-value pairs must reflect the signature of the binance plugin constructor, which in this case would have to be:

    def __init__(
        self,
        account_holder: str,
        api_key: str,
        api_secret: str,
    ) -> None:

Let me know if the above makes sense.

from dali-rp2.

eprbell avatar eprbell commented on May 31, 2024

Put it another way, make sure of the following:

  • your plugin is named binance.py (or similar)
  • your plugin is in src/dali/plugin/input/rest
  • your plugin class is called InputPlugin and derives from AbstractInputPlugin (this is important, otherwise the plugin won't be found): class InputPlugin(AbstractInputPlugin):
  • your .ini file has a section called [dali.plugin.input.rest.binance], in which the value-pairs map 1-1 the parameters of the plugin constructors (in fact they are used to instantiate the plugin)

Could you paste here a redacted version of your .ini file (make sure to anonymize any personal information, like api_key, api_secret, etc.)?

from dali-rp2.

macanudo527 avatar macanudo527 commented on May 31, 2024

I'm pretty sure I did all that. This is the binance_com.py plugin file in the fork.

Here is the ini:

[dali.plugin.input.rest.binance_com]
account_holder = Neal
api_key = <<Redacted>>
api_secret = <<Redacted>>

from dali-rp2.

macanudo527 avatar macanudo527 commented on May 31, 2024

Ok, after some testing, it seems like I need to add the config directory to the command. The following works:

dali -s -o output -p test_ config/binance_config.ini

Do I need to add a path somewhere or is this default behavior?

from dali-rp2.

eprbell avatar eprbell commented on May 31, 2024

You do need the path to the config file, however you ran into some interesting unexpected behavior: if the .ini file isn't found the ConfigParser.read() function fails silently without raising an exception. I just learned that today when reading its documentation to find clues to what you were seeing. So you were getting ERROR: No plugin configuration found in config file. Exiting... instead of a File not found error. That was unexpected (and confusing) so I fixed it in the latest push. Now if the config file isn't found you get: Configuration file <config_file> not found. Thanks for reporting!

from dali-rp2.

macanudo527 avatar macanudo527 commented on May 31, 2024

No problems, thanks for patching that up. This issue has been resolved for me.

from dali-rp2.

Related Issues (20)

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.