From nobody Mon Dec 26 02:35:02 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NgMMB5l8Qz1HRpD; Mon, 26 Dec 2022 02:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NgMMB5Bbjz3lWh; Mon, 26 Dec 2022 02:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672022102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agIde5OZGFr59kL6Cp6Vgl2RsqDVPo7mDoT2g0WflpE=; b=AnKpvyEfGN20INq3cFI7y+cf7B0/kC8ftaAB350X0EJhZ0jGwYQ72itUvXQZgG+jVq/B4u sK3V8Fc9QJm4hnNHOaHF0hZuFQ1l4QJU0nIXYzbfnEdGwbK/5sb/yGt2vc/Q2WWG4DZsna vB1EKUey2Tf2pwZc5yt3PAe97vR+32o70+RL2+i9O8mZXqeLkIT/V3/eVVQITCaQneKtoH kVGtXXImsQfo0WggtEkI11UgRoyawi1cx5brXEobDpZiSITUGHIGp2M2xYBjP3m9+/gwTb 6YjgntTwIotS81aYALHvNSXxK37iST/CUQxFo/yIq64N6pU5X9O5SdN75UxsZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672022102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agIde5OZGFr59kL6Cp6Vgl2RsqDVPo7mDoT2g0WflpE=; b=Kghyp0ZH1v9HYkW6LUTRaWHhKfbRMPWd3FSwDlTUlQle5X8FhHUwPn5O9iaBENQkaMBTzL oALc19G2/6KnxQUClCdaF3VtSwDz23Xbcnc6SAWFRDWG9+T7mFsdPzCQEKvXrscVu9yWCw pU8kRGMwruEkprjx4N2x2PTX6QbEISlj3TBwGGEnVqyJMnLFEPEtWmSXL1oSeJkZChgW9C Q+hfH/HvFXlUWB87g4g5Z5syhSkIC/JfXnxwlQbNXZdUSgxurlHiTbcXuwIY3Va/jnuxsF qG7NfEOXXc9XWw5z0ryT6z7/z4TG+b8n/tX+blhCvUZUy7vLeZ4ZFlm669L5ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672022102; a=rsa-sha256; cv=none; b=ehasRprusAe/UgUp3FQ99H+Cpehd4mIAVzWFti/bz2kzWn+OSTwAuRF2MhAzLCtevpgoaM ZLTOom/dbik8Q/no84mVg7otY5LsanwYycH3sWTU1agKkDxxCxmt0NtaqVoizWiBs9e/RY 2iNmJD0r0/BvDR3bBS0Ze5OcG06VY+gj56+3Kvga9gSSTjPv+8cy0RIi2FPqjX/b/HKxQv AHI3yVXbPYb+Jqs6PrjTqOGeYxX9pfCoacWDMhC7GLFKp8lBDEjsxdGQl8QCu5+PojSe+B e/BeDdfF/vGgYO/BgpwN7xsG3j8EPMUlAWa5EpU/iXQB1/x7HULgIq+d6w/FrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NgMMB4HDgzFPX; Mon, 26 Dec 2022 02:35:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BQ2Z2pw084626; Mon, 26 Dec 2022 02:35:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BQ2Z2rs084625; Mon, 26 Dec 2022 02:35:02 GMT (envelope-from git) Date: Mon, 26 Dec 2022 02:35:02 GMT Message-Id: <202212260235.2BQ2Z2rs084625@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: d3b17e1ff9e5 - main - finance/py-finviz: New port: Unofficial API for FinViz.com List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3b17e1ff9e5a0594dc98f9336151be8534732c4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=d3b17e1ff9e5a0594dc98f9336151be8534732c4 commit d3b17e1ff9e5a0594dc98f9336151be8534732c4 Author: Yuri Victorovich AuthorDate: 2022-12-25 21:40:18 +0000 Commit: Yuri Victorovich CommitDate: 2022-12-26 02:34:58 +0000 finance/py-finviz: New port: Unofficial API for FinViz.com --- finance/Makefile | 1 + finance/py-finviz/Makefile | 37 +++++++++++++++++++++++++++++++++++++ finance/py-finviz/distinfo | 3 +++ finance/py-finviz/files/test.py | 20 ++++++++++++++++++++ finance/py-finviz/pkg-descr | 4 ++++ 5 files changed, 65 insertions(+) diff --git a/finance/Makefile b/finance/Makefile index 7c07b49e5443..1bd0e52291c2 100644 --- a/finance/Makefile +++ b/finance/Makefile @@ -101,6 +101,7 @@ SUBDIR += py-ebaysdk SUBDIR += py-financedatabase SUBDIR += py-finnhub-python + SUBDIR += py-finviz SUBDIR += py-finvizfinance SUBDIR += py-fundamentalanalysis SUBDIR += py-investiny diff --git a/finance/py-finviz/Makefile b/finance/py-finviz/Makefile new file mode 100644 index 000000000000..c6a4982caf34 --- /dev/null +++ b/finance/py-finviz/Makefile @@ -0,0 +1,37 @@ +PORTNAME= finviz +DISTVERSION= 1.4.5 +CATEGORIES= finance python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Unofficial API for FinViz.com +WWW= https://github.com/mariostoev/finviz + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +PY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}aiohttp>=3.7.4:www/py-aiohttp@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}beautifulsoup>=4.9.3:www/py-beautifulsoup@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}cssselect>=1.1.0:www/py-cssselect@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}lxml>=4.6.3:devel/py-lxml@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}requests>=2.25.1:www/py-requests@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}tenacity>=7.0.0:devel/py-tenacity@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}tqdm>=4.61.1:misc/py-tqdm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}urllib3>=1.26.5:net/py-urllib3@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}user_agent>=0.1.9:www/py-user_agent@${PY_FLAVOR} +BUILD_DEPENDS= ${PY_DEPENDS} +RUN_DEPENDS= ${PY_DEPENDS} + +USES= python:3.6+ +USE_PYTHON= distutils autoplist pytest + +NO_ARCH= yes + +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +do-test: + @${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${FILESDIR}/test.py + +.include diff --git a/finance/py-finviz/distinfo b/finance/py-finviz/distinfo new file mode 100644 index 000000000000..f041ec83069e --- /dev/null +++ b/finance/py-finviz/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1672003808 +SHA256 (finviz-1.4.5.tar.gz) = 524a975a1d2c410d33468e63227e79f23199e303b613eb53ca9308477a743634 +SIZE (finviz-1.4.5.tar.gz) = 17467 diff --git a/finance/py-finviz/files/test.py b/finance/py-finviz/files/test.py new file mode 100644 index 000000000000..d7dc97f18e60 --- /dev/null +++ b/finance/py-finviz/files/test.py @@ -0,0 +1,20 @@ +from finviz.screener import Screener + +filters = ['exch_nasd', 'idx_sp500'] # Shows companies in NASDAQ which are in the S&P500 +stock_list = Screener(filters=filters, table='Performance', order='price') # Get the performance table and sort it by price ascending + +# Export the screener results to .csv +stock_list.to_csv("/tmp/stock.csv") + +# Create a SQLite database +stock_list.to_sqlite("/tmp/stock.sqlite3") + +for stock in stock_list[9:19]: # Loop through 10th - 20th stocks + print(stock['Ticker'], stock['Price']) # Print symbol and price + +# Add more filters +stock_list.add(filters=['fa_div_high']) # Show stocks with high dividend yield +# or just stock_list(filters=['fa_div_high']) + +# Print the table into the console +print(stock_list) diff --git a/finance/py-finviz/pkg-descr b/finance/py-finviz/pkg-descr new file mode 100644 index 000000000000..2bfa2256a888 --- /dev/null +++ b/finance/py-finviz/pkg-descr @@ -0,0 +1,4 @@ +FinViz aims to make market information accessible and provides a lot of data in +visual snapshots, allowing traders and investors to quickly find the stock, +future or forex pair they are looking for. The site provides advanced screeners, +market maps, analysis, comparative tools, and charts.