Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for FMP V4 API endpoint #11

Closed
ipl31 opened this issue Feb 19, 2021 · 6 comments
Closed

Support for FMP V4 API endpoint #11

ipl31 opened this issue Feb 19, 2021 · 6 comments

Comments

@ipl31
Copy link
Contributor

ipl31 commented Feb 19, 2021

I started to implement a few missing APIs here: https://github.com/ipl31/fmpsdk/tree/insider_trading But I realized that the current code expects all endpoints to be on the V3 endpoint. There are a bunch of things on the V4 endpoint now.

I can work on this if you don't have time to. But I would want some guidance on preferred implementations. One less intrusive idea might be to leave everything as is. Create a decorator for V4 API calls which would handle changing the base URL.

@daxm
Copy link
Owner

daxm commented Feb 19, 2021

I'd love to learn how. My Python skills are 'self taught' and I'm not that good of a programmer just yet. (You can probably tell.) :-)

I'm good either way.

  • A decorator would add an @ above the methods, yes?
  • We could also "pass" a variable indicating which BASE_URL to use. (Not my favorite idea though.)
  • We could have separate __return_json() methods. 1 for each BASE_URL used. (though we'd duplicate code I kind of like this idea so that if new versions need different entry parameters, or return different things, we could handle them within their own dedicated method.)

The line count of init.py is getting long. I'm thinking I should re-break up into multiple files. (If you look into the git history you'd see I had it like that at one time.) What do you think?

@ipl31
Copy link
Contributor Author

ipl31 commented Feb 19, 2021

I’ll play around with those ideas. I agree breaking up init into different files would be good.

@daxm
Copy link
Owner

daxm commented Feb 20, 2021

I've "added" a v4 method. (Basically I copied/pasted the __return_json() to a new method. I also renamed __return_json() to __return_json_v3() to match.

As an aside, I quickly (aka, didn't test) added all the new API endpoints and parameter changes found on the FMP API changelog page. We should be current but if you are inclined to test some of these that would be great!

I'm REALLY open to sharing maintenance of this SDK with people and I want to attribute those people. Do you know of an appropriate way to do this? (Maybe an attribution string in init.py?

@daxm daxm closed this as completed Feb 20, 2021
@ipl31
Copy link
Contributor Author

ipl31 commented Feb 21, 2021

@daxm cool, thanks for adding that. There is no standard way that I know of for attribution. Some projects maintain a list on their website or wiki. How about something in the README? Or the a different contributors file? I think putting it in the init.py could get a little unwieldy if you end up with a bunch contributors. I am happy to help maintain.

I can test the new methods out and get back to you.

@daxm
Copy link
Owner

daxm commented Feb 21, 2021 via email

@ipl31
Copy link
Contributor Author

ipl31 commented Feb 21, 2021

Ken Caruso ken@ipl31.net is fine. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants