INNER CODE UNIT · Python

next_month

zillionare/zillionare · scripts/export_influx_data.py:87

            next_month = date(month_start.year + 1, 1, 1)
        else:
            next_month = date(month_start.year, month_start.month + 1, 1)

        output_path = output_dir / f"{month_start.year:04d}_{month_start.month:02d}.csv.gz"
        wrote_any = False

        with gzip.open(output_path, "wt", encoding="utf-8", newline="") as handle:
            day = month_start
            while day < next_month and day < stop:
                wrote_any = append_month(day, handle, wrote_any)
                day += timedelta(days=1)

        if not wrote_any:
            output_path.unlink(missing_ok=True)

        print(f"[1m] finished {month_start.year:04d}_{month_start.month:02d}")
        current = next_month

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…