Metadata-Version: 2.1
Name: metastock
Version: 0.1.2
Summary: 
Author: wsl
Author-email: mr.vjcspy@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: annotated-types (>=0.5.0,<0.6.0)
Requires-Dist: arrow (>=1.2.3,<2.0.0)
Requires-Dist: attrs (>=23.1.0,<24.0.0)
Requires-Dist: certifi (>=2023.7.22,<2024.0.0)
Requires-Dist: charset-normalizer (>=3.2.0,<4.0.0)
Requires-Dist: click (>=8.1.7,<9.0.0)
Requires-Dist: colorama (>=0.4.6,<0.5.0)
Requires-Dist: contourpy (>=1.1.0,<2.0.0)
Requires-Dist: cycler (>=0.11.0,<0.12.0)
Requires-Dist: flask (>=2.3.3,<3.0.0)
Requires-Dist: fonttools (>=4.42.1,<5.0.0)
Requires-Dist: gunicorn (>=21.2.0,<22.0.0)
Requires-Dist: idna (>=3.4,<4.0)
Requires-Dist: jsonschema (>=4.19.0,<5.0.0)
Requires-Dist: jsonschema-specifications (>=2023.7.1,<2024.0.0)
Requires-Dist: kiwisolver (>=1.4.5,<2.0.0)
Requires-Dist: markdown-it-py (>=3.0.0,<4.0.0)
Requires-Dist: marshmallow (>=3.20.1,<4.0.0)
Requires-Dist: matplotlib (>=3.7.2,<4.0.0)
Requires-Dist: mdurl (>=0.1.2,<0.2.0)
Requires-Dist: mplfinance (>=0.12.10b0,<0.13.0)
Requires-Dist: numpy (>=1.25.2,<2.0.0)
Requires-Dist: packaging (>=23.1,<24.0)
Requires-Dist: pandas (>=2.0.3,<3.0.0)
Requires-Dist: pendulum (>=2.1.2,<3.0.0)
Requires-Dist: pika (>=1.3.2,<2.0.0)
Requires-Dist: pillow (>=10.0.0,<11.0.0)
Requires-Dist: pydantic (>=2.3.0,<3.0.0)
Requires-Dist: pydantic-core (>=2.6.3,<3.0.0)
Requires-Dist: pygments (>=2.16.1,<3.0.0)
Requires-Dist: pyparsing (>=3,<4)
Requires-Dist: pytest (>=7.4.0,<8.0.0)
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: python-json-logger (>=2.0.7,<3.0.0)
Requires-Dist: pytz (>=2023.3,<2024.0)
Requires-Dist: pytzdata (>=2020.1,<2021.0)
Requires-Dist: referencing (>=0.30.2,<0.31.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: rich (>=13.5.2,<14.0.0)
Requires-Dist: rpds-py (>=0.9.2,<0.10.0)
Requires-Dist: shellingham (>=1.5.3,<2.0.0)
Requires-Dist: simplejson (>=3.19.1,<4.0.0)
Requires-Dist: six (>=1.16.0,<2.0.0)
Requires-Dist: splunk-handler (>=3.0.0,<4.0.0)
Requires-Dist: termcolor (>=2.3.0,<3.0.0)
Requires-Dist: typer (>=0.9.0,<0.10.0)
Requires-Dist: typing-extensions (>=4.7.1,<5.0.0)
Requires-Dist: tzdata (>=2023.3,<2024.0)
Requires-Dist: urllib3 (>=2.0.4,<3.0.0)
Description-Content-Type: text/markdown

# Metastock

## Environment

Since **`poetry`** helps us manage environments, we no longer need to use Python virtualenv.

When creating a new project and using it with PyCharm, it will be fully integrated with the default mechanism. This will
create a new isolated environment in the `/.cache/pypoetry/` folder.

Lúc đó, chỉ còn trường hợp xảy ra là mình muốn thay đổi version của python. For more info,
visit [link](https://python-poetry.org/docs/managing-environments/)

```bash
pyenv install 3.9.8
pyenv local 3.9.8  # Activate Python 3.9 for the current project
poetry install
```

## Development

### PM2

In local development, we can use pm2 with command

```shell
pm2 start metastock/bin/start_consumer.py --log-date-format '' --interpreter=/home/wsl/.cache/pypoetry/virtualenvs/metastock-bq6tFdVW-py3.11/bin/python --instances 4 --max-memory-restart 1G -- --name=test_consumer
```

## Production

So far, the significant way is run by pm2. This is the best method that will not consume much time and resources
compared to building a Docker file or Kubernetes.

But, we need create a python file to call metastock module

Ex:

```shell
pm2 start metastock/start_consumer.py --log-date-format '' --interpreter=/home/wsl/.cache/pypoetry/virtualenvs/metastock-bq6tFdVW-py3.11/bin/python --instances 4 --max-memory-restart 1G -- --name=test_consumer
```



## Publish app

1. Increase version in `pyproject.toml`

2. Run publish command

   ```bash
   poetry publish --build
   ```

   

## Refer:

- Create a package https://typer.tiangolo.com/tutorial/package/
