Saravanan666/pypi-org huggingface dataset:
Package: portfolio-backtest
portfolio-backtestportfolio-backtest is a python library for backtest portfolio asset allocation on Python 3.7 and above.Installation$ pip install portfolio-backtest
$ pip install PyPortfolioOptUsagebasic runfromportfolio_backtestimportBacktestBacktest(tickers=["VTI","AGG","GLD"]).run()advanced runfromportfolio_backtestimportBacktestimportpprintbt=Backtest(tickers={"VTI":0.6,"AGG":0.25,"GLD":0.15,},target_return=0.1,target_cvar=0.025,data_dir="data",start="2011-04-10",end="2021-04-10",)pprint.pprint(bt.run(plot=True))[{'Annual volatility':'10.9%','Conditional Value at Risk':'','Cumulative Return':'160.9%','Expected annual return':'9.6%','Sharpe Ratio':'0.70','portfolio':'Your Portfolio','tickers':{'AGG':0.25,'GLD':0.15,'VTI':0.6}},{'Annual volatility':'6.3%','Conditional Value at Risk':'','Cumulative Return':'102.3%','Expected annual return':'7.0%','Sharpe Ratio':'0.79','portfolio':'Tangency Portfolio','tickers':{'AGG':0.67099,'GLD':0.0,'VTI':0.32901}},{'Annual volatility':'4.3%','Conditional Value at Risk':'','Cumulative Return':'53.3%','Expected annual return':'4.3%','Sharpe Ratio':'0.53','portfolio':'Minimum Variance Portfolio','tickers':{'AGG':0.91939,'GLD':0.00525,'VTI':0.07536}},{'Annual volatility':'4.0%','Conditional Value at Risk':'','Cumulative Return':'48.7%','Expected annual return':'4.1%','Sharpe Ratio':'0.51','portfolio':'Hierarchical Risk Parity Portfolio','tickers':{'AGG':0.89041,'GLD':0.05695,'VTI':0.05263}},{'Annual volatility':'','Conditional Value at Risk':'0.5%','Cumulative Return':'52.1%','Expected annual return':'4.2%','Sharpe Ratio':'','portfolio':'Minimum CVaR Portfolio','tickers':{'AGG':0.93215,'GLD':0.0,'VTI':0.06785}},{'Annual volatility':'7.7%','Conditional Value at Risk':'','Cumulative Return':'166.5%','Expected annual return':'10.0%','Sharpe Ratio':'1.04','portfolio':'Semi Variance Portfolio (target return 10.0%)','tickers':{'AGG':0.39504,'GLD':0.0,'VTI':0.60496}},{'Annual volatility':'','Conditional Value at Risk':'2.5%','Cumulative Return':'251.3%','Expected annual return':'13.3%','Sharpe Ratio':'','portfolio':'Return Maximize CVaR Portfolio (target CVaR 2.5%)','tickers':{'AGG':0.08851,'GLD':0.0,'VTI':0.91149}}]Provides a method (discrete_allocation) that can be converted into an actual allocation available for purchase by entering the latest price and desired portfolio size ($ 10,000 in this example)fromportfolio_backtestimportBacktestbt=Backtest(tickers={"VTI":0.6,"AGG":0.25,"GLD":0.15,})print(bt.discrete_allocation(total_portfolio_value=10000)){'Discrete allocation':{'VTI':28,'AGG':21,'GLD':9},'Funds remaining':'$109.45'}Supported PortfolioYour PortfolioHierarchical Risk Parity PortfolioTangency PortfolioMinimum Variance PortfolioMinimum CVaR PortfolioSemi Variance PortfolioReturn Maximize CVaR Portfolio
Package: portfoliofinder
Porfolio FinderA Python library, based primarily aroundpandas,
to identify an optimal portfolio allocation through back-testing.API Documentationis available on Read the Docs.Example UsageEach of these examples make use ofdata.csvwhich provides returns for a
handful of funds over 1970-2019.Find best portfolio allocation to minimize the required timeframe to achieve a target valuefromportfoliofinderimportAllocationsAllocations(0.05,['USA_TSM','WLDx_TSM','USA_INT','EM'])\.filter('USA_TSM>=0.6 & WLDx_TSM<=0.2 & USA_INT>=0.3')\.with_returns("data.csv")\.with_regular_contributions(100000,10000)\.get_backtested_timeframes(target_value=1000000)\.get_statistics(['min','max','mean','std'])\.filter_by_min_of('max')\.filter_by_max_of('min')\.get_allocation_which_min_statistic('std')OutputStatistic
min     14.000000
max     22.000000
mean    16.965517
std      2.809204
Name: Allocation(USA_TSM=0.65, WLDx_TSM=0.0, USA_INT=0.3, EM=0.05), dtype: float64Find best portfolio allocation to maximize value with minimal risk over a fixed timeframefromportfoliofinderimportAllocationsAllocations(0.05,['USA_TSM','WLDx_TSM','USA_INT','EM'])\.filter('USA_TSM>=0.6 & WLDx_TSM<=0.2 & USA_INT>=0.3')\.with_returns("data.csv")\.with_regular_contributions(100000,10000)\.get_backtested_values(timeframe=10)\.get_statistics(['mean','std'])\.filter_by_gte_percentile_of(90,'mean')\.get_allocation_which_min_statistic('std')OutputStatistic
mean    446560.590088
std     117448.007302
Name: Allocation(USA_TSM=0.6, WLDx_TSM=0.0, USA_INT=0.3, EM=0.1), dtype: float64Graph statistics from multiple portfolio allocations to visualize their efficient frontierfromportfoliofinderimportAllocationsAllocations(0.05,['USA_TSM','WLDx_TSM','USA_INT','EM'])\.filter('USA_TSM>=0.2 & USA_INT>=0.2')\.with_returns("data.csv")\.with_regular_contributions(100000,10000)\.get_backtested_values(timeframe=10)\.get_statistics()\.graph('std','mean')Output
Package: portfolio-manager
portfolio-managerA simple tool for tracking and analysing the performance of investment portfolios.Features and UsageThis package provides the user with the functionality to make deposits and withdrawals
of funds into one or more investment portfolios. The overall value of the portfolios
can be updated over time based on the market value of the underlying assets, and these
transactions are logged and saved.The package also contains various methods for calculating the rate of return of the
user’s portfolios. These methods include a simple percentage return calculator and a
more sophisticated time-weighted return calculator.Example usage of the package can be found in the Jupyter Notebooks within
portfolio-manager/notebooks, in the GitHub repo (link below).InstallationThe source code is currently hosted on GitHub at:https://github.com/J-Curwell/portfolio-managerBinary installers for the latest released version are available at thePython
Package Index (PyPI).# PyPIpipinstallportfolio-managerLicenseMIT license
Package: portfolios
Portfolio Optimization ExperimentsI've been interested in finance for a long time, but I've never had the
opportunity to learn about it in a structured way. This idea came to me
after a twitter mutual mentioned that french state pensions had to be better
in terms of revenue for middle class people compared to S&P 500. I was curious
about how to compare the two, and I started to learn about financial concepts
such as volatility, risk, and return. I also wanted to learn about how to compare
metrics such as the IRR via the Sharpe ratio, and how to compare risk-free assets
such as french pensions to risky assets such as S&P 500.The experiments can be found onGitHub,
and the results are published in sections ofmy optimization book(which is also open source).Main tools (for now)PandasNumpyCVXPYPlotlyUpcoming experimentsModel the french pension system as an asset & compare it to S&P 500Estimate risk aversion from historical dataCalculate the tradeoff curve for the french pension systemContributorsArnoMax
Package: portfolio-stats
PortfolioStatsA python class to compute key portfolio statistics for assets based on their price data.IntroductionPortfolioStatsprovides an organized method to calculate and view various portfolio metrics such as the Sharpe Ratio, cumulative returns, annualized returns, annualized volatility, and maximum drawdown.Parametersreturns(pd.DataFrame): Return data for assets.log(bool): Indicator to use logarithmic returns. Default isFalse.annualization_factor(int): Factor to annualize returns and risk. Default is252(number of trading days in a year).CalculationsSharpe Ratio$$\frac{E\bigl[r\bigl] \times A}{\sigma{\bigl[r\bigl]} \times \sqrt{A}}$$Where:$E\bigl[r\bigl]$ is the expected return of the asset.$\sigma{\bigl[r\bigl]}$ is the standard deviation (risk) of the returns.Cumulative ReturnsUsing simple returns:
$$\text{Cumulative Return} = \prod^T_{i=1}(1+r_{i}) - 1$$Using logarithmic returns:
$$\text{Cumulative Return} = \sum^T_{i=1} r_{i}$$Annualized Return$$\text{Annualized Return} = E\bigl[r\bigl] \times \text{ }A$$Annualized Volatility$$\text{Annualized Volatility} = \sigma{\bigl[r\bigl]} \times \sqrt{A}$$Maximum DrawdownUsing simple returns:$$\text{MDD} = \min \left( \frac{\text{CR}{\text{trough}}}{\text{CR}{\text{peak}}} - 1 \right)$$Using logarithmic returns:$$\text{MDD} = \min \left( \text{CLR} - \text{CLR (max up to now)} \right)$$Where:$\text{CR}$ is the cumulative simple return series.$\text{CLR}$ is the cumulative logarithmic return series.UsageInitialize the class with return data and optional parameters. Access the.infoattribute to view the calculated portfolio statistics.
Package: portfoliotools
=====
PortfoliotoolsPortfoliotools is a python utility to perform stock/index/mutual fund screening analytics.Detailed documentation is in the "docs" directory.Quick startpip install --upgrade git+git://github.com/rahulspsec/portfoliotools.gitLoad Jupyter Notebooks to see the usage.https://github.com/rahulspsec/JupyterNB_PortfolioTools
Package: portfolio-website
# portfolio website
<a href=”http://www.djangoproject.com/”><img src=”https://www.djangoproject.com/m/img/badges/djangoproject120x25.gif” border=”0” alt=”A Django project.” title=”A Django project.” /></a> [![CircleCI](https://circleci.com/gh/Muchogoc/portfolio/tree/master.svg?style=svg)](https://circleci.com/gh/Muchogoc/portfolio/tree/master)Simple project for learning django and devops for backend development
Package: portfolyo
Portfolyo is a Python package to analyse and manipulate timeseries related to power
and gas offtake portfolios.InstallationpipinstallportfolyoNB: this package is under active development and the API will change without prior notice. To ensure your code will continue to work, pin the version number that you install:pipinstallportfolyo==x.y.z# or, in pyproject.tomlportfolyo="x.y.z"DocumentationDocumentation is hosted on readthedocs:https://portfolyo.readthedocs.io/RepositoryThe git repository is hosted on github:http://www.github.com/rwijtvliet/portfolyoDevelopingThis project usesblackto format code andflake8for linting. We also supportpre-committo ensure
these have been run. To configure your local environment please install these development dependencies and set up
the commit hooks.poetryinstall--withdev,testpre-commitinstallFeature branches are merged into thedevelopbranch via pull request.PublishingTo publish a new release fromdevelop, create a new branch, increment the version number and push to github. For convenience, there is acreate_release_branch.shscript that accomplishes the same, which takes one argument:create_release_branch.shmajor# or minor, or patch, or specific version numberThen, from the github website, the release can be published by clicking the “tags” button. Be sure to select the correct branch.When done, merge the release branch intodevelopandmain, also via pull request, and delete it.
Package: portformer
Portformer: Portfolios. Made Better.Welcome to the documentation for the wrapper for of Portformer’s APIhttps://analysis.portformer.com/docsThis is a product of Portformer by Astrocyte ResearchInstallportformeris released on PyPI, so all you need is:$pipinstallportformerTo upgrade to latest version:$pipinstall--upgradeportformerUsagefromportformerimportBreakpointAPIapi=BreakpointAPI(api_key="ENTER_YOUR_KEY")# Get the latest breakpoint risks and forecasts for TSLAbreakpoint_forecast=api.forecast("TSLA")Development$# create venv$virtualenv-ppython3.8venv$# Install$pipinstall-rrequirements.txt$pipinstall-rrequirements-dev.txt$pipinstall-e.Test$python./tests/all.pyBuild$python3-mpipinstall--user--upgradesetuptoolswheel$python3setup.pysdistbdist_wheel
Package: portforward
Easy Kubernetes Port-Forward For PythonFree software: MIT licenseDocumentation:https://portforward.readthedocs.io.InstallationWheels are available for:WindowsMacOS XLinuxwith Python versions:3.73.83.93.103.11and architectures:x84_64arm64 (known as M1/Apple Chip - MacOS only)Requirements for installation from sourceThe following things are required when there is no wheel available for the target system.Rustinstalled and available in the path (https://www.rust-lang.org/tools/install)Python(at least v3.7 - below was never tested but might work)Pip knows how to installportforward.pip install portforwardQuickstartimportrequestsimportportforwarddefmain():namespace="test"pod_name="web"# You can also use a service name insteadlocal_port=9000# from portpod_port=80# to port# No path to kube config provided - will use default from $HOME/.kube/configwithportforward.forward(namespace,pod_name,local_port,pod_port):response=requests.get("http://localhost:9000")print(f"Done:\n'{response.status_code}'\n'{response.text[:20]}...'")if__name__=="__main__":main()FeaturesNative Kubernetes port-forwarding with the.kube/configfrom the home dir
or any other path to config.Portforward for pods and services - the lib will first look for a pod with matching name then for
a serviceWaiting for a pod to become readyMultiple forwards per pod or serviceAs context manager, sync or async clientDevelopmentIn case you want to develop on this library itself please take a look at the CONTRIBUTING page.CreditsThis project is enabled byPyO3.
Package: port-forward-manager
Port Forward Manager (PFM)PFM allows quick and easy management of ports forwarded over SSH (local or remote).Installation# Install tmux
brew install tmux
# Install python poetry https://python-poetry.org/docs/
brew install poetry
or
curl -sSL https://install.python-poetry.org | python3 -

