Esempio n. 1
0
def test_save_all():
    c = jsm.QuotesCsv()
    for range_type in (jsm.DAILY, jsm.WEEKLY, jsm.MONTHLY):
        c.save_historical_prices(tempfile.mktemp(dir='/tmp/'),
                                 CCODE,
                                 range_type,
                                 all=True)
Esempio n. 2
0
def test_save_range():
    c = jsm.QuotesCsv()
    start_date = datetime.date.fromtimestamp(time.time() - 604800)  # 1週間前
    end_date = datetime.date.today()
    for range_type in (jsm.DAILY, jsm.WEEKLY, jsm.MONTHLY):
        c.save_historical_prices(tempfile.mktemp(dir='/tmp/'), CCODE,
                                 range_type, start_date, end_date)
import subprocess
from jsm_stock_lib import *
import pandas as pd
from datetime import datetime
import jsm
import os
import time
import calendar
from japan_stock_id_divided import *
import numpy as np
import multiprocessing

q = jsm.Quotes()
c = jsm.QuotesCsv()
FILE_TYPE = ".csv"
now = datetime.now()
ROOT_PATH = "./stock_data/"
MONTHLY_DIR_PATH = "./stock_data/monthly_data/"
date_str = now.strftime("%Y%m%d")


def get_stock_price(stock_id_list):
    price_list = []
    for id in stock_id_list:
        price_list.append(q.get_price(id))
    print(price_list)
    return price_list


def check_reputecated_file(stock_id_list):
    day_time = datetime.today().date()
Esempio n. 4
0
def test_save_ja_path():
    c = jsm.QuotesCsv()
    path = tempfile.mktemp(dir='/tmp/')
    path += '日本語'
    c.save_price(path, CCODE)
Esempio n. 5
0
def test_save():
    c = jsm.QuotesCsv()
    c.save_price(tempfile.mktemp(dir='/tmp/'), CCODE)