6c431e8821
Key at data_dir.parent/.garmin_key — nginx serves location /data/ { alias /var/bincio/data/; } so
anything inside that dir is reachable. The key lives one level up at /var/bincio/.garmin_key,
outside nginx's reach.
Two-layer storage — garmin_creds.json holds the encrypted email+password (needed for re-login when
tokens expire); garmin_session/ holds the garth OAuth tokens in plain JSON (short-lived, not the
user's actual password).
test_login() — called by the connect endpoint before saving anything, so credentials are only
persisted if they actually work.
get_client() — tries the session first (fast, no network), falls back to full re-login
transparently. The caller never needs to think about whether the session is fresh.
92 lines
1.7 KiB
TOML
92 lines
1.7 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "bincio"
|
|
version = "0.1.0"
|
|
description = "Federated, open-source, self-hosted activity stats platform"
|
|
readme = "README.md"
|
|
requires-python = ">=3.12"
|
|
license = { text = "MIT" }
|
|
authors = [{ name = "Davide Brugali" }]
|
|
|
|
dependencies = [
|
|
# Parsing
|
|
"gpxpy>=1.6",
|
|
"fitdecode>=0.11",
|
|
"lxml>=5.0", # TCX (XML)
|
|
# Data
|
|
"pandas>=2.2",
|
|
# Config & CLI
|
|
"pyyaml>=6.0",
|
|
"click>=8.1",
|
|
"rich>=13.0", # pretty console output
|
|
# Schema validation
|
|
"jsonschema>=4.23",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
classifier = [
|
|
"scikit-learn>=1.5",
|
|
]
|
|
edit = [
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
]
|
|
serve = [
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
"bcrypt>=4.1",
|
|
]
|
|
strava = [
|
|
"requests>=2.32",
|
|
]
|
|
garmin = [
|
|
"garminconnect>=0.2",
|
|
"cryptography>=42.0",
|
|
]
|
|
dev = [
|
|
"pytest>=9.0",
|
|
"pytest-cov>=5.0",
|
|
"ruff>=0.9",
|
|
"mypy>=1.11",
|
|
"types-pyyaml",
|
|
"types-jsonschema",
|
|
]
|
|
|
|
[project.scripts]
|
|
bincio = "bincio.cli:main"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=9.0",
|
|
"pytest-cov>=5.0",
|
|
"ruff>=0.9",
|
|
"mypy>=1.11",
|
|
"types-pyyaml",
|
|
"types-jsonschema",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py312"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
ignore = ["E501"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.12"
|
|
strict = true
|
|
ignore_missing_imports = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
markers = [
|
|
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
"integration: marks tests requiring real activity files",
|
|
]
|