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
import jinja2 as j2 | |
env = j2.Environment() | |
# シンプルな使い方 | |
temp = env.from_string("Hello {{name}} !!") | |
print("=====") | |
print(temp.render(name="World")) | |
# 改行・スペース有無の挙動を確認 |
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 | |
import os | |
import time | |
import logging | |
import click | |
from prefect import flow, task | |
from prefect_dask import DaskTaskRunner |
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 | |
import os | |
import time | |
import logging | |
import click | |
import luigi |
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
def forward(): | |
sheet = Sheet(START, END, ROWS) | |
sheet["期初在庫", START] = 100 | |
today = START | |
while today <= END: | |
sheet["入荷量", today] = IN_NUM[today - START] | |
sheet["出荷量", today] = OUT_NUM[today - START] | |
if today > START: |
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
IN_NUM = [10, 20, 30, 20, 10] | |
OUT_NUM = [20, 20, 20, 20, 20] | |
START = Date(2022, 5, 30) | |
END = Date(2022, 6, 3) | |
ROWS = ["期初在庫", "入荷量", "出荷量", "期末在庫"] |
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 typing import Sequence, Union | |
from datetime import date, datetime, time, timedelta | |
from bqsc import Table | |
class MyTable(Table): | |
col_str: Union[str, Sequence[str]] | |
col_int: Union[int, Sequence[int]] | |
col_float: Union[float, Sequence[float]] | |
... |
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
def square(n: int) -> 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
def square(n): | |
return n * n |
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
import bqsc | |
from . import schemas | |
my_table = schemas.MyTable() | |
my_table.col_int = [1, 2, 3] | |
my_table.col_float = [4.0, 5.0, 6.0] | |
my_table.col_str = ["a", "b", "c"] | |
df = bqsc.dataframe(my_table) |
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
class FizzBuzz: | |
def __enter__(self): | |
self._fizz = 1 | |
self._buzz = 1 | |
self.flag = True | |
return self | |
def __exit__(self, *args): | |
pass |
NewerOlder