Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
pyrtfolio is a Python package created based on investpy data which aims to create custom stock portfolios. In investment, a portfolio is a grouping of financial assets as well as their fund counterparts; note that a portfolio can also consist of non-publicly tradable securities. So on, investpy data will be used to create custom portfolios from the data provided by the user such as the asset symbol, purchase date, number of bought shares, etc.
In order to get this package working you will need to install pyrtfolio via pip by typing the following command in the terminal:
$ pip install pyrtfolio==0.4
Every package used is listed in requirements.txt file, which can also be installed via pip:
$ pip install -r requirements.txt
Currently, pyrtfolio can just be used for generating stock portfolios, so on, an example is proposed below
which creates a new portfolio and adds some equities/stocks. Note that the returned portfolio is a :obj:pandas.DataFrame
,
but the package is intended to generate either a CVS or a XLSX file.
from pyrtfolio.StockPortfolio import StockPortfolio
portfolio = StockPortfolio()
portfolio.add_stock(stock_symbol='BBVA',
stock_country='spain',
purchase_date='04/01/2018',
num_of_shares=2,
cost_per_share=7.2)
portfolio.add_stock(stock_aymbol='ELE',
stock_country='spain',
purchase_date='13/06/2019',
num_of_shares=15,
cost_per_share=23.8)
print(portfolio.data)
stock_symbol stock_name stock_country stock_currency purchase_date num_of_shares ... current_price gross_current_value total_dividends net_current_value total_gain_loss total_gain_loss_percentage
0 BBVA BBVA spain EUR 04/01/2018 2 ... 4.716 9.432 5.8788 15.3108 0.9108 0.06325%
1 ELE Endesa spain EUR 13/06/2019 15 ... 23.500 352.500 326.0250 678.5250 321.5250 0.9006302521008402%
As this is an open source project it is open to contributions, bug reports, bug fixes, documentation improvements, enhancements and ideas.
Also there is an open tab of issues where anyone can contribute opening new issues if needed or navigate through them in order to solve them or contribute to its solving. Remember that issues are not threads to describe multiple issues, this does not mean that issues can't be discussed, but if new issues are reported, a new issue should be open so to keep a structured project management.
FAQs
pyrtfolio - Python package to generate stock portfolios
We found that pyrtfolio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.