This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import csv, glob, MeCab | |
result_file = "XXXXXXXX" | |
dic_file = "XXXXXXXX" | |
shikiho_file = "XXXXXXXX" | |
headmsg = ["code","comment","value"] |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os, csv, threading, re | |
from time import sleep | |
from selenium import webdriver | |
from pyquery import PyQuery | |
from logging import getLogger, FileHandler, Formatter, DEBUG | |
logger = getLogger(__name__) |
This file contains 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
""" | |
Google Cloud Storage から Bucket 情報の一覧を取得するスクリプト | |
- Python 3.9.6 | |
- google-cloud-storage==1.42.3 | |
""" | |
import csv | |
from google.cloud import storage | |
def run(): |
This file contains 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
""" | |
FastAPIの基本的記法 | |
- Python 3.9.7 | |
- FastAPI 0.70.0 | |
- uvicorn 0.15.0 | |
""" | |
import uvicorn | |
from typing import Optional | |
from fastapi import FastAPI, Query, HTTPException | |
from pydantic import Field, BaseModel |
This file contains 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 datetime import datetime, timedelta | |
from textwrap import dedent | |
from airflow import DAG | |
from airflow.operators.bash import BashOperator | |
from airflow.operators.python import PythonOperator | |
from airflow.decorators import task | |
# define default arguments for operators. | |
default_args = { |
This file contains 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 datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.empty import EmptyOperator | |
from airflow.decorators import task | |
from airflow.decorators.branch_python import branch_task | |
@task(task_id='beginning') | |
def beginning() -> int: |
This file contains 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 datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.python import ShortCircuitOperator | |
from airflow.operators.empty import EmptyOperator | |
def is_even_number() -> bool: | |
import random | |
number = random.randint(1, 10) |
This file contains 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 datetime import datetime, timedelta | |
from airflow import DAG | |
from airflow.operators.trigger_dagrun import TriggerDagRunOperator | |
with DAG( | |
dag_id='trigger_run_dag', | |
description='A Sample TriggerDagRunOperator DAG', | |
schedule_interval=timedelta(days=1), | |
start_date=datetime(2022, 6, 1), |
This file contains 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 datetime import datetime | |
from airflow import DAG | |
from airflow.decorators import task | |
@task(task_id='pring_message') | |
def print_message(dag_run=None) -> None: | |
print(f'received message: {dag_run.conf["message"]}.') |
This file contains 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 datetime import datetime, timedelta, timezone | |
from airflow import DAG | |
from airflow.operators.empty import EmptyOperator | |
from airflow.sensors.external_task import ( | |
ExternalTaskMarker, | |
ExternalTaskSensor, | |
) | |
JST = timezone(timedelta(hours=+9), 'JST') |
OlderNewer