semvec/pypi-packages huggingface dataset:
timewheel-scheduler 0.3.0
Async crontab like scheduler
License: MIT

## Introduction

This is an asynchronous job scheduler with crontab syntax.

## How to use

Here is a basic example:

```python
# Should run as-is
import asyncio
from typing import Any
from datetime import datetime

from timewheel import TimeWheel
from timewheel.schedule import Schedule


async def my_job():
    print("hello from job!")
    await asyncio.sleep(3)


async def my_another_job(some_value: Any):
    print(f"Hey! This is my some_value {some_value}")
    await asyncio.sleep(1)

    
def my_special_job():
    print("Doing the special job!!")
    
async def main():
    timewheel = TimeWheel(schedules=[
        # Runs every 29 minutes using America/Sao_Paulo
        # as base
        Schedule(name="my-schedule", 
                 expression="*/29 * * * *",
                 timezone="America/Sao_Paulo",
                 job=my_job),
        # Runs every 5th, 10th and 20th minute on wednesday
        # using America/Los_Angeles tz as base
        Schedule(name="another-schedule", 
                 expression="5,10,20 * * * 2", 
                 timezone="America/Los_Angeles",
                 job=my_another_job),
        # Runs the special-job every minute except on 2021-12-31
        Schedule(name="special-job",
                 expression="* * * * *",
                 timezone="America/Sao_Paulo",
                 excluded_dates=[datetime.strptime('2021-12-31', '%Y-%m-%d')],
                 job=my_special_job),
        # Runs the jobs every minute between monday and friday 
        # using the range notation
        Schedule(name='another-job',
                 expression='* * * * 0-4',
                 timezone='America/Sao_Paulo',
                 job=my_special_job)
    ])
    await timewheel.run()


asyncio.get_event_loop().run_until_complete(main())
```

The timezone information is based on [IANA](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
propertybag 0.1.9
Flexible property bag functions
License: MIT


# propertybag

Flexible property bag class

``` Python

    import propertybag as pb

    bag = pb.Bag({'a':'b'}, c='d')
    print(bag)                      # > {"a": "b", "c": "d"}

    bag.b.c.d.e = 42
    print(bag.b.c.d.e)              # > 42
    print(bag.toJson())             # > {"a": "b", "c": "d", "b": {"c": {"d": {"e": 42}}}}

    # Returns a bag object
    bag.b.c['d']

    # Returns a Bag() object
    bag.b.c.d

```

---------------------------------------------------------------------
## Table of contents

* [Install](#install)
* [Examples](#examples)
* [References](#references)

&nbsp;

---------------------------------------------------------------------
## Install

    $ pip3 install propertybag

&nbsp;


---------------------------------------------------------------------
## Examples

``` Python

    import propertybag as pb

    Log = print

    # Init with kw args
    bag = pb.Bag(a='b', c='d')
    Log(bag.toJson(True))                   # > {
                                            # >   "a": "b",
                                            # >   "c": "d"
                                            # > }

    # Init with dict
    bag = pb.Bag({'a':'b', 'c':'d'})
    Log(bag.toJson())                       # > {"a": "b", "c": "d"}

    # Init with both
    bag = pb.Bag({'a':'b'}, c='d')
    Log(bag)                                # > {"a": "b", "c": "d"}

    # Set deep value
    bag.d.e.f.g.h = 42
    Log(bag)                                # > {"a": "b", "c": "d", "d": {"e": {"f": {"g": {"h": 42}}}}}

    # Read deep value
    Log(bag.d.e.f.g.h)                      # > 42
    try:
        Log(bag.d.e.f.g.i)                  # > Throws ValueError() exception
    except ValueError as e:
        Log(e)                              # > Value not set

    # If you don't want exceptions thrown when value doesn't exist, provide a default
    bag_nt = pb.Bag({'a': 'b'}, '')
    Log(bag_nt.d.e.f.g.i)                   # > ''

    # Use get/set for compound keys
    bag.set("d.e.f.g.h", 43)
    Log(bag.get("d.e.f.g.h"))               # > 43
    Log(bag.get("d.e.f.g.i", "default"))    # > "default"

    # Iterate
    Log('--------------------------------------------')
    for k,v in bag.items():
        Log(k, v)

    Log('--------------------------------------------')
    for k in bag:
        Log(k)

    Log('--------------------------------------------')
    for v in bag.values():
        Log(v)

```

&nbsp;


---------------------------------------------------------------------
## References

- Python
    - https://www.python.org/

- pip
    - https://pip.pypa.io/en/stable/