Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mael-J committed Feb 10, 2024
2 parents b963aee + a85dfdc commit 0193981
Show file tree
Hide file tree
Showing 12 changed files with 1,715 additions and 1,590 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pylint
if [ -f requirements/requirements.txt ]; then pip install -r requirements/requirements.txt; fi
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
8 changes: 2 additions & 6 deletions .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
on: [push]

permissions:
contents: read
Expand All @@ -27,7 +23,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements/requirements.txt ]; then pip install -r requirements/requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ MStarpy provides stock and fund public data to retail and professional investors

The project is **open-source** and anyone can contribute on `github <https://github.com/Mael-J/mstarpy>`_.


[![GitHub release](https://img.shields.io/github/v/release/Mael-J/mstarpy.svg?maxAge=3600)](https://github.com/Mael-J/mstarpy./releases)

Getting Started
===============

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Configuration file for the Sphinx documentation builder.
""" Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
Expand All @@ -9,14 +9,14 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
"""
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

project = 'mstarpy'
project = 'MSTARPY'
copyright = '2023, Maël Jourdain'
author = 'Maël Jourdain'

Expand Down
5 changes: 4 additions & 1 deletion mstarpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# flake8: noqa

""" mstarpy init """
from .funds import Funds
from .stock import Stock
from .search import filter_universe, search_field, search_filter, search_funds, search_stock

__version__ = "1.0.4"
__version__ = "1.0.4"
34 changes: 17 additions & 17 deletions mstarpy/error.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
def not_200_response(url,response):
"""
This function raise a ConnectionError if the status code a requests is not 200.
"""module to raise error"""


def not_200_response(url, response):
"""
This function raise a ConnectionError
if the status code a requests is not 200.
"""
if not response.status_code == 200:
raise ConnectionError(f"Error {response.status_code} for the api {url}. Message : {response.reason}.")
raise ConnectionError(
f"""Error {response.status_code}
for the api {url}. Message : {response.reason}."""
)


def no_site_error(code, name, country, site):
"""
This function raise a ValueError if the selected country is "us" or a site is not selected.
"""


if not site or country == 'us':
This function raise a ValueError if the
selected country is "us" or a site is not selected.
"""
if not site or country == "us":
if country:
raise ValueError(f"The funds of the country {country} cannot be scraped.")
else:
raise ValueError(f"The funds {name} ({code}) cannot be scraped.")




raise ValueError(f"""The funds of the
country {country} cannot be scraped.""")
raise ValueError(f"The funds {name} ({code}) cannot be scraped.")
Loading

0 comments on commit 0193981

Please sign in to comment.