Skip to content

Commit

Permalink
Merge pull request #9 from Smlep/develop
Browse files Browse the repository at this point in the history
Bump to 0.1.0
  • Loading branch information
Smlep authored Dec 14, 2020
2 parents 8756143 + 49725a0 commit d1fe9b3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="smlep_news",
version="0.0.7",
version="0.1.0",
description="Custom news scrapper",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
12 changes: 12 additions & 0 deletions smlep_news/exchangerates/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import requests

from .rates import Rates

url = "https://api.exchangeratesapi.io/latest"


def get_exchange_rates():
r = requests.get(url)
r.raise_for_status()

return Rates(r.json())
8 changes: 8 additions & 0 deletions smlep_news/exchangerates/rates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Rates:
def __init__(self, d):
self.base = d["base"]
self.date_str = d["date"]
self.rates = d["rates"]

def __repr__(self):
return "Exchange rates at {} with {} base".format(self.date_str, self.base)

0 comments on commit d1fe9b3

Please sign in to comment.