From a8745964a773370f6fa7275cd0c351b0ba2f771f Mon Sep 17 00:00:00 2001 From: Daniil Fajnberg Date: Sun, 21 Nov 2021 21:44:03 +0100 Subject: [PATCH] initial commmit; boilerplate --- .coveragerc | 10 ++++++++++ .gitignore | 10 ++++++++++ LICENSE | 21 +++++++++++++++++++++ README.md | 22 ++++++++++++++++++++++ coverage.sh | 3 +++ pyproject.toml | 6 ++++++ requirements/common.txt | 2 ++ requirements/dev.txt | 2 ++ setup.cfg | 32 ++++++++++++++++++++++++++++++++ 9 files changed, 108 insertions(+) create mode 100644 .coveragerc create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100755 coverage.sh create mode 100644 pyproject.toml create mode 100644 requirements/common.txt create mode 100644 requirements/dev.txt create mode 100644 setup.cfg diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..ab5ddf4 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,10 @@ +[run] +source = src/ +branch = true +omit = + .venv/* + +[report] +fail_under = 100 +show_missing = True +skip_covered = True diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b853735 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Virtual environment +/.venv/ +# PyCharm: +/.idea/ +# Distribution / packaging: +*.egg-info/ +# Python cache: +__pycache__/ +# Tests: +.coverage \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..11b3bac --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Daniil & Maximilian Fajnberg + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5000768 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# MarketWatch financials scraper + +Scrapes any company's financials from [MarketWatch.com](https://www.marketwatch.com/), which includes income statement, balance sheet, and cash flow statement. + +Asynchronous HTTP requests are currently used by default. + +### Dependencies + +- [Python](https://www.python.org/) 3.8+ + +Should run on most Linux/Windows systems. Tested on Arch. + +### Building + +Clone this repo, install `build` via pip, then run `pip -m build` +from the repository's root directory. This should produce a `dist/` +subdirectory with a wheel (build) and archive (source) distribution. +The resulting `whl`-file can be installed via `pip install path/dist/***.whl`. + +### Running + +... diff --git a/coverage.sh b/coverage.sh new file mode 100755 index 0000000..786075e --- /dev/null +++ b/coverage.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +coverage erase && coverage run -m unittest discover && coverage report diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b5a3c46 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/requirements/common.txt b/requirements/common.txt new file mode 100644 index 0000000..6b3d8f8 --- /dev/null +++ b/requirements/common.txt @@ -0,0 +1,2 @@ +beautifulsoup4 +aiohttp \ No newline at end of file diff --git a/requirements/dev.txt b/requirements/dev.txt new file mode 100644 index 0000000..be725ff --- /dev/null +++ b/requirements/dev.txt @@ -0,0 +1,2 @@ +-r common.txt +coverage \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..825d2cd --- /dev/null +++ b/setup.cfg @@ -0,0 +1,32 @@ +[metadata] +name = mwfin +version = 0.0.1 +author = Daniil & Maximilian F. +author_email = mail@placeholder123.to +description = Scraper for MarketWatch company financials +long_description = file: README.md +long_description_content_type = text/markdown +url = https://git.fajnberg.de/daniil/mwfin +project_urls = + Bug Tracker = https://github.com/daniil-berg/mwfin/issues +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent +keywords = webscraping, html, markup, dom, scraper, attributes, tags, stocks, finance + +[options] +package_dir = + = src +packages = find: +python_requires = >=3.8 +install_requires = + beautifulsoup4 + aiohttp + +[options.extras_require] +tests = + coverage + +[options.packages.find] +where = src