Package: scrilla
scrilla: A Financial Optimization Applicationscrillais an open-source financial analysis application written inPython. It can optimize portfolios, calculate statistics using a variety of methods and algorithms, generate graphical plots and much more. It uses historical data retrieved from various sources, such as the US Treasury RSS Feed, AlphaVantage, IEX and Quandl, to calibrate models.NOTE: None of the results ofscrillashould be interpretted as financial advice. All results assume past trends will continue indefinitely into the future, which is usually never the case in reality.DocumentationOverviewPackagesCoverageUnit TestsCode AnalysisPipelinesBranchStatuspypi/micro-updatepypi/micro-updatedevelop/mainQuick StartRefer to thedocumentationfor more detailed information on installation and usage.InstallationPyPi DistributionInstall the package with thePythonpackage manager,pipinstallscrillaThis will install a command line interface on your path under the namescrilla. Confirm your installation with with theversioncommand,scrillaversionYou may need to add your Python scripts/bin/to the $PATH if this command is not found.To keep the installation as minimal as possible, the base package does not include the GUI libraries. You can install the optional GUI dependency (PySide6) with,pipinstallscrilla[gui]Note, the GUI has a different CLI entrypoint, namely,scrilla-guiSourceIf you are developing, you can build from source.git clonetherepositoryand then from the root directory install the project dependencies and build the library,pip3install-rrequirements.txt
python3-mbuildcdinto the generated/dist/to manually install the packaged code,pip install scrilla-<major>.<minor>.<micro>-py3-none-any.whlConfigurationIn order to use this application, you will need to register for API keys withAlphaVantage,IEXandQuandl/Nasdaq. The program will need to be made aware of these keys somehow. The best option is storing these credentials in environment variables. You can add the following lines to your.bashrcprofile or corresponding configuration file for whatever shell you are using,exportALPHA_VANTAGE_KEY=<keygoeshere>exportQUANDL_KEY=<keygoeshere>exportIEX_KEY=<keygoeshere>You can also invoke the CLI functionstoreto store the credentials in the local installation/data/common/directory. To do so,scrillastore-key<key>-value<value>where<key>is one of the values:ALPHA_VANTAGE_KEY,QUANDL_KEYorIEX_KEY.<value>is the corresponding key itself given to you after registration. Obviously,<value>is case-sensitiveKeep in mind if using this method to store the API keys, the keys will be stored unencrypted in the local installation's/data/common/directory. The recommended method is storing the credentials in the environment.If no API keys are found through either of these methods, the application will raise an exception.NOTE: TheQuandl/Nasdaqkey is technically no required for the majority of the application to function, as interest rates are now retrieved directly from theUS TreasuryRSS feed. However, it is still recommended that you register for an API key, asQuandl/Nasdaqis still the only source of economic statistics, like GDP or inflation rates.Environment FileA sample environment file has been included in/env/.sample.env. To configure the application environment, copy this file into a new environment, adjust the values and load it into your session,cp./env/.sample.env./env/.env# adjust .env valuessource./env/.env# the values loaded into your session will now configure scrilla's execution environmentscrillarisk-profileGDLMTUsagePortfolio OptimizationThe following command will optimize a portfolio of consisting ofALLY,BX,GLD,BTCandETHover the specified date range and save the result to a JSON file,scrillaoptimize-portfolioALLYBXGLDBTCETH\-start<YYYY-MM-DD>\-end<YYYY-MM-DD>\-save<absolutepathtojsonfile>Efficient FrontierThe following command will calculaate the efficient frontier for a portfolio consisting ofSPY,GLDandUSOover the specified date range and save the result to a JSON file,scrillaefficient-frontierSPYGLDUSO\--start<YYYY-MM-DD>\--end<YYYY-MM-DD>\--save<absolutepathtojsonfile>The following command will generate a plot of this frontier in the return-volatility plane,scrillaplot-efSPYGLDUSO\--start<YYYY-MM-DD>\--end<YYYY-MM-DD>scrillahas lots of other functions. Seeusagefor more information.CloudTODOcurrently working on a DynamoDB-based cache and Dockerfiles for lambda functions wrapped around scrilla's main features. will update this section once everything is completed.