This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import plotly.graph_objects as go | |
from plotly.subplots import make_subplots | |
from datetime import datetime | |
# ====== 設定區 ====== | |
token = "" # ←請填入你的 FinMind API token | |
start_date = "2025-01-01" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from shiny.express import input, render, ui | |
ui.input_selectize( | |
"var", "Select variable", | |
choices=["bill_length_mm", "body_mass_g"] | |
) | |
@render.plot | |
def hist(): | |
from matplotlib import pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
import pyodbc | |
accountfile = 'Text.txt' | |
with open(accountfile) as data: | |
accounts = data.readlines() | |
BIDW = list(filter(lambda x:'DB_USER' in x, accounts)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tableauserverclient as TSC | |
import re | |
tableau_auth = TSC.TableauAuth('BI_USER', 'XXX') | |
server = TSC.Server('https://bi.com') | |
request_options = TSC.RequestOptions(pagesize=1000) | |
overwrite_credentials = True | |
search_server_regex = 'XXX.XXX.XXX.XXX' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
library(xml2) | |
xml_Doc <- read_xml("tableau.twb") | |
xml_groupfilter <- xml_find_all(xml_Doc, ".//group[@name='[FilterA]']//groupfilter[@function='filter']") | |
userList <- lapply(xml_groupfilter,function(x){ | |
tmpUser <- xml_attr(x,"expression") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
library(vvtableau) | |
tableau <- authenticate_server( | |
base_url = "https://tableau.server.com/", | |
username = "ABC", | |
password = "OOXX" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
library(httr) | |
library(data.table) | |
library(dplyr) | |
library(plotly) | |
url = 'https://api.finmindtrade.com/api/v4/data' | |
config_proxy <- httr::config( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import win32com.client | |
import os | |
import pythoncom | |
import json | |
import pyodbc | |
from datetime import datetime | |
from datetime import timedelta | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
library(readODS) | |
library(lubridate) | |
library(tidyr) | |
library(RODBC) | |
setFiles <- paste0( | |
unique(gsub("-","",substr(ymd(seq.Date(as.Date('2015-01-01'),as.Date('2019-03-01'),by = "month")),1,7))), | |
"_cht.ods" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list=ls()) | |
options(digits = 9) | |
library(httr) | |
library(xml2) | |
library(dplyr) | |
library(magrittr) | |
TGOS_ADDR <- function(setADDR) { |
NewerOlder