An inoffical package to communicate with the Parqet API.
Key Features • How To Use • Download • Credits • Related • License
The parqet-python package will use the Parqet API to gather information about public Portfolios. Available information includes:
- Portfolio name
- Portfolio value
- Gain gross / net
- Total invested
- List of activities and holdings
- and many more...
Install the package via pip. This will also install the dependency loguru for logging purposes.
# Install the package
$ pip install parqet
Create a Portfolio
object and get the name of the portfolio.
# Import the package
from parqet import Portfolio
# Create a portfolio object
portfolio = Portfolio("YOUR_PORTFOLIO_ID")
# Extract the portfolio name and print it
print(portfolio.get_name())
Note Your portfolio has to be set to public to access it via the API.
Full list of functions
Function Name | Description | Return Type | Example |
---|---|---|---|
get_name() | Returns the name of the portfolio. | str |
portfolio.get_name() returns "My Portfolio" |
get_value() | Returns the current value of the portfolio. | float |
portfolio.get_value() returns 6000.0 |
get_total_gain_gross() | Returns the total gross gain of the portfolio. | float |
portfolio.get_total_gain_gross() returns 1000.0 |
get_total_invested() | Returns the total amount invested in the portfolio. | float |
portfolio.get_total_invested() returns 5000.0 |
get_total_gain_net() | Returns the total net gain of the portfolio. | float |
portfolio.get_total_gain_net() returns 800.0 |
get_total_return_gross() | Returns the total gross return of the portfolio. | float |
portfolio.get_total_return_gross() returns 20.0 |
get_total_return_net() | Returns the total net return of the portfolio. | float |
portfolio.get_total_return_net() returns 16.0 |
get_fees() | Returns the total fees paid for the portfolio. | float |
portfolio.get_fees() returns 50.0 |
get_created_at() | Returns the date of the portfolio's creation. | str |
portfolio.get_created_at() returns "2023-05-25T20:45:04.802Z" |
get_holdings() | Returns a list of holdings in the portfolio. | list |
portfolio.get_holdings() returns [{...}] |
get_activities() | Returns a list of activities of the holdings in the portfolio. | list |
portfolio.get_activities() returns [{...}] |
If you don't want to install the package via pip, you can instead download the latest release of the sourcecode.
This software uses Loguru for logging.
GPL
GitHub @JoghurtSommelier ·