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
Attribute VB_Name = "Module1" | |
Sub get_image_path_and_current_cell() | |
Dim pic As Shape, TCht As Object | |
Dim ACWidth As Long, ACHeight As Long | |
For Each pic In ActiveSheet.Shapes | |
Debug.Print (pic.AlternativeText) | |
Range(pic.TopLeftCell.Address).Offset(0, 1) = pic.AlternativeText | |
ACWidth = pic.Width | |
ACHeight = pic.Height |
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 umihico_commons.chrome_wrapper import Chrome | |
def get_investment_urls_wikipedia(): | |
parent_url_dict = { | |
"札証上場企業": "https://ja.wikipedia.org/wiki/Category:%E6%9C%AD%E8%A8%BC%E4%B8%8A%E5%A0%B4%E4%BC%81%E6%A5%AD", | |
"ジャスダック上場企業": "https://ja.wikipedia.org/wiki/Category:%E3%82%B8%E3%83%A3%E3%82%B9%E3%83%80%E3%83%83%E3%82%AF%E4%B8%8A%E5%A0%B4%E4%BC%81%E6%A5%AD", | |
"東証PRO上場銘柄": "https://ja.wikipedia.org/wiki/Category:%E6%9D%B1%E8%A8%BCPRO%E4%B8%8A%E5%A0%B4%E9%8A%98%E6%9F%84", | |
"東証一部上場企業": "https://ja.wikipedia.org/wiki/Category:%E6%9D%B1%E8%A8%BC%E4%B8%80%E9%83%A8%E4%B8%8A%E5%A0%B4%E4%BC%81%E6%A5%AD", | |
"東証二部上場企業": "https://ja.wikipedia.org/wiki/Category:%E6%9D%B1%E8%A8%BC%E4%BA%8C%E9%83%A8%E4%B8%8A%E5%A0%B4%E4%BC%81%E6%A5%AD", |
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 io import BytesIO | |
from requests import get | |
from umihico_commons.xlsx_wrapper import _load_xlsx | |
import xlrd | |
def get_stock_metadata(): | |
url = "https://www.jpx.co.jp/markets/statistics-equities/misc/tvdivq0000001vg2-att/data_j.xls" | |
response = get(url) | |
with BytesIO(response.content) as f: |
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 requests import get | |
from lxml import html | |
def get_all_company_urls_wiki(): | |
base_url = "https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E3%81%AE%E4%BC%81%E6%A5%AD%E4%B8%80%E8%A6%A7" | |
url_dict = { | |
"水産・農林の企業の一覧": "https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E3%81%AE%E4%BC%81%E6%A5%AD%E4%B8%80%E8%A6%A7_(%E6%B0%B4%E7%94%A3%E3%83%BB%E8%BE%B2%E6%9E%97)", | |
"鉱業の企業の一覧": "https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E3%81%AE%E4%BC%81%E6%A5%AD%E4%B8%80%E8%A6%A7_(%E9%89%B1%E6%A5%AD)", | |
"建設の企業の一覧": "https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E3%81%AE%E4%BC%81%E6%A5%AD%E4%B8%80%E8%A6%A7_(%E5%BB%BA%E8%A8%AD)", |
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
def get_info_wikipedia(lxml_htmltree): | |
result = {} | |
title = lxml_htmltree.xpath( | |
"//h1[@id='firstHeading']")[0].text_content() | |
result = {"title": title} | |
result.update(_get_righttop_infobar(lxml_htmltree)) | |
return result | |
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 re | |
def get_address_regex_lxmltree(lxmltree): | |
address_list = [] | |
for text in lxmltree.itertext(): | |
address_list.extend(get_address_regex_text(text)) | |
return address_list | |
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
def gen_url(stock_code="8604"): | |
fundamental_url = f"https://profile.yahoo.co.jp/fundamental/{stock_code}" | |
consolidate_url = f"https://profile.yahoo.co.jp/consolidate/{stock_code}" | |
independent_url = f"https://profile.yahoo.co.jp/independent/{stock_code}" | |
urls = [fundamental_url, consolidate_url, independent_url] | |
return urls | |
def get_stock_info_yahoo(lxmltrees): |
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 ast | |
import base64 | |
import json | |
from requests import post | |
from passpacker import passwords | |
from pprint import pprint | |
from io import BytesIO | |
from umihico_commons.functools import chunks | |
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
def _yauc_strip(string): | |
deletings = (' ', " ", "\n", "\t", "\xa0") | |
for deleting in deletings: | |
string = string.replace(deleting, "") | |
if string.startswith(":") or string.startswith(":"): | |
string = string[1:] | |
return string |
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
for %%i in (*.mp4 *.mov) do ( | |
ffmpeg -i %%i -c copy -bsf:v h264_mp4toannexb -f mpegts %%i.ts | |
) | |
type nul > _list.txt | |
for %%i in (*.ts) do (echo file %%i) >> _list.txt | |
ffmpeg -f concat -i _list.txt -c copy concated_temp.ts | |
ffmpeg -i concated_temp.ts -c copy -bsf:a aac_adtstoasc output.mp4 |
OlderNewer