Skip to content

Commit

Permalink
Make code work w Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyke committed Jul 1, 2022
1 parent 82bd05b commit 0d724c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tessa"
version = "0.3.1"
version = "0.3.2"
description = "Find financial assets and get their price history without worrying about different APIs or rate limiting."
authors = ["ymyke"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion tessa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.3.1"
__version__ = "0.3.2"

from .price import price_history, price_point, price_point_strict, price_latest
from .search import search
2 changes: 1 addition & 1 deletion tessa/coingecko_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pycoingecko import CoinGeckoAPI


@functools.cache
@functools.lru_cache(maxsize=None)
def get_symbol_map() -> list:
"""Get the symbol map. Separate function to use caching, so the API doesn't get
hit too often.
Expand Down
11 changes: 6 additions & 5 deletions tessa/investing_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ def investing_search(
r2 = investing_search("AAPL", countries=["united states", "canada"], products="stocks")
```
"""
return search_name_or_symbol(query, countries, products) | search_for_searchobjs(
query, countries, products
)
return {
**search_name_or_symbol(query, countries, products),
**search_for_searchobjs(query, countries, products),
}


@freezeargs
@functools.cache
@functools.lru_cache(maxsize=None)
def search_name_or_symbol(
query: str,
countries: Optional[Union[list, str]] = None,
Expand Down Expand Up @@ -102,7 +103,7 @@ def search_name_or_symbol(


@freezeargs
@functools.cache
@functools.lru_cache(maxsize=None)
def search_for_searchobjs(
query: str,
countries: Optional[Union[list, str]] = None,
Expand Down
2 changes: 1 addition & 1 deletion tessa/price.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@freezeargs
@functools.cache
@functools.lru_cache(maxsize=None)
def price_history(
query: str, type_: str, country: str = None, currency_preference: str = "usd"
) -> Tuple[pd.DataFrame, str]:
Expand Down

0 comments on commit 0d724c8

Please sign in to comment.