semvec/pypi-packages huggingface dataset:
cachingutils 1.0.7
Utilities to make caching data easier
License: MIT
Requires Python: >=3.9,<4.0

# cachingutils

Utilities to make caching data easier

## Examples

Basic caching:

```py
from cachingutils import cached


@cached()
def fib(n: int) -> int:
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)

print(fib(100))  # 354224848179261915075
```

Caching with your own cache object:

```py
from cachingutils import Cache, cached


my_cache = Cache()

@cached(cache=my_cache)
def fib(n: int) -> int:
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)

print(fib(100))  # 354224848179261915075
```

Caching with an LRU cache:

```py
from cachingutils import LRUCache, cached


@cached(cache=LRUCache(2, timeout=60), include_posargs=[0])
def fetch_thing(thing_id: int, thing_name: str) -> tuple[int, str]:
    return thing_id, thing_name  # Imagine this is a call to an API

print(fetch_thing(123, "456"))  # (123, "456")
print(fetch_thing(123, "789"))  # (123, "456")

fetch_thing(567, "789")
fetch_thing(789, "456")

print(fetch_thing(123, "456"))  # Cache miss
```

Async caching:

```py
from asyncio import run

from cachingutils import acached


@acached()
async def fib(n: int) -> int:
    if n < 2:
        return n
    return await fib(n - 1) + await fib(n - 2)

print(run(fib(100)))  # 354224848179261915075
```

Caching specific positional args:

```py
from cachingutils import cached


@cached(include_posargs=[0])
async def add(a: int, b: int) -> int:
    return a + b

print(add(1, 2))  # 3
print(add(2, 2))  # 3
print(add(2, 3))  # 5
```

Caching specific keyword args:

```py
from cachingutils import cached


@cached(include_posargs=[0], include_kwargs=['c'])
def add(a: int, b: int, *, c: int) -> int:
    return a + b

print(add(1, 2, c=3))  # 3
print(add(2, 2, c=3))  # 4
print(add(2, 3, c=3))  # 4
```

Caching with a timeout:

```py
from time import sleep

from cachingutils import cached


@cached(timeout=1, include_posargs=[0])
def add(a: int, b: int) -> int:
    return a + b

print(add(1, 2))  # 3
print(add(1, 3))  # 3
sleep(2)
print(add(1, 3))  # 4
```

Using a raw `Cache` object:

```py
from time import sleep

from cachingutils import Cache


my_cache: Cache[str, int] = Cache(timeout=5)

my_cache["abc"] = 123

print(my_cache["abc"])  # 123

sleep(6)

print(my_cache["abc"])  # KeyError: 'abc'
```

---

All of the above decorators also work within classes:

```py
from cachingutils import cached


class MyClass:
    @cached()
    def fib(self, n: int) -> int:
        if n < 2:
            return n
        return self.fib(n - 1) + self.fib(n - 2)


my_class = MyClass()

print(my_class.fib(100))  # 354224848179261915075
```
pip-services3-datadog 3.0.1
Communication components for Pip.Services in Python
License: MIT

# <img src="https://uploads-ssl.webflow.com/5ea5d3315186cf5ec60c3ee4/5edf1c94ce4c859f2b188094_logo.svg" alt="Pip.Services Logo" width="200"> <br/> DataDog components for Pip.Services in Python

This module is a part of the [Pip.Services](http://pipservices.org) polyglot microservices toolkit.
It contains the DataDog logger and performance counters components.

The module contains the following packages:
- **Build** - contains a class used to create DataDog components by their descriptors.
- **Clients** - contains constants and classes used to define REST clients for DataDog
- **Count** - contains a class used to create performance counters that send their metrics to a DataDog service
- **Log** - contains a class used to create loggers that dump execution logs to a DataDog service.

<a name="links"></a> Quick links:

* [Configuration](https://www.pipservices.org/recipies/configuration)
* [API Reference](https://pip-services3-python.github.io/pip-services3-datadog-python/index.html)
* [Change Log](CHANGELOG.md)
* [Get Help](https://www.pipservices.org/community/help)
* [Contribute](https://www.pipservices.org/community/contribute)

## Use

Install the Python package as
```bash
pip install pip-services3-datadog
```

## Develop

For development you shall install the following prerequisites:
* Python 3.7+
* Visual Studio Code or another IDE of your choice
* Docker

Install dependencies:
```bash
pip install -r requirements.txt
```

Run automated tests:
```bash
python test.py
```

Generate API documentation:
```bash
./docgen.ps1
```

Before committing changes run dockerized build and test as:
```bash
./build.ps1
./test.ps1
./clear.ps1
```

## Contacts

The Python version of Pip.Services is created and maintained by
- **Sergey Seroukhov**
- **Danil Prisiazhnyi**
pip-services3-aws 3.0.6
Communication components for Pip.Services in Python
License: MIT

# <img src="https://uploads-ssl.webflow.com/5ea5d3315186cf5ec60c3ee4/5edf1c94ce4c859f2b188094_logo.svg" alt="Pip.Services Logo" width="200"> <br/> AWS specific components for Python

This module is a part of the [Pip.Services](http://pipservices.org) polyglot microservices toolkit.

This module contains components for supporting work with the AWS cloud platform.

The module contains the following packages:
- **Build** - factories for constructing module components
- **Clients** - client components for working with Lambda AWS
- **Connect** - components of installation and connection settings
- **Container** - components for creating containers for Lambda server-side AWS functions
- **Count** - components of working with counters (metrics) with saving data in the CloudWatch AWS service
- **Log** - logging components with saving data in the CloudWatch AWS service


<a name="links"></a> Quick links:

* [Configuration](https://www.pipservices.org/recipies/configuration)
* [API Reference](https://pip-services3-python.github.io/pip-services3-aws-python/index.html)
* [Change Log](CHANGELOG.md)
* [Get Help](https://www.pipservices.org/community/help)
* [Contribute](https://www.pipservices.org/community/contribute)

## Use

Install the Python package as
```bash
pip install pip-services3-aws
```

## Develop

For development you shall install the following prerequisites:
* Python 3.7+
* Visual Studio Code or another IDE of your choice
* Docker

Install dependencies:
```bash
pip install -r requirements.txt
```

Run automated tests:
```bash
python test.py
```

Generate API documentation:
```bash
./docgen.ps1
```

Before committing changes run dockerized build and test as:
```bash
./build.ps1
./test.ps1
./clear.ps1
```

## Contacts

The Python version of Pip.Services is created and maintained by
- **Sergey Seroukhov**
- **Danil Prisiazhnyi**