semvec/pypi-packages huggingface dataset:
triggercmd 0.0.36
Python agent for TRIGGERcmd cloud service.
Requires Python: >=3.8
Keywords: triggercmd, alexa, echo-dot

# TRIGGERcmd Python Package

For the full TRIGGERcmd agent, visit https://triggercmd.com.

Use this package to listen for triggers sent to a computer in your TRIGGERcmd account.

Send triggers with Amazon Alexa, Google Assistant, IFTTT, Zapier, Smart Things, etc.  See [this page](https://www.triggercmd.com/forum/topic/30/list-of-ways-to-trigger-your-commands) for more ways.

## Usage:

```
import json
from triggercmd import agent

computer_id = (your triggercmd computer id)
token = (your triggercmd token)

def my_function(msg):
    print(msg)
    message = json.loads(msg)
    print("Received this trigger:", message['trigger'], "and these parameters:", message['params'])

agent.connect(computer_id, token, my_function)
```

## Example output:

```
Connected
{"trigger":"Notepad","id":"13123391234567891acbf124","params":"on"}
Received this trigger: Notepad and these parameters: on
{"trigger":"Calculator","id":"13123391234567891acbf123","params":"on"}
Received this trigger: Calculator and these parameters: on
{"trigger":"Calculator","id":"13123391234567891acbf123","params":"off"}
Received this trigger: Calculator and these parameters: off
```

## Based on this project:
https://github.com/gilsdav/python_sails_websocket_client/tree/master
easy-reqeusts 1.1.3
A Python library for easiest HTTP requests, handling automatic retries, browser-like headers and built on the official `requests` library for reliability.
Requires Python: >=3.10

# Easy-Requests

![publishing workflow](https://github.com/hazel-noack/easy-requests/actions/workflows/python-publish.yml/badge.svg)

A Python library for simplified HTTP requests, featuring rate limiting, browser-like headers, and automatic retries. Built on the official `requests` library for reliability.

## Features

- Save responses to cache
- Use any session (e.g., bypass Cloudflare using [cloudscraper](https://pypi.org/project/cloudscraper/))
- Configurable wait between requests without thread blocking
- Automatic retries for failed requests

```bash
pip install easy-requests
```

## Usage

### Basic Usage

```python
from easy_requests import Connection, init_cache
 
init_cache(".cache")

connection = Connection()
# to generate headers that mimic the browser
connection.generate_headers()

response = connection.get("https://example.com")
```

### Using with Cloudscraper

```python
from easy_requests import Connection
import cloudscraper

connection = Connection(cloudscraper.create_scraper())
response = connection.get("https://example.com")
```

### Configuring cache

This won't use caching without you configuring it. 

You can configure the default cache either with environment variables or using `init_cache`. The env keys are `EASY_REQUESTS_CACHE_DIR` and `EASY_REQUESTS_CACHE_EXPIRES` (in days).

```py
from easy_requests import init_cache

init_cache(".cache")
```

Alternatively you can pass arguments into `Connection(...)` and the request function:

- `cache_enabled: Optional[bool]`
- `cache_directory: Optional[str]`
- `cache_expires_after: Optional[timedelta]`

```py
from easy_requests import Connection

Connection(
    cache_enabled = True
)
```

If you pass in `cache_enabled=True` it will raise a Value error if no cache directory was found.