https://github.com/chinchalinchin/scrilla

A python application that wraps around various financial APIs, calculates statistics and optimizes portfolio allocations.

https://github.com/chinchalinchin/scrilla

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary

Keywords

alphavantage finance government iex portfolio-optimization pyqt python quandl quantitative-finance scipy statistics trading

Keywords from Contributors

dice-roller medical-images archive-webpage rank medical-image-computing web-services weather station opendap hydrology
Last synced: 5 months ago · JSON representation

Repository

A python application that wraps around various financial APIs, calculates statistics and optimizes portfolio allocations.

Basic Info
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 1
  • Open Issues: 1
  • Releases: 6
Topics
alphavantage finance government iex portfolio-optimization pyqt python quandl quantitative-finance scipy statistics trading
Created about 5 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

scrilla: A Financial Optimization Application

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.

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.

Documentation

Coverage

Code Analysis

DeepSource
DeepSource

Pipelines

| Branch | Status | | ------ | ------ | | pypi/micro-update | CircleCI | | pypi/minor-update | CircleCI | | develop/main | CircleCI|

Quick Start

Refer to the documentation for more detailed information on installation and usage.

Installation

PyPi Distribution

Install the package with the Python package manager,

shell pip install scrilla

This will install a command line interface on your path under the name scrilla. Confirm your installation with with the version command,

shell scrilla version

You 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,

shell pip install scrilla[gui]

Note, the GUI has a different CLI entrypoint, namely,

shell scrilla-gui

Source

If you are developing, you can build from source. git clone the repository and then from the root directory install the project dependencies and build the library,

shell pip3 install -r requirements.txt python3 -m build

cd into the generated /dist/ to manually install the packaged code,

pip install scrilla-<major>.<minor>.<micro>-py3-none-any.whl

Configuration

In order to use this application, you will need to register for API keys with AlphaVantage, IEX and Quandl/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 .bashrc profile or corresponding configuration file for whatever shell you are using,

shell export ALPHA_VANTAGE_KEY=<key goes here> export QUANDL_KEY=<key goes here> export IEX_KEY=<key goes here>

You can also invoke the CLI function store to store the credentials in the local installation /data/common/ directory. To do so,

shell scrilla store -key <key> -value <value>

where <key> is one of the values: ALPHAVANTAGEKEY, QUANDL_KEY or IEX_KEY. <value> is the corresponding key itself given to you after registration. Obviously, <value> is case-sensitive

Keep 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: 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.

Environment File

A 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,

```shell cp ./env/.sample.env ./env/.env

adjust .env values

source ./env/.env

the values loaded into your session will now configure scrilla's execution environment

scrilla risk-profile GD LMT ```

Usage

Portfolio Optimization

The 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,

shell scrilla optimize-portfolio ALLY BX GLD BTC ETH \ -start <YYYY-MM-DD> \ -end <YYYY-MM-DD> \ -save <absolute path to json file>

Efficient Frontier

The 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,

shell scrilla efficient-frontier SPY GLD USO \ --start <YYYY-MM-DD> \ --end <YYYY-MM-DD> \ --save <absolute path to json file>

The following command will generate a plot of this frontier in the return-volatility plane,

shell scrilla plot-ef SPY GLD USO \ --start <YYYY-MM-DD> \ --end <YYYY-MM-DD>

scrilla has lots of other functions. See usage for more information.

Cloud

TODO

currently 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.

Owner

  • Name: Grant Moore
  • Login: chinchalinchin
  • Kind: user
  • Location: Cumberland, MD
  • Company: Booz Allen

A cage went searching for a bird.

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 1,746
  • Total Committers: 5
  • Avg Commits per committer: 349.2
  • Development Distribution Score (DDS): 0.14
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Grant Moore c****n@g****m 1,502
deepsource-autofix[bot] 6****] 218
grantmoore g****e@i****m 21
DeepSource Bot b****t@d****o 3
snyk-bot s****t@s****o 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 102
  • Average time to close issues: N/A
  • Average time to close pull requests: 19 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 85
  • Bot issues: 0
  • Bot pull requests: 102
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • deepsource-autofix[bot] (102)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 175 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 69
  • Total maintainers: 1
pypi.org: scrilla

a financial optimization program

  • Versions: 69
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 175 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 11.8%
Average: 16.8%
Stargazers count: 17.7%
Dependent repos count: 21.5%
Forks count: 22.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • PyHamcrest >=2.0.3
  • PySide2 >=5.15.2.1
  • PySide6 >=6.2.0
  • boto3 >=1.24.13
  • build >=0.6.0
  • coverage >=6.1.2
  • defusedxml >=0.7.1
  • holidays >=0.14.2
  • httmock >=1.4.0
  • matplotlib >=3.3.3
  • moto >=3.1.14
  • myst-parser >=0.15.2
  • numpy >=1.19.3
  • pdoc3 >=0.10.0
  • pytest >=6.2.5
  • pytest-qt >=4.1.0
  • pytest-xvfb >=2.0.0
  • python-dateutil >=2.8.2
  • requests >=2.25.0
  • scipy >=1.7.1
  • setuptools >=51.1.1
  • sphinx >=4.3.0
  • twine >=3.4.2
.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.circleci/Dockerfile docker
  • circleci/python latest build
pyproject.toml pypi