semvec/pypi-packages huggingface dataset:
opsramp-analytics-fips-test 1.0.0
OpsRamp Analytics SDK
Requires Python: >=3.6

## OpsRamp Analytics Utilities

This is the SDK for writing OpsRamp analytics apps. It is based on [dash](https://plotly.com/dash/), and it has a number of utility functions.

It contains [analysis wrapper project](https://github.com/opsramp/analysis-wrapper).

It is published on [Pypi](https://pypi.org/project/opsramp-analytics-utils/)

#### How to publish on Pypi

After make updates on SDK, modify the version in _setup.py_.

```
python setup.py sdist bdist_wheel
python -m twine upload dist/*

Note: if above command not works, then use below command
python -m twine upload --skip-existing dist/*
```

- To upgrade the sdk for your app
```
pip install --no-cache-dir --upgrade opsramp-analytics-utils
```
dj-cache 0.1
A Django app that offers a db-backed eventually consistent cache.
Requires Python: >=3.9

# dj-cache

A database-backed eventually consistent Last-Write-Wins cache for Python functions inside a Django application.

## Installation

```sh
pip install \
    git+https://github.com/aalekhpatel07/dj-cache.git#subdirectory=dj-cache
```

## Usage

Example: As a plain decorator on arbitrary functions.

```python
from dj_cache.decorators import cached


@cached(ttl_seconds=10)
def my_expensive_function():
    ...

# The expensive function is only called and waited on once.
# Subsequent calls will be cached and in case the cached value 
# is expired/stale, an update will be triggered in the background 
# without blocking the function call, which will return the last stored value.
# This ensures a Last-Write-Wins cache that is eventually consistent.

# Note: Concurrent calls to update the cache while an update is underway are 
#       ignored.

```

Example: Caching an expensive function used inside a Django view.


```python
# urls.py

import time
from django.urls import path
from django.http import HttpResponse

from dj_cache.decorators import cached


@cached(ttl_seconds=60)
def expensive_function():
    time.sleep(5)
    return 42


def home(request):
    value = expensive_function()
    return HttpResponse(f"Expensive function returned: {value}")


urlpatterns = [
    path("/", home),
]

```