{"id":37078892,"url":"https://github.com/arthurbernard/fynance","last_synced_at":"2026-06-17T01:00:50.301Z","repository":{"id":34047558,"uuid":"156912338","full_name":"ArthurBernard/Fynance","owner":"ArthurBernard","description":"Python and Cython scripts of machine learning, econometrics and statistical tools designed for finance.","archived":false,"fork":false,"pushed_at":"2026-06-13T18:23:56.000Z","size":5481,"stargazers_count":24,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-06-13T20:16:39.742Z","etag":null,"topics":["backtest","deep-learning","finance","machine-learning","neural-network","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArthurBernard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-11-09T20:05:58.000Z","updated_at":"2026-05-31T21:53:53.000Z","dependencies_parsed_at":"2024-05-13T17:46:48.178Z","dependency_job_id":"a72c96b4-a5b6-4926-8bf1-cf450bd956d9","html_url":"https://github.com/ArthurBernard/Fynance","commit_stats":{"total_commits":467,"total_committers":1,"mean_commits":467.0,"dds":0.0,"last_synced_commit":"842f37e1c94f3d5943d7900a5bcd15b1d2342ddf"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ArthurBernard/Fynance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurBernard%2FFynance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurBernard%2FFynance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurBernard%2FFynance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurBernard%2FFynance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArthurBernard","download_url":"https://codeload.github.com/ArthurBernard/Fynance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurBernard%2FFynance/sbom","scorecard":{"id":16505,"data":{"date":"2025-08-11","repo":{"name":"github.com/ArthurBernard/Fynance","commit":"9bf9c95e069b7725b1d81de01960080b8d448126"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114","Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T15:54:09.856Z","repository_id":34047558,"created_at":"2025-08-14T15:54:09.856Z","updated_at":"2025-08-14T15:54:09.856Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34429493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtest","deep-learning","finance","machine-learning","neural-network","python"],"created_at":"2026-01-14T09:33:03.602Z","updated_at":"2026-06-17T01:00:50.295Z","avatar_url":"https://github.com/ArthurBernard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/ArthurBernard/Fynance/develop/doc/source/_static/logo-dark-transparent.svg\"\u003e\n  \u003cimg alt=\"Fynance logo\" src=\"https://raw.githubusercontent.com/ArthurBernard/Fynance/develop/doc/source/_static/logo-light-transparent.svg\" height=\"180px\" align=\"left\"\u003e\n\u003c/picture\u003e\n\n# **Fynance**\n\n[![Python versions](https://img.shields.io/pypi/pyversions/fynance)](https://pypi.org/project/fynance/)\n[![PyPI](https://img.shields.io/pypi/v/fynance.svg)](https://pypi.org/project/fynance/)\n[![PyPI status](https://img.shields.io/pypi/status/fynance.svg?colorB=blue)](https://pypi.org/project/fynance/)\n[![CI](https://github.com/ArthurBernard/Fynance/actions/workflows/ci.yml/badge.svg)](https://github.com/ArthurBernard/Fynance/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/ArthurBernard/fynance.svg)](https://github.com/ArthurBernard/Fynance/blob/master/LICENSE.txt)\u003cbr\u003e\n[![Documentation](https://readthedocs.org/projects/fynance/badge/?version=latest)](https://fynance.readthedocs.io/en/latest/)\n[![Coverage](https://codecov.io/gh/ArthurBernard/Fynance/branch/develop/graph/badge.svg)](https://codecov.io/gh/ArthurBernard/Fynance)\n[![Docstring coverage](https://raw.githubusercontent.com/ArthurBernard/Fynance/develop/badges/interrogate_badge.svg)](https://github.com/ArthurBernard/Fynance)\n[![Downloads](https://pepy.tech/badge/fynance)](https://pepy.tech/project/fynance)\n\n___\n\nPure-Python package (Numba-accelerated kernels) providing **machine learning**,\n**econometric** and **statistical** tools for **financial analysis** and\n**backtesting of trading strategies**.\n\n## Installation\n\n```bash\npip install fynance\n```\n\nFrom source:\n\n```bash\ngit clone https://github.com/ArthurBernard/Fynance.git\ncd Fynance\npip install -e \".[dev]\"\n```\n\nThe build is pure-Python — there is no compile step (numerical kernels are\nNumba `@njit`, JIT-compiled on first call).\n\n## Architecture\n\nA complete, layered ML/DL backtesting tool — **data → features → signal →\nportfolio → backtest → metrics** — composed through `typing.Protocol` seams.\nnumpy is the lingua franca; PyTorch is confined to `fynance.models`. Each piece\nis usable standalone; `fynance.strategy.Strategy` is an *optional* orchestrator.\n\n\u003e **2.0 is a breaking release.** See [`doc/MIGRATION-2.0.md`](doc/MIGRATION-2.0.md)\n\u003e for the import-path map (e.g. `fynance.algorithms` → `fynance.portfolio`,\n\u003e performance metrics → `fynance.metrics`).\n\n## Subpackages\n\n**Core** `fynance.core` — `PriceSeries` value object (thin, numpy-backed) and the\npipeline protocols (`DataSource`, `FeatureTransform`, `SignalModel`, `Allocator`,\n`CostModel`, `Metric`).\n\n**Data** `fynance.data` — file adapters (`load` for CSV/Parquet → `PriceSeries`),\nalignment/resampling, and no-lookahead temporal splits (`train_test_split`,\n`walk_forward`).\n\n**Features** `fynance.features` — technical indicators (Bollinger, RSI, MACD, ROC,\nrealized volatility, rolling skew/kurtosis/autocorr, …), momentums (SMA, EMA, WMA),\nscaling (incl. rolling rank), statistics, feature engineering (multi-resolution,\nGranger causality) and market-regime detection.\n\n**Metrics** `fynance.metrics` — performance/evaluation metrics (Sharpe, Sortino,\nCalmar, drawdown, …) and a one-call `summary`.\n\n**Signal** `fynance.signal` — prediction → position mappers (`sign`, `threshold`,\n`rank`, vol-targeting) and a model+mapper pipeline.\n\n**Portfolio** `fynance.portfolio` — allocation (ERC, HRP, IVP, MDP, MVP) and\nsizing (fractional Kelly, volatility targeting, transaction costs).\n\n**Backtest** `fynance.backtest` — vectorized engine (`backtest`: positions +\nreturns/prices + cost → `BacktestResult`) and cost models.\n\n**Plot** `fynance.plot` — composable matplotlib figures and a one-call\n`tearsheet` report.\n\n**Models** `fynance.models` — econometric models (MA, ARMA, ARMA-GARCH) and\nPyTorch nets (MLP, RNN, GRU, LSTM, MultiHeadAttention, TCN, Transformer), a\ndirection+magnitude stacking ensemble, differentiable losses (Sharpe, Sortino,\nCalmar, Omega, directional, hybrid), and robust-training utilities.\n\n**Strategy** `fynance.strategy` — optional orchestrator composing the maillons\nend-to-end, with single-run and walk-forward evaluation.\n\n**Research** `fynance.research` — data-agnostic experiment harness: `Experiment`\n(serializable run record), `run_experiment` (seeded, cost-aware, walk-forward),\n`write_report` (portable markdown + tearsheet PNG + notebook) and synthetic data\ngenerators (`gbm`, `regime_switching`). Results are written only to a\ncaller-provided `output_dir` — fynance never stores them itself.\n\n## Quick start\n\n```python\nimport numpy as np\nimport fynance as fy\n\n# 1. Data — load a CSV/Parquet file, or build a PriceSeries directly\nprices = fy.PriceSeries(100 * np.cumprod(1 + np.random.randn(750) * 0.01))\n\n# 2. Compose a strategy: momentum feature -\u003e position -\u003e backtest with costs\nstrat = fy.Strategy(\n    features=lambda p: np.sign(np.diff(p, prepend=p[0])),\n    signal=lambda x: x,\n    cost=fy.ProportionalCost(fee=0.0005),\n)\nresult = strat.run(prices)\n\n# 3. Evaluate and report\nprint(result.summary())     # Sharpe, Sortino, Calmar, max drawdown, ...\nfig = fy.tearsheet(result)  # one-call performance report\n```\n\nSee [`Notebooks/quickstart_v2.ipynb`](Notebooks/quickstart_v2.ipynb) for the full\nrunnable tour (data, features, walk-forward, reporting). An optional Streamlit\nplayground ships under [`apps/playground/`](apps/playground/)\n(`pip install -e \".[ui]\" \u0026\u0026 streamlit run apps/playground/app.py`).\n\n## Links\n\n- PyPI: https://pypi.org/project/fynance/\n- Documentation: https://fynance.readthedocs.io/en/latest/\n- Source: https://github.com/ArthurBernard/Fynance\n- Changelog: https://github.com/ArthurBernard/Fynance/blob/master/CHANGELOG.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurbernard%2Ffynance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurbernard%2Ffynance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurbernard%2Ffynance/lists"}