Skip to content

Instantly share code, notes, and snippets.

@pypeach
pypeach / web_access.py
Last active July 23, 2018 13:06
WEBスクレイピングのユーティリティです
# coding:utf-8
import logging
import socket
import urllib.request
from bs4 import BeautifulSoup
"""
Web Scrapeを行う
"""
@pypeach
pypeach / collect_web.py
Last active July 23, 2018 13:05
Webスクレイピングを行うサンプルアプリケーションです
# coding:utf-8
import logging
from app.app_logic_base import AppLogicBase
from app.util import message_access, web_access
"""
Webスクレイピングするサンプルアプリケーションです
"""
__author__ = "t.ebinuma"
@pypeach
pypeach / db_access.py
Last active July 23, 2018 12:56
DBユーティリティ
# coding:utf-8
import logging
import os
import sqlite3
from app.util import message_access, app_config
"""
DBアクセスを制御する
"""
@pypeach
pypeach / operate_db.py
Last active July 23, 2018 12:54
DBアクセスを行うサンプルアプリケーションです
# coding:utf-8
import logging
from app.app_logic_base import AppLogicBase
from app.enum.gender_type import GenderType
from app.sql import employees, departments
from app.util import date_helper
"""
DBアクセスするサンプルアプリケーションです
@pypeach
pypeach / write_message.py
Last active July 23, 2018 12:50
メッセージ出力を行うサンプルアプリケーション
# coding:utf-8
import logging
from app.app_logic_base import AppLogicBase
from app.util import message_access
"""
メッセージを出力するサンプルアプリケーションです
"""
__author__ = "t.ebinuma"
@pypeach
pypeach / logging_production.yml
Last active July 23, 2018 12:51
ログ設定ファイル
version: 1
formatters:
customFormatter:
format: '[%(asctime)s] %(levelname)s - %(filename)s#%(funcName)s:%(lineno)d: %(message)s'
datefmt: '%Y/%m/%d %H:%M:%S'
handlers:
fileRotatingHandler:
formatter: customFormatter
@pypeach
pypeach / message_access.py
Last active July 23, 2018 12:53
メッセージ出力
# coding:utf-8
import configparser
import os
from app.util import app_config
"""
メッセージ出力を行う
"""
__author__ = "t.ebinuma"
@pypeach
pypeach / read_csv_file.py
Last active July 23, 2018 13:11
ファイル読み込み
# coding:utf-8
import logging
import os
from app.app_logic_base import AppLogicBase
from app.sql import employees
from app.util import app_config, message_access, date_helper
from app.util.file_access import get_file_encoding
"""
@pypeach
pypeach / file_access.py
Last active July 23, 2018 13:12
ファイルユーティリティ
# coding:utf-8
"""
ファイルアクセスを制御する
"""
import chardet
__author__ = "t.ebinuma"
@pypeach
pypeach / application_production.yml
Last active May 1, 2018 04:10
アプリケーション設定ファイル
##################################################
## データファイルのプロパティ
##################################################
# データ(添付ファイル等)ファイルのディレクトリパス
data_path: {$python_path}/data/
##################################################
## ログファイルのプロパティ
##################################################
# ログファイルのディレクトリパス