alphavantage.web.get()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 3
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
from datetime import datetime
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
3
import requests
4
5
from alphavantage.reference import BASE_URL
6
7
8
def get(session: requests.Session, parameters=None, url=BASE_URL):
9
    """Request data as JSON."""
10
11
    response = session.get(url, params=parameters)
12
    retrieved_at = datetime.utcnow()
13
14
    return response.json(), retrieved_at
15