# Install PFM
pip install --upgrade port-forward-managerSettings file is stored in ~/.ssh/pfm.settings.yamlConfigure autocompleteAdd to end of ~/.zshrcfpath+=~/.zfunc

autoload -Uz compinit
compinit
zstyle ':completion:*' menu selectGenerate autocomplete configurationpfm --install-completion
source .zshrcAboutSettingsPFM will automatically generate a default configuration file and update new settings to their default values.show_schema_linkToggle the ability to show/hide the schema when showing the list of schemas.wait_after_startHow long, in seconds, to wait after starting sessions.table_borderToggle the table bordershow_pidToggle the screen PIDExample settings file:schemas:
    local_proxy:
      - hostname: some.proxy.host
        remote_port: 8888
        type: local
    remote-server:
      - hostname: example.host
        local_port: 1234
        remote_port: 8080
        type: local
      - hostname: example.host
        local_port: 8888
        remote_port: 8888
        type: local
show_pid: 'false'
show_schema_link: 'false'
table_border: 'true'
wait_after_start: '0.5'
wait_after_stop: 0.5CommandsconfigShow active sessionsforwardStart a forwarding sessionschemasList configured schemasshutdownStop all active sessionsstartStart a schema of forwarding sessionsstatusShow active sessionsstopStop sessions from active schema, host or port
###version
Show installed versionDevelopmentSetup development environmentgit clone git@github.com:kxiros/port-forward-manager.git
cd port-forward-manager
poetry shell
poetry installBuilding python packagepython -m buildTo Install development version:pip install -e cloned_directory_pathRelease#Example to github
gh release create 1.3 dist/port-forward-manager-1.3.tar.gz -t "Minor fixes" --generate-notes

#Publish on Pypi
# Configure pypi token
# poetry config pypi-token.pypi <token>
poetry publish
Package: porthamiltonians
# porthamiltonians
Package for modelling port-Hamiltonian systems with neural networks as described in [(Eidnes et al. 2022)](https://arxiv.org/pdf/2206.02660.pdf).[Documentation available here](https://port-hamiltonian-neural-networks.readthedocs.io/en/latest/)porthamiltoniansphsystemsphnnsutilsphsystems implements classes and functionality for simulating port-Hamiltonian systems.
phnns implements classes and functionality for learning and inference with port-Hamiltonian neural networks.
Package: porthole-cmd
portholeSimple server reporting cpu and disk usage of os.Prerequistes.Linux environments.
Python 2.7 and above.How to use.Using pip---pypi distribution will be ready soon.Manual setupDownload distributes and extract and run.tar -xvf porthole-0.0.1.tar
cd porthole-0.0.1
python -m porthole.script serveServerRun porthole server to OS which desired to be monitored.pipporthole serve -host [host/default:""] -p [port/default:8000]Manual setuppython -m porthole.script serve -host [host/default:""] -p [port/default:8000]ClientFetch responseFetchporthole fetch -d [destination]
#OR
python -m porthole.script fetch -d [destination]TestTestporthole test -e [expr] -s [source] -d [destination]
#OR
python -m porthole.script test -e [expr] -s [source] -d [destination]Helpporthole -h
#OR
python -m porthole.script -h
Package: portiapy
PortiaPyA Python stub for Agriness Edge's Portia REST API.Getting StartedPrerequisitesarrow ^1.2.3pandas ^1.5.3plotly ^5.13.1python-dateutil ^2.8.2python-dotenv ^1.0.0pytz ^2022.7.1requests ^2.28.2Installingpip3 install portiapyExamplesThere are examples available inpt-brand en-us.You can start playing with theportiapypackage on a Jupyter or Jupyter Lab container by clicking at the Binder badges on the beginning of this readme.
Package: porticatolarcematorfa
A sample project that exists as an aid to thePython Packaging User Guide’sTutorial on Packaging and Distributing
Projects.This projects does not aim to cover best practices for Python project
development as a whole. For example, it does not provide guidance or tool
recommendations for version control, documentation, or testing.This is the README file for the project.The file should use UTF-8 encoding and be written usingreStructuredText. It
will be used to generate the project webpage on PyPI and will be displayed as
the project homepage on common code-hosting services, and should be written for
that purpose.Typical contents for this file would include an overview of the project, basic
usage examples, etc. Generally, including the project changelog in here is not
a good idea, although a simple “What’s New” section for the most recent version
may be appropriate.
Package: portier-python
Portier authentication Python helpersportier-pythonis a set of helpers that you can use to authenticate
your user withthe Portier Identity Provider.Issue trackerInstallationInstall the Python package:pip install portier-pythonInstall from the source code:source <your-venv>/bin/activate
git clone git@github.com:portier/portier-python.git
cd portier-python
pip install -e .ChangelogThis document describes changes between each past release.0.1.1 (2017-02-01)Moving to theportierGithub organization.0.1.0 (2017-02-01)Initial implementation with the portier helpers.ContributorsDan Callahan <dan.callahan@gmail.com>Mathieu Leplatre <mathieu@mozilla.com>Rémy Hubscher <rhubscher@mozilla.com>
Package: portinfo
# Portinfo PackageThis is very simple package that fetches service name by its port and vice versa.Service/Port data from [IANA](https://iana.org).## Install:### PIP:
pip install portinfo## Usage:` $ portinfo [Service Port | Service Name] `### Get service name by port` $ portinfo 5432 `Output:` postgresql (PostgreSQL Database) :5432 tcp postgresql (PostgreSQL Database) :5432 udp `### Get port by service name` $ portinfo redis `output:` redis (An advancedkey-valuecache and store) :6379 tcp `
Package: portinvartija
PortinvartijaPython implementation of interface operations for data driven topics.License: MIT|Country of origin: Switzerland|Export control classification number(ECCN): EAR99Third party dependencies are documented in the folderthird-party.DocumentationUser and developerdocumentation of portinvartija.Bug TrackerAny feature requests or bug reports shall go to thetodos of portinvartija.Primary Source repositoryThe main source ofportinvartijais on a mountain in central Switzerland.
We use distributed version control (git).
There is no central hub.
Every clone can become a new source for the benefit of all.
The preferred public clones ofportinvartijaare:on codeberg- a democratic community-driven, non-profit software development platform operated by Codeberg e.V.at sourcehut- a collection of tools useful for software development.ContributionsPlease do not submit "pull requests" (I found no way to disable that "feature" on GitHub).
If you like to share small changes under the repositories license please kindly do so by sending a patchset.
You can either send such a patchset per email usinggit send-emailor
if you are a sourcehut user by selecting "Prepare a patchset" on the summary page of your fork atsourcehut.SupportPlease kindly submit issues athttps://todo.sr.ht/~sthagen/portinvartijaor write plain text email to ~sthagen/portinvartija@lists.sr.htto submit patches and request support. Thanks.StatusExperimental.Note: The default branch isdefault.
Package: portio
PortIO is a Python front end to the low level functions provided by the
C library on Linux 386 platforms for the hardware input and output ports:
outb, outw, outl, outsb, outsw, outsl, outb_p, outw_p, outl_p, inb, inw,
inl, insb, insw, insl, inb_p, inw_p, inl_p, ioperm, iopl.Before doing port I/O, it is mandatory to acquire proper privileges by
calling ioperm or iopl. Otherwise you will get a segmentation fault.outb (data,port)Output the byte data to the I/O address port.outb_p (data,port)The same as outb, but waits for I/O completion.outw (data,port)Output the 16 bit word data to the I/O address port.outw_p (data,port)The same as outw, but waits for I/O completion.outl (data,port)Output the 32 bit word data to the I/O address port.outl_p (data,port)The same as outl, but waits for I/O completion.outsb (port,data,count)Repeat count times the output of a byte to the I/O address port,
reading it from buffer of bytes starting at data and with length
count.outsw (port,data,count)Repeat count times the output of a 16 bit word to the I/O address
port, reading it from buffer of 16 bit words starting at data and
with length count x 2.outsl (port,data,count)Repeat count times the output of a 32 bit word to the I/O address
port, reading it from buffer of 32 bit words starting at data and
with length count x 4.inb (port)Input a byte from the I/O address port and return it as integer.inb_p (port)The same as inb, but waits for I/O completion.inw (port)Input a 16 bit word from the I/O address port and return it as integer.inw_p (port)The same as inw, but waits for I/O completion.inl (port)Input a 32 bit word from the I/O address port and return it as integer.inl_p (port)The same as inl, but waits for I/O completion.insb (port,data,count)Repeat count times the input of a byte from the I/O address port
and write it to a buffer of bytes starting at data and with length
count bytes.insw (port,data,count)Repeat count times the input of a 16 bit word from the I/O address
port and write it to a buffer of 16 bit words starting at data
and with length count x 2 bytes.insl (port,data,count)Repeat count times the input of a 32 bit word from the I/O address
port and write it to a buffer of 32 bit words starting at data
and with length count x 4 bytes.ioperm (from,extent,enable)Set port access permission starting from address from for extent
bytes. If the enable is True, access is enabled, otherwise is disabled.
On success, zero is returned. On error, the errno code is returned.
The use of ioperm requires root privileges.Only the first 0x3ff I/O ports can be specified in this manner. To gain
access to any I/O port in the whole (0x0000-0xffff) address range, use
the iopl function.iopl (level)Set the I/O privilege level of the current process. When level is 3
access is granted to any I/O port.
On success, zero is returned. On error, the errno code is returned.
The use of iopl requires root privileges.