mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 07:16:40 +00:00
Merge branch 'random-housecleaning' into 'master'
Archive the Bot See merge request simple-stock-bots/simple-stock-bot!65
This commit is contained in:
commit
3ff582d095
@ -27,7 +27,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"postCreateCommand": "pip3 install --user -r dev-reqs.txt && apt-get update && apt-get install -y nodejs npm && npm install"
|
"postCreateCommand": "pip3 install --user -r dev-reqs.txt && apt-get update && apt-get install -y nodejs npm --fix-missing && npm install"
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
// "features": {},
|
// "features": {},
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
@ -3,25 +3,19 @@ stages:
|
|||||||
- build_site
|
- build_site
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
black:
|
# ruff:
|
||||||
stage: lint
|
# stage: lint
|
||||||
image: registry.gitlab.com/pipeline-components/black:latest
|
# image: python:3.11-slim
|
||||||
script:
|
# script:
|
||||||
- black --check --verbose -- .
|
# - pip3 install ruff
|
||||||
|
# - ruff . --output-format gitlab; ruff format . --diff
|
||||||
|
|
||||||
ruff:
|
# prettier:
|
||||||
stage: lint
|
# stage: lint
|
||||||
image: python:3.11-slim
|
# image: node:16-slim # Use Node.js image since prettier is a Node.js tool
|
||||||
script:
|
# script:
|
||||||
- pip3 install ruff
|
# - npm install prettier
|
||||||
- ruff --output-format gitlab .
|
# - npx prettier --check . # Adjust the path as needed
|
||||||
|
|
||||||
prettier:
|
|
||||||
stage: lint
|
|
||||||
image: node:16-slim # Use Node.js image since prettier is a Node.js tool
|
|
||||||
script:
|
|
||||||
- npm install prettier
|
|
||||||
- npx prettier --check . # Adjust the path as needed
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- local: /site/.gitlab-ci.yml
|
- local: /site/.gitlab-ci.yml
|
||||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -3,7 +3,7 @@
|
|||||||
"editor.formatOnPaste": true,
|
"editor.formatOnPaste": true,
|
||||||
"editor.formatOnSaveMode": "modificationsIfAvailable",
|
"editor.formatOnSaveMode": "modificationsIfAvailable",
|
||||||
"[python]": {
|
"[python]": {
|
||||||
"editor.defaultFormatter": "ms-python.black-formatter",
|
"editor.defaultFormatter": "charliermarsh.ruff",
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.formatOnSaveMode": "file"
|
"editor.formatOnSaveMode": "file"
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import pytz
|
|||||||
import requests as r
|
import requests as r
|
||||||
import schedule
|
import schedule
|
||||||
|
|
||||||
|
|
||||||
from common.Symbol import Stock
|
from common.Symbol import Stock
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -104,7 +105,7 @@ class MarketData:
|
|||||||
return self.symbol_list.get(symbol.upper(), None)
|
return self.symbol_list.get(symbol.upper(), None)
|
||||||
|
|
||||||
def get_symbol_list(self):
|
def get_symbol_list(self):
|
||||||
# Doesn't use `self.get`` since needs are much different
|
# Doesn't use `self.get()` since needs are much different
|
||||||
sec_resp = r.get(
|
sec_resp = r.get(
|
||||||
"https://www.sec.gov/files/company_tickers.json",
|
"https://www.sec.gov/files/company_tickers.json",
|
||||||
headers={
|
headers={
|
||||||
@ -229,7 +230,11 @@ class MarketData:
|
|||||||
|
|
||||||
if data := self.get(
|
if data := self.get(
|
||||||
f"stocks/candles/{resolution}/{symbol}",
|
f"stocks/candles/{resolution}/{symbol}",
|
||||||
params={"from": startTime.timestamp(), "to": now.timestamp(), "extended": True},
|
params={
|
||||||
|
"from": startTime.timestamp(),
|
||||||
|
"to": now.timestamp(),
|
||||||
|
"extended": True,
|
||||||
|
},
|
||||||
):
|
):
|
||||||
data.pop("s")
|
data.pop("s")
|
||||||
df = pd.DataFrame(data)
|
df = pd.DataFrame(data)
|
||||||
|
@ -26,6 +26,9 @@ class Symbol:
|
|||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash(self.id)
|
||||||
|
|
||||||
|
|
||||||
class Stock(Symbol):
|
class Stock(Symbol):
|
||||||
"""Stock Market Object. Gets data from MarketData"""
|
"""Stock Market Object. Gets data from MarketData"""
|
||||||
|
@ -5,7 +5,6 @@ import pandas as pd
|
|||||||
import requests as r
|
import requests as r
|
||||||
import schedule
|
import schedule
|
||||||
from markdownify import markdownify
|
from markdownify import markdownify
|
||||||
|
|
||||||
from common.Symbol import Coin
|
from common.Symbol import Coin
|
||||||
from common.utilities import rate_limited
|
from common.utilities import rate_limited
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-r common/requirements.txt
|
-r common/requirements.txt
|
||||||
-r site/requirements.txt
|
-r site/requirements.txt
|
||||||
black==23.9.1
|
|
||||||
ipython==8.16.1
|
ipython==8.16.1
|
||||||
jupyter_client==8.4.0
|
jupyter_client==8.4.0
|
||||||
jupyter_core==5.4.0
|
jupyter_core==5.4.0
|
||||||
@ -8,5 +7,4 @@ pylama==8.4.1
|
|||||||
mypy==1.5.1
|
mypy==1.5.1
|
||||||
types-cachetools==5.3.0.6
|
types-cachetools==5.3.0.6
|
||||||
types-pytz==2023.3.1.1
|
types-pytz==2023.3.1.1
|
||||||
ruff==0.0.292
|
ruff==0.1.6
|
||||||
isort==5.12.0
|
|
@ -1,11 +1,2 @@
|
|||||||
[tool.black]
|
|
||||||
line-length = 130
|
|
||||||
|
|
||||||
[tool.flake8]
|
|
||||||
max-line-length = 130
|
|
||||||
|
|
||||||
[tool.pycodestyle]
|
|
||||||
max_line_length = 130
|
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 130
|
line-length = 130
|
14
site/docs/blog/posts/sunset.md
Normal file
14
site/docs/blog/posts/sunset.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
title: "Simple Bot End-of-Life"
|
||||||
|
date: 2024-05-12
|
||||||
|
tags: [Simple Stock Bot, Introduction, Telegram, Discord, Financial Insights]
|
||||||
|
authors: [Anson]
|
||||||
|
description: >
|
||||||
|
Simple Stock Bot is being sunset.
|
||||||
|
---
|
||||||
|
|
||||||
|
## What is Simple Stock Bot?
|
||||||
|
|
||||||
|
For full details see my full blog post: https://notes.ansonbiggs.com/simple-stock-bot-end-of-life/
|
||||||
|
|
||||||
|
I am shutting down Simple Stock Bot, a popular Telegram and Discord bot that provided live stock and cryptocurrency market data. The bot was created in 2018 after my group chat lost access to the Google Allo, which had integrated market data. The bot grew to 15,000 monthly active users, but maintaining the service has become challenging due to increasing data costs and changes to the Discord API. I really appreciate the community and everyone that has donated along the way, this has been a seriously great ride. The bot will soon no longer function on Telegram and Discord.
|
@ -11,12 +11,13 @@ nav:
|
|||||||
- Home: index.md
|
- Home: index.md
|
||||||
- Commands: commands.md
|
- Commands: commands.md
|
||||||
- Self-Host: host.md
|
- Self-Host: host.md
|
||||||
- Donate: donate.md
|
# - Donate: donate.md
|
||||||
- Contact: contact.md
|
- Contact: contact.md
|
||||||
- Blog: blog/index.md
|
- Blog: blog/index.md
|
||||||
|
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
|
custom_dir: overrides
|
||||||
language: en
|
language: en
|
||||||
features:
|
features:
|
||||||
- navigation.instant
|
- navigation.instant
|
||||||
@ -65,8 +66,8 @@ plugins:
|
|||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
- attr_list
|
- attr_list
|
||||||
- pymdownx.emoji:
|
- pymdownx.emoji:
|
||||||
emoji_index: !!python/name:materialx.emoji.twemoji
|
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
||||||
emoji_generator: !!python/name:materialx.emoji.to_svg
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
||||||
- admonition
|
- admonition
|
||||||
- pymdownx.details
|
- pymdownx.details
|
||||||
- pymdownx.superfences
|
- pymdownx.superfences
|
||||||
|
17
site/overrides/main.html
Normal file
17
site/overrides/main.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
<!-- Announcement bar -->
|
||||||
|
{% block announce %}
|
||||||
|
|
||||||
|
<div class="admonition danger" style="min-height: 20vh;">
|
||||||
|
<p class="admonition-title">This project is now archived!</p>
|
||||||
|
<p>
|
||||||
|
Please
|
||||||
|
<a href="/blog/2024/05/12/simple-bot-end-of-life/"
|
||||||
|
>click here for more information.</a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="" admoniton></div>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -1,4 +1,5 @@
|
|||||||
mkdocs-material==9.4.4
|
mkdocs-material==9.5.22
|
||||||
|
mkdocs-material-extensions==1.3.1
|
||||||
|
|
||||||
# Required for Social Cards
|
# Required for Social Cards
|
||||||
Pillow==10.0.1
|
Pillow==10.0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user