https://github.com/rj/sharesight-custom-investment-price-updater
updates vg small cap price to sharesight
https://github.com/rj/sharesight-custom-investment-price-updater
Last synced: 2 months ago
JSON representation
updates vg small cap price to sharesight
- Host: GitHub
- URL: https://github.com/rj/sharesight-custom-investment-price-updater
- Owner: RJ
- Created: 2022-01-14T10:57:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-24T13:37:32.000Z (over 3 years ago)
- Last Synced: 2025-03-20T11:08:25.510Z (2 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sharesight price updater tool
Command-line tool to add price data for custom investments that aren't supported directly by sharesight.
* Uses [sharesight v3 API](https://portfolio.sharesight.com/api/3/overview) – you must ask their support for an API (v3) account.
* Requires your `CLIENT_SECRET` and `CLIENT_ID` to by set as environment variables.
* Written in rust.# Installation
* Install rust, and compile this project with `cargo build`.
* To run directly from this directory, use `cargo run` in place of the `sharesight` command in the below examples## Usage
```
$ sharesight --helpsharesight
Custom price updater for sharesight portfoliosUSAGE:
sharesightOPTIONS:
-h, --help Print help informationSUBCOMMANDS:
help Print this message or the help of the given subcommand(s)
list Lists custom investments, showing their name and IDs
update Adds a new price at a specific date for the given investment
scrape Try and scrape the price of a supported fund from the web
```### Listing your custom investments
(I only have one)
```
$ sharesight list
2256461 IE00B3X1NT05 Vanguard Global Small-Cap Index Fund GBP Acc
```### Adding a new price
```
$ sharesight update --helpsharesight-update
Adds a new price at a specific date for the given investmentUSAGE:
sharesight update [OPTIONS]ARGS:
The custom investment code, or internal sharesight ID if you pass --use-id
The date, formatted like YYYY-MM-DD
The price at this dateOPTIONS:
-h, --help Print help information
--use-id Identify the investment using the internal sharesight ID, not your custom code
```Eg:
```
$ sharesight update IE00B3X1NT05 2022-01-21 375.86
```or the same thing, using the internal sharesight id from the `--list` command:
```
$ sharesight update --use-id 2256461 2022-01-21 375.86
```
**NB this update request will fail if there is already a custom price set for the date you provide. Click the "Manage Prices" in the "Instrument Detail" box on the sharesight portfolio page for your investmentm to see what prices you have added, and delete one if you want to try re-adding with this tool.**## Custom price-scraper
There is exactly one built-in price fetcher which reads from the vanguard website for the above fund, because I need it for my portfolio.
It fetches the navPrice using a json request made by [this vanguard fund page](https://www.vanguardinvestor.co.uk/investments/vanguard-global-small-cap-index-fund-gbp-acc/price-performance).```
$ sharesight scrape --list
IE00B3X1NT05 Vanguard Global Small-Cap Index Fund$ sharesight scrape IE00B3X1NT05
IE00B3X1NT05 2022-01-21 375.8605
```...and assuming you have a custom investment in your sharesight portfolio with the same code, you can say this to update the price:
```
$ sharesight update $(sharesight scrape IE00B3X1NT05)
```