Standalone
Standalone mode runs only the Python app. You must provide your own InfluxDB 3 instance (and Grafana, if you want dashboards) to build the stack described in the Design section.
If you don't already run InfluxDB and Grafana, prefer the Docker Compose stack.
Requirements
- Windows, Linux or macOS
- Python 3.10+
- uv (used to manage dependencies)
- A reachable InfluxDB 3 Core instance and an API token
Preparing steps
-
Download the source code from the latest release and extract it.
-
Install the dependencies from the
appfolder (uv creates an isolated.venvfrom the lockfile):
cd app
uv sync
- Write a
config.yaml(manual mode) — or asettings.yaml+events/directory (events mode) — following the configuration section, in the SuiviBourse config directory:
- Linux / macOS
- Windows
~/.config/SuiviBourse/
%APPDATA%\SuiviBourse\(falls back to%HOME%\AppData\RoamingifAPPDATAis undefined)
Manual mode resolves the config location through the confuse library, so other standard search paths are supported too.
Running the app
From the app folder, provide at least the InfluxDB token and run:
INFLUXDB_HOST=http://localhost:8181 \
INFLUXDB_TOKEN=<your-token> \
uv run gunicorn -c src/gunicorn.conf.py 'web:create_app()'
The app is served by gunicorn: the web API and the scheduler share a single
process, so there is one command and one process for both. gunicorn.conf.py
is the boot sequence — it binds the web port (SB_WEB_PORT, default 8080) and
the legacy /metrics port, and refuses to start with more than one worker.
Raise threads, never workers: each extra worker would run a second scraper
and duplicate every write.
For production, choose one of the following methods.
Replace <installation_path> with the folder where you extracted the project,
and <your-token> with your InfluxDB API token.
- SystemD (Linux)
- Cron (Linux + macOS)
- Windows Service
-
Create a service unit file in
/etc/systemd/system/suivi-bourse.service(replace<user>/<group>and the token):[Unit]Description=SuiviBourseAfter=network-online.target[Service]Type=simpleRestart=alwaysWorkingDirectory=<installation_path>/appExecStart=uv run gunicorn -c src/gunicorn.conf.py 'web:create_app()'User=<user>Group=<group>Environment=PYTHONUNBUFFERED=1Environment=INFLUXDB_HOST=http://localhost:8181Environment=INFLUXDB_TOKEN=<your-token>Environment=INFLUXDB_DATABASE=suivi_bourseSyslogIdentifier=suivi-bourse[Install]WantedBy=default.targetremarqueExecStartmust use an absolute path to theuvbinary (e.g./usr/local/bin/uv) — runwhich uvto find it. -
Reload systemd:
systemctl daemon-reload -
Enable the service at boot:
systemctl enable suivi-bourse -
Start the service:
systemctl start suivi-bourse
Logs go to /var/log/syslog; check the status with
systemctl status suivi-bourse.
Using cron and nohup, you can run the app at boot:
-
Edit your crontab:
crontab -e -
Add the following line (adjust the path and token):
@reboot cd <installation_path>/app && INFLUXDB_HOST=http://localhost:8181 INFLUXDB_TOKEN=<your-token> nohup uv run gunicorn -c src/gunicorn.conf.py 'web:create_app()' > $HOME/suivi-bourse.log 2>&1 &
The application logs will be written to $HOME/suivi-bourse.log.
A standalone run on macOS crashes as soon as a symbol is scraped: gunicorn
forks its worker, and libcurl's macOS-only initialisation (Curl_macos_init,
reached from curl_easy_init inside yfinance's HTTP backend) reads the system
proxy configuration through CoreFoundation, which is not safe in a process
forked without exec. Linux is unaffected — there is no Curl_macos_init
there. On macOS, run the stack with Docker instead.
This section is untested. Open a GitHub PR to complete it.
Environment variables
At minimum you must set the InfluxDB connection variables:
| Variable | Default | Description |
|---|---|---|
INFLUXDB_HOST | http://influxdb:8181 | InfluxDB 3 host URL |
INFLUXDB_TOKEN | (required) | InfluxDB API token |
INFLUXDB_DATABASE | suivi_bourse | InfluxDB database name |
SB_REGULAR_INTERVAL | 120 | Poll interval (seconds) while a symbol's market is open (closed markets sleep to the next open) |
SB_SCRAPING_INTERVAL | (deprecated) | Deprecated fallback for SB_REGULAR_INTERVAL (honored with a warning) |
SB_WEB_PORT | 8080 | Port for the web API and its /health endpoint |
SB_METRICS_PORT | 8081 | Port for the legacy Prometheus /metrics endpoint |
LOG_LEVEL | INFO | Logging level |
See the configuration overview for the full list.
Grafana dashboard
Point Grafana at your InfluxDB instance using an InfluxDB datasource in SQL query mode, then import the provisioned dashboard from the repository:
An example datasource definition is available in
grafana_provisioning/datasources/all.yml.
If you still rely on a Prometheus/Grafana stack, the app keeps exposing a legacy
/metrics endpoint. See Legacy Prometheus endpoint.