Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get sspyrs module included #69

Open
stonebig opened this issue Dec 26, 2022 · 1 comment
Open

how to get sspyrs module included #69

stonebig opened this issue Dec 26, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@stonebig
Copy link

stonebig commented Dec 26, 2022

Would it be possible to get the module sspyrs working, or a replacement ?
If I put it or its requirement requests-ntlm in the "environment.yml", the build fails.

... yet "requets" seems to be there

# requests works in  jupyterlite/xeus-python-demo !
import requests
from datetime import date, timedelta, datetime

today = date.today()
yesterday = today - timedelta(days=10)
country =  "germany"
endpoint = f"https://api.covid19api.com/country/{country}/status/confirmed"
params = {"from": str(yesterday), "to": str(today)}
print(params)
endpoint_via_browser = f"https://api.covid19api.com/country/germany/status/confirmed?from=2022-12-06&to=2022-12-22"

response = requests.get(endpoint, params=params).json()
total_confirmed = 0
for day in response:
    date_python = datetime.fromisoformat(day.get("Date", 0)[:-1] + '+00:00')
    print(date_python.strftime('%Y-%m-%d'), f'{day.get("Cases", 0):_.0f}')
    cases = day.get("Cases", 0)
    total_confirmed += cases

print(f"Total Confirmed Covid-19 cases in {country}: {total_confirmed:_.0f}")

image

@stonebig stonebig added the enhancement New feature or request label Dec 26, 2022
@martinRenou
Copy link
Member

If I put it or its requirement requests-ntlm in the "environment.yml", the build fails.

What is the build error message when you do this?

... yet "requets" seems to be there

Indeed requests is there, but it's not the real one, it's a shameless half-working mock module that lives here https://github.com/emscripten-forge/requests-wasm-polyfill. Not all the APIs have been implemented and we could use some Python dev help there! If you see anything missing from that requests module mock we can probably add it there.

@martinRenou martinRenou transferred this issue from jupyterlite/xeus-python-demo Mar 15, 2023
@jtpio jtpio transferred this issue from jupyterlite/xeus-python-kernel Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants