portfolio-performance / portfolio

Track and evaluate the performance of your investment portfolio across stocks, cryptocurrencies, and other assets.
http://www.portfolio-performance.info
Eclipse Public License 1.0
2.77k stars 580 forks source link

[new] REST API for Portfolio Performance #2085

Open buchen opened 3 years ago

buchen commented 3 years ago

First experimental daft of a REST API for Portfolio Performance.

If you want to test it:

To request data:

Bildschirmfoto 2021-02-14 um 22 05 32 Bildschirmfoto 2021-02-14 um 22 05 20 Bildschirmfoto 2021-02-14 um 22 05 08
chrisaut commented 3 years ago

Wow, so are you going through with this? Full api for read/write?

This will be killer, I'm thinking run the server (app) in docker and the community can create a modern web UI.

polymeris commented 3 years ago

Fantastic. In my mind this is also a better way to get often requested features like embedded scripts: you can just run the script outside and call into pp's API.

To @chrisaut idea of dockerizing a headless version, I think one missing piece is to be able to set the token from the command line (or env var or similar), so that one never has to touch the Eclipse UI.

Now I only need to figure out how to compile this locally :grin:

marco-eckstein commented 3 years ago

A REST API would be great! I think for implementation, a Kotlin multiplatform project containing all model classes and serializers/deserializers would be ideal. This would be a separate project and probably also repository.

The main benefit is that REST API clients could be developed much easier: There would be no need to manually infer Kotlin/Java classes (+ JSON mapping) for a JVM client, Swift classes (+ JSON mapping) for an iOS client, or TypeScript definitions for a JavaScript client.

Kotlin multiplatform is in alpha stage and the documentation is lagging. However, given what JetBrains has achieved with Kotlin, I trust it will become very good. I have some limited experience with Kotlin multiplatform and Kotlin multiplatform / multi-format reflectionless serialization and might be able to offer some help. E.g., if you, @buchen, are willing to give it a try, I could set up a mini project for the given draft.

marco-eckstein commented 3 years ago

JTransaction uses double for amount and Double for shares. This is probably not ideal because of potential rounding errors. They should use BigDecimal in the JVM and a string in JSON. The Rest API of the exchange Binance usually uses strings for fractional numbers.

fugkco commented 3 years ago

@buchen Are there plans to expose full functionality as APIs? Certainly would be nice to expose them as endpoints (add/edit/delete security/account etc). I'd love to be able to host this on a raspberry pi or something and access it from any computer at home and/or my phone. At the moment it's not easy to sync this stuff across devices. This combined with headless mode (#1411) and a DB (#2216) would be great.

oxisto commented 2 years ago

Are there any plans update to update this branch? I am currently exploring to build a web UI based on the portfolio data from portfolio performance. For my prototype I am currently parsing the depot.xml, but it would of course be easier if I could directly access a running instance of portfolio performance.

Is there anything I can do to help progress this feature?

oxisto commented 2 years ago

So I tried to rebase this to the current master @ https://github.com/oxisto/portfolio/tree/rest-api. PP seems to start but unfortunately the Webserver itself is not started. The UI itself is working. Could it be that there is the plugin.xml missing from the server folder? I am not really familiar with how Eclipse PDE works :(

oxisto commented 2 years ago

So I tried to rebase this to the current master @ https://github.com/oxisto/portfolio/tree/rest-api. PP seems to start but unfortunately the Webserver itself is not started. The UI itself is working. Could it be that there is the plugin.xml missing from the server folder? I am not really familiar with how Eclipse PDE works :(

Update: I managed to get it running and currently working on the accounts and portfolio API.

dvett01 commented 1 year ago

Is the REST API something that is still being worked on? I would love to get started using the data in python and build a web dashboard.

JesusMtnez commented 1 year ago

Is this still going on? It would be a great feature! :rocket:

forReason commented 1 year ago

it would be lovely