From 39f672cb2167487045951eef8aee991c579cff2a Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Fri, 25 Jun 2021 08:17:29 -0500 Subject: [PATCH] add type hinting --- pypi_list/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pypi_list/__init__.py b/pypi_list/__init__.py index e442e96..a46a5ee 100644 --- a/pypi_list/__init__.py +++ b/pypi_list/__init__.py @@ -25,6 +25,7 @@ run_project(full=True) # run full pipeline including network requests """ import logging +from typing import List, Optional import requests from kedro.extras.datasets.json import JSONDataSet @@ -38,7 +39,7 @@ logger = logging.getLogger(__name__) __version__ = "0.2.0" -def get_body(packages): +def get_body(packages: str) -> str: """Get the body tag from the full page html.""" tag = "\n" @@ -48,7 +49,7 @@ def get_body(packages): return packages -def remove_html_tags(text): +def remove_html_tags(text: str) -> List[str]: """Remove html tags from a string""" import re @@ -146,7 +147,7 @@ catalog = DataCatalog( runner = SequentialRunner() -def run_project(full=None): +def run_project(full: Optional[bool] = None): """ Run the project.