Set up continuous P2P VES/USDT market history data collection, normalization, validation, and date-partitioned Parquet storage.
15 lines
383 B
Python
15 lines
383 B
Python
import random
|
|
from datetime import datetime, timezone
|
|
|
|
def jitter(interval: float) -> float:
|
|
"""
|
|
Returns a value within interval ± 10%
|
|
"""
|
|
variation = interval * 0.10
|
|
return interval + random.uniform(-variation, variation)
|
|
|
|
def now_utc() -> datetime:
|
|
"""
|
|
Returns the current UTC datetime with timezone info.
|
|
"""
|
|
return datetime.now(timezone.utc)
|