Create a global FlagWatch API object.

import json
import datetime as dt
import pandas as pd
import numpy as np
import imp
backend = imp.load_compiled(‘flagwatch_back_end’, ‘__pycache__/flagwatch_back_end.cpython-38.pyc’)
# DO NOT MODIFY
# Create a global FlagWatch API object. This object supports three methods:
# 1. fw.describe_endpoints()
# 2. fw.describe_sample_data()
# 3. fw.request(URL)
fw = backend.FlagWatch(STUDENT_ID)
########################################################################
# Part 1
########################################################################
def endpoint(requested_date, requested_code):
“”” Get the FlagWatch URL endpoint for this date and item
Parameters
———-
requested_date : datetime.datetime
The date for the desired FlagWatch data
requested_code: str
The three characters code for either the FlagWatch ticker or exchange as specified by
your API.
Returns
——-
str
The FlagWatch endpoint URL beginning with `www.flagwatch.org`.
Notes
—–
– You should assume that the requested_code is three characters. However,
it may be upper cased, lower cased, or have some mixture of case.
“””
pass
########################################################################
# Part 2
########################################################################
def get_single_data_item(requested_date, requested_ticker, requested_exchange, requested_price_type):
“”” Get the FlagWatch price data for this date, ticker, exchange, and pricing type
Parameters
———-
requested_date : datetime.datetime
The date for the desired FlagWatch data
requested_ticker: str
The three characters code for the FlagWatch ticker of interest.
requested_exchange: str
The three characters code for the FlagWatch exchange of interest.
requested_price_type: str
The type of pricing information required: “OPEN”, “CLOSE”, “HIGH”, or “LOW”
Returns
——-
float
The price information.
Notes
—–
– You should assume that the requested_ticker and requested_exchange are
each three characters long. However, these may be upper cased, lower
cased, or have some mixture of case. Similarly, requested_price_type
will be one of the four options, but may be of any case structure.
Hint
—-
You should use one of the methods of the instance `fw`. Remember that
the method fw.describe_sample_data() returns an EXAMPLE. You do not
want to use that method here.
“””
pass
########################################################################
# Part 3
########################################################################
def get_time_series(requested_ticker, requested_exchange, requested_price_type):
“”” Get the FlagWatch timeseries for 2020 January for the requested ticker,
exchange, and price type
Parameters
———-
requested_ticker: str
The three characters code for the FlagWatch ticker of interest.
requested_exchange: str
The three characters code for the FlagWatch exchange of interest.
requested_price_type: str
The type of pricing information required: “OPEN”, “CLOSE”, “HIGH”, or “LOW”
Returns
——-
pandas.Series
The desired time series with a sorted datetime index.
Notes
—–
– You should assume that the requested_ticker and requested_exchange are
each three characters long. However, these may be upper cased, lower cased,
or have some mixture of case. Similarly, requested_price_type will be one of
the four options, but may be of any case structure.
Hints
—–
– The series will contain prices for all calendar days in January 2020
(from day 1 to day 31).
– Remember that the function `get_single_data_item` returns the price
for a single day
– Remember that the date parameter in `get_single_data_item` is a
datetime instance
“””
pass
########################################################################
# Part 4
########################################################################
def get_dataframe(ticker_exchange_price_combinations):
“”” Get a FlagWatch Pandas.DataFrame for 2020 January using the requested
ticker-exchange-price combinations.
Parameters
———-
ticker_exchange_price_combinations : list
A list of tuples where each tuple is a (ticker, exchange, price)
combination. For example, (“bic”, “got”, “open”) is the tuple for
bicoulour, Mt. GoT, and open price. (“str”, “cis”, “high”) is the tuple
for stripes, coininsecure, and high price.
Returns
——-
pandas.DataFrame
The desired data DataFrame with a chronological datetime index.
The column labels should be formatted as
“:”
where:
stands for the ticker code (upper case)
stands for the exchange code (upper case)
stands for the type of quote (upper case)
Examples:
– A (“bic”, “got”, “open”) tuple results in a column named “BICGOT:OPEN”
– A (“str”, “cis”, “high”) tuple results in a column named “STRCIS:HIGH”
“””
pass

find the cost of your paper

The post Create a global FlagWatch API object. appeared first on Best Custom Essay Writing Services | EssayBureau.com.

HelpHub
Calculate your paper price
Pages (550 words)
Approximate price: -

Why Choose HelpHub

HelpHub

Quality Researched Papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.

HelpHub

Qualified Writers

We have hired a team of professional writers experienced in academic and business writing. Most of them are native speakers and PhD holders able to take care of any assignment you need help with.

StudyAcer

Unlimited Revisions

If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account.

StudyAcer

On Time Delivery

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. We will always strive to deliver on time.

StudyAcer

Original & Confidential

We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text.

StudyAcer

24/7 Customer Support

Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Help Hub

Place your order

Fill in the order form and provide all details of your assignment.

Help Hub

Proceed with the payment

Choose the payment system that suits you most.

Help Hub

Receive the final file

Once your paper is ready, we will email it to you.

HelpHub Writing Services

No need to work on essay at night. Sleep tight, we will cover your back. We offer all kinds of essay writing services.

HelpHub HelpHub

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

HelpHub HelpHub

Admissions

Admission Essays

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

HelpHub HelpHub

Editing

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

HelpHub HelpHub

Revision

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied.