{"id":15284548,"url":"https://github.com/chinchalinchin/scrilla","last_synced_at":"2025-04-12T23:35:20.792Z","repository":{"id":36992029,"uuid":"321198415","full_name":"chinchalinchin/scrilla","owner":"chinchalinchin","description":"A python application that wraps around various financial APIs, calculates statistics and optimizes portfolio allocations.","archived":false,"fork":false,"pushed_at":"2023-08-11T10:35:10.000Z","size":144182,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"develop/main","last_synced_at":"2025-04-12T23:35:05.061Z","etag":null,"topics":["alphavantage","finance","government","iex","portfolio-optimization","pyqt","python","quandl","quantitative-finance","scipy","statistics","trading"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/scrilla/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinchalinchin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-14T01:19:36.000Z","updated_at":"2023-11-29T23:16:10.000Z","dependencies_parsed_at":"2023-01-17T11:46:38.123Z","dependency_job_id":null,"html_url":"https://github.com/chinchalinchin/scrilla","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchalinchin%2Fscrilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchalinchin%2Fscrilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchalinchin%2Fscrilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchalinchin%2Fscrilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinchalinchin","download_url":"https://codeload.github.com/chinchalinchin/scrilla/tar.gz/refs/heads/develop/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alphavantage","finance","government","iex","portfolio-optimization","pyqt","python","quandl","quantitative-finance","scipy","statistics","trading"],"created_at":"2024-09-30T14:58:07.974Z","updated_at":"2025-04-12T23:35:20.768Z","avatar_url":"https://github.com/chinchalinchin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scrilla: A Financial Optimization Application\r\n\r\n_scrilla_ is an open-source financial analysis application written in **Python**. 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. \r\n\r\n**NOTE**: None of the results of _scrilla_ should be interpretted as financial advice. All results assume past trends will continue indefinitely into the future, which is usually never the case in reality.\r\n\r\n![](https://github.com/chinchalinchin/chinchalinchin/blob/main/assets/scrilla_gui_ii.png)\r\n\r\n\r\nDocumentation\r\n---\r\n- [Overview](https://chinchalinchin.github.io/scrilla/)\r\n- [Packages](https://chinchalinchin.github.io/scrilla/package/index.html)\r\n\r\nCoverage\r\n---\r\n- [Unit Tests](https://chinchalinchin.github.io/scrilla/coverage/index.html)\r\n\r\nCode Analysis\r\n---\r\n[![DeepSource](https://deepsource.io/gh/chinchalinchin/scrilla.svg/?label=active+issues\u0026show_trend=true\u0026token=tD25pyXAL4uIvrccqjlwzXIU)](https://deepsource.io/gh/chinchalinchin/scrilla/?ref=repository-badge)\u003cbr/\u003e\r\n[![DeepSource](https://deepsource.io/gh/chinchalinchin/scrilla.svg/?label=resolved+issues\u0026show_trend=true\u0026token=tD25pyXAL4uIvrccqjlwzXIU)](https://deepsource.io/gh/chinchalinchin/scrilla/?ref=repository-badge)\u003cbr/\u003e\r\n\r\nPipelines\r\n---\r\n| Branch | Status |\r\n| ------ | ------ |\r\n| pypi/micro-update | [![CircleCI](https://circleci.com/gh/chinchalinchin/scrilla/tree/pypi%2Fmicro-update.svg?style=svg)](https://circleci.com/gh/chinchalinchin/scrilla/tree/pypi%2Fmicro-update) |\r\n| pypi/minor-update | [![CircleCI](https://circleci.com/gh/chinchalinchin/scrilla/tree/pypi%2Fminor-update.svg?style=svg)](https://circleci.com/gh/chinchalinchin/scrilla/tree/pypi%2Fminor-update) |\r\n| develop/main | [![CircleCI](https://circleci.com/gh/chinchalinchin/scrilla/tree/develop%2Fmain.svg?style=svg)](https://circleci.com/gh/chinchalinchin/scrilla/tree/develop%2Fmain)| \r\n\r\n\r\n## Quick Start\r\n\r\nRefer to the [documentation](https://chinchalinchin.github.io/scrilla/) for more detailed information on installation and usage.\r\n\r\n## Installation\r\n\r\n### PyPi Distribution\r\n\r\nInstall the package with the \u003cb\u003ePython\u003c/b\u003e package manager,\r\n\r\n```shell\r\npip install scrilla\r\n``` \r\n\r\nThis will install a command line interface on your path under the name `scrilla`. Confirm your installation with with the `version` command,\r\n\r\n```shell\r\nscrilla version\r\n```\r\n\r\nYou may need to add your Python scripts _/bin/_ to the $PATH if this command is not found. \r\n\r\nTo keep the installation as minimal as possible, the base package does not include the GUI libraries. You can install the optional GUI dependency ([PySide6](https://pypi.org/project/PySide6/)) with,\r\n\r\n```shell\r\npip install scrilla[gui]\r\n```\r\n\r\nNote, the GUI has a different CLI entrypoint, namely,\r\n\r\n```shell\r\nscrilla-gui\r\n```\r\n\r\n### Source\r\n\r\nIf you are developing, you can build from source. `git clone` the [repository](https://github.com/chinchalinchin/scrilla) and then from the root directory install the project dependencies and build the library,\r\n\r\n```shell\r\npip3 install -r requirements.txt\r\npython3 -m build\r\n```\r\n\r\n`cd` into the generated \u003ci\u003e/dist/\u003c/i\u003e  to manually install the packaged code,\r\n\r\n```\r\npip install scrilla-\u003cmajor\u003e.\u003cminor\u003e.\u003cmicro\u003e-py3-none-any.whl\r\n```\r\n\r\n## Configuration\r\n\r\nIn order to use this application, you will need to register for API keys with [AlphaVantage](https://www.alphavantage.co), [IEX](https://iexcloud.io/) and [Quandl/Nasdaq](https://www.quandl.com/). 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 \u003ci\u003e.bashrc\u003c/i\u003e profile or corresponding configuration file for whatever shell you are using,\r\n\r\n```shell\r\nexport ALPHA_VANTAGE_KEY=\u003ckey goes here\u003e\r\nexport QUANDL_KEY=\u003ckey goes here\u003e\r\nexport IEX_KEY=\u003ckey goes here\u003e\r\n```\r\n\r\nYou can also invoke the CLI function `store` to store the credentials in the local installation \u003ci\u003e/data/common/\u003c/i\u003e directory. To do so,\r\n\r\n```shell\r\nscrilla store -key \u003ckey\u003e -value \u003cvalue\u003e\r\n```\r\n\r\nwhere `\u003ckey\u003e` is one of the values: **ALPHA_VANTAGE_KEY**, **QUANDL_KEY** or **IEX_KEY**. `\u003cvalue\u003e` is the corresponding key itself given to you after registration. Obviously, `\u003cvalue\u003e` is case-sensitive\r\n\r\nKeep in mind if using this method to store the API keys, the keys will be stored unencrypted in the local installation's \u003ci\u003e/data/common/\u003c/i\u003e directory. The recommended method is storing the credentials in the environment. \r\n\r\nIf no API keys are found through either of these methods, the application will raise an exception.\r\n\r\n**NOTE**: The **Quandl**/**Nasdaq** key is technically no required for the majority of the application to function, as interest rates are now retrieved directly from the **US Treasury** RSS feed. However, it is still recommended that you register for an API key, as **Quandl**/**Nasdaq** is still the only source of economic statistics, like GDP or inflation rates. \r\n\r\n### Environment File\r\n\r\nA 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,\r\n\r\n```shell\r\ncp ./env/.sample.env ./env/.env\r\n# adjust .env values\r\nsource ./env/.env\r\n# the values loaded into your session will now configure scrilla's execution environment\r\nscrilla risk-profile GD LMT \r\n```\r\n## Usage\r\n\r\n### Portfolio Optimization\r\n\r\nThe following command will optimize a portfolio of consisting of *ALLY*, *BX*, *GLD*, *BTC* and *ETH* over the specified date range and save the result to a JSON file,\r\n\r\n```shell\r\nscrilla optimize-portfolio ALLY BX GLD BTC ETH \\\r\n    -start \u003cYYYY-MM-DD\u003e \\\r\n    -end \u003cYYYY-MM-DD\u003e \\\r\n    -save \u003cabsolute path to json file\u003e \r\n```\r\n\r\n### Efficient Frontier\r\n\r\nThe following command will calculaate the efficient frontier for a portfolio consisting of *SPY*, *GLD* and *USO* over the specified date range and save the result to a JSON file,\r\n\r\n```shell\r\nscrilla efficient-frontier SPY GLD USO \\\r\n    --start \u003cYYYY-MM-DD\u003e \\\r\n    --end \u003cYYYY-MM-DD\u003e \\\r\n    --save \u003cabsolute path to json file\u003e\r\n```\r\n\r\nThe following command will generate a plot of this frontier in the return-volatility plane,\r\n\r\n```shell\r\nscrilla plot-ef SPY GLD USO \\\r\n    --start \u003cYYYY-MM-DD\u003e \\ \r\n    --end \u003cYYYY-MM-DD\u003e \r\n```\r\n\r\n_scrilla_ has lots of other functions. See [usage](https://chinchalinchin.github.io/scrilla/USAGE.html) for more information.\r\n\r\n\r\n## Cloud\r\n\r\nTODO\r\n\r\ncurrently 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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinchalinchin%2Fscrilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinchalinchin%2Fscrilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinchalinchin%2Fscrilla/lists"}