$ brew install lima docker docker-compose
$ echo 'export DOCKER_HOST=unix://$HOME/docker.sock' >> ~/.zshrc
$ . ~/.zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [pytest] | |
| log_cli=true | |
| log_level=NOTSET | |
| log_format=[%(levelname)-.1s] %(message)s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import yfinance as yf | |
| from datetime import datetime # To get the current date and time | |
| start_date = datetime(2011, 1, 1) | |
| end_date = datetime(2011, 5, 1) | |
| ticker = "MSFT" | |
| yf_ticker_obj = yf.Ticker(ticker) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # if this file is located in e.g. | |
| # my_project/src/get_project_root.py | |
| # it will return absolute path to the project root e.g. | |
| # /home/john/projects/my_project | |
| # If you have different structure - play with chaining '.parrent' | |
| def get_project_root() -> Path: | |
| return Path(os.path.dirname(os.path.realpath(__file__))).parent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import stat | |
| def _sig(st): | |
| """Create signatures of files without reading them. | |
| Can be used to determine if files are the same or not. | |
| Example: | |
| >>> s1 = _sig(os.stat(file_name)) | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires ghostscript installed. | |
| # - On MacOSX: brew install ghostscript | |
| # - On Windows: install binaries via https://www.ghostscript.com/ | |
| # | |
| # use PDFSETTINGS: '/default','/prepress','/printer','/ebook','/screen' | |
| # 0: default - almost identical to /screen | |
| # 1: prepress - high quality, color preserving, 300 dpi imgs | |
| # 2: printer - high quality, 300 dpi images | |
| # 3: ebook - low quality, 150 dpi images |
Function for visualization sample count on each step of filtering process
Requires plotly_express installed.
Create "stages" dict during the filtering process. At each stage of filtering add elements both to lists under "count" and "stage" keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [LOGGING] | |
| # Format style used to check logging format string. `old` means using % | |
| # formatting, `new` is for `{}` formatting,and `fstr` is for f-strings. | |
| logging-format-style=new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [tox] | |
| envlist = black,flake8,mypy,pytest,coverage | |
| skipsdist = true | |
| ; tox_pip_extensions was reported to fix the issue with wrong calculation of pytest coverage | |
| ; Run --recreate before running tox every time | |
| ;$ tox --recreate && tox | |
| ; https://stackoverflow.com/a/46968274/3247880 | |
| ;tox_pip_extensions_ext_venv_update = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add parent directory to path | |
| import sys; sys.path.insert(0, '..') |
