diff mbox series

[bug#64134,17/17] gnu: Add python-vectorbt.

Message ID 20230617151840.1748096-17-monego@posteo.net
State New
Headers show
Series Add some Python financial libraries. | expand

Commit Message

Vinicius Monego June 17, 2023, 3:18 p.m. UTC
* gnu/packages/finance.scm (python-vectorbt): New variable.
---
 gnu/packages/finance.scm | 46 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index e727681014..a7e181249d 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -90,6 +90,7 @@  (define-module (gnu packages finance)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages golang)
+  #:use-module (gnu packages graph)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages gsasl)
@@ -116,6 +117,7 @@  (define-module (gnu packages finance)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
@@ -1335,6 +1337,50 @@  (define-public python-bt
  logic to facilitate the rapid development of complex trading strategies.")
     (license license:expat)))
 
+(define-public python-vectorbt
+  (package
+    (name "python-vectorbt")
+    ;; Newer versions require Pandas 2+ which requires Cython>=0.29.33.
+    (version "0.24.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "vectorbt" version))
+              (sha256
+               (base32
+                "0arvy8dp9hd684zcmspcb4g2xhsg9b2l1gl3dnvzhli55zpqvina"))))
+    (build-system pyproject-build-system)
+    (arguments
+     ;; TypeError (number of positional arguments) on tests below.
+     (list #:test-flags #~(list "-k" (string-append
+                                      "not test_update_every"
+                                      " and not test_every"
+                                      " and not test_start"
+                                      " and not test_async_start"))))
+    (native-inputs (list python-pytest))
+    (propagated-inputs (list python-dateparser
+                             python-dill
+                             python-imageio
+                             python-ipywidgets
+                             python-matplotlib
+                             python-mypy-extensions
+                             python-numba
+                             python-numpy
+                             python-pandas
+                             python-plotly
+                             python-pytz
+                             python-requests
+                             python-schedule
+                             python-scikit-learn
+                             python-scipy
+                             python-tqdm
+                             python-typing-extensions))
+    (home-page "https://vectorbt.dev/")
+    (synopsis "Library for backtesting and analyzing trading strategies")
+    (description
+     "@code{vectorbt} is a Python package for quantitative analysis that
+operates entirely on pandas and NumPy objects and is accelerated by Numba.")
+    (license license:asl2.0)))
+
 (define-public python-u2flib-host
   ;; The package is obsolete and superseded by python-fido2, but
   ;; needed for python-ledgerblue@0.1.44.