<commit_before>from crontab import CronTab


DAILY_MIDNIGHT = '* 0 * * *'
DAILY_NOON = '* 12 * * *'
WEEKLY = '* 12 * * 1'


MANAGE_PY_CRON_JOBS = [
    (DAILY_NOON, 'send_daily_notifications'),
    (DAILY_NOON, 'send_clarification_deadline_passed_notifications'),
    (WEEKLY, 'send_weekly_notifications'),
    (WEEKLY, 'sanction_sync_and_rescan'),
]


if __name__ == '__main__':
    cron = CronTab(user=True)

    for frequency, command_name in MANAGE_PY_CRON_JOBS:
        job = next(cron.find_comment(command_name), None) or cron.new(
            f'python /code/manage.py {command_name}', comment=command_name
        )
        job.setall(frequency)

    cron.write()<commit_msg>Added crontab for syncing erp data<commit_after>from crontab import CronTab


DAILY_MIDNIGHT = '* 0 * * *'
DAILY_NOON = '* 12 * * *'
WEEKLY = '* 12 * * 1'


MANAGE_PY_CRON_JOBS = [
    (DAILY_NOON, 'send_daily_notifications'),
    (DAILY_NOON, 'send_clarification_deadline_passed_notifications'),
    (WEEKLY, 'send_weekly_notifications'),
    (WEEKLY, 'sanction_sync_and_rescan'),
    (WEEKLY, 'sync_unicef_erp_data'),
]


if __name__ == '__main__':
    cron = CronTab(user=True)

    for frequency, command_name in MANAGE_PY_CRON_JOBS:
        job = next(cron.find_comment(command_name), None) or cron.new(
            f'python /code/manage.py {command_name}', comment=command_name
        )
        job.setall(frequency)

    cron.write()
{'fraction_non_alphanumeric': 0.12508784258608574, 'fraction_numerical': 0.008432888264230498, 'mean_word_length': 3.8767123287671232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5357918', 'n_tokens_mistral': 598, 'n_tokens_neox': 541, 'n_words': 88}