semvec/pypi-packages huggingface dataset:
jinja-try-catch 0.1.1
Jinja2 extension adding {% try %} {% catch %} exception handling
License: MIT
Requires Python: >=3.7

# jinja-try-catch
A Jinja2 extension providing exception handling within templates.

```jinja
{%- try -%}
  {{ 1 / 0 }}
{%- catch -%}
  Can't divide by zero!
{%- endtry -%}
```
```
Can't divide by zero!
```

This extension works in both sync and async environments, as well as the native variants, too.

# Quickstart
```shell
pip install jinja-try-catch
```

And add the `TryCatchExtension` to your `Environment` extensions list:
```python
import jinja2
from jinja_try_catch import TryCatchExtension

jinja_env = jinja2.Environment(extensions=[TryCatchExtension])
```


# Usage
### Suppressing errors
Simply omit the `{% catch %}` to silently swallow exceptions
```jinja
{%- try -%}
  {{ 1 / 0 }}
{%- endtry -%}
```
```
```

### Error messages
Define a `{% catch %}` to render something else if an exception is raised
```jinja
{%- try -%}
  {{ 1 / 0 }}
{%- catch -%}
  There are infinite zeroes, duh
{%- endtry -%}
```
```
There are infinite zeroes, duh
```

### Display exceptions
The raised exception is exposed within the `{% catch %}` through the `{{ exception }}` variable
```jinja
{%- try -%}
  {{ 1 / 0 }}
{%- catch -%}
  Uh-oh, an error occurred:
  {{ exception.__class__.__name__ }}: {{ exception }}
{%- endtry -%}
```
```
Uh-oh, an error occurred:
  ZeroDivisionError: division by zero
```
spektrixpython 0.6.1
A Python 3 module for interacting with Spektrix API v3. This module is written by a third party and is not supported by or affiliated with Spektrix.
License: MIT
Requires Python: >=3.7,<4.0

# spektrixpython
A Python 3 module for interacting with Spektrix API v3. This module is written
by a third party and is not supported by or affiliated with Spektrix.

For API v3 documentation, visit `https://system.spektrix.com/<clientname>/api/v3/help`,
replacing `<clientname>` with your Spektrix system name.

## Usage

### Installation

`pip install spektrixpython`

### Example

```python
from spektrixpython import SpektrixCredentials, SpektrixRequest


credentials = SpektrixCredentials(client_name="SPEKTRIX CLIENT NAME",
                                  api_user="API USERNAME",
                                  api_key="API KEY")

# Get a list of events
events = SpektrixRequest(endpoint='events', credentials=credentials).get()
print(events)

# Create a new basket
basket = SpektrixRequest(endpoint='baskets', credentials=credentials).post()['id']

# Add a merchandise item to the newly created basket
endpoint = 'baskets/{}/merchandise'.format(basket)

# Replace this stockItem Id with one from your Spektrix system.
payload = {'stockItem':'1AHGJDSMMPLMPPGNLJBQVLBRSKVDLQRPP'}

SpektrixRequest(endpoint=endpoint, credentials=credentials).post(payload)
```

## License

This module is licensed under the MIT License. Please see the LICENSE file for
full details.