semvec/pypi-packages huggingface dataset:
jinja-frontmatter 0.1.0
Frontmatter support for Jinja templates
License: MIT
Requires Python: <4.0,>=3.8

# Jinja-Frontmatter

Utilities to handle frontmatters in Jinja templates

## Installation

    pip install jinja-frontmatter

## Remove frontmatter from templates

```python
from jinja2 import Environment, PackageLoader
from jinja_frontmatter import RemoveFrontmatterLoader, get_template_frontmatter
import yaml

env = Environment(loader=RemoveFrontmatterLoader(PackageLoader(__name__, 'templates')))
frontmatter = get_template_frontmatter(env, "template.html") # frontmatter as text
frontmatter = get_template_frontmatter(env, "template.html", loads=yaml.safe_load) # frontmatter as yaml
```

## Access YAML frontmatters in templates

```python
from jinja2 import Environment, PackageLoader
from jinja_frontmatter import YAMLFrontmatterExtension

env = Environment(loader=PackageLoader(__name__, 'templates'))
env.add_extension(YAMLFrontmatterExtension)
```

In your template:

```
---
foo: bar
---
{{ frontmatter.foo }}
```
hyperflask-deploy 0.1.0
Deployment support for Hyperflask
License: MIT
Requires Python: <4.0,>=3.10

# Hyperflask-Deploy

**⚠️ This is a work in progress project which is not functionnal yet**

The infrastructure needed to independently host your Hyperflask projects.

This repository contains resources and scripts to create and manage servers to run containerized Hyperflask apps. The infrastructure is kept as simple and straighforward as possible with minimal operations needed.

This setup is meant to deploy apps on a single server. This stack can be run on cheap machines or VMs from any server/cloud providers.

 - Fully Open-Source stack that is 100% self-hostable if desired
 - Configure them using [Ansible](https://www.ansible.com/)
 - Use [Kamal](https://kamal-deploy.org/) to deploy using [Docker](https://www.docker.com/)
 - Hardened host machines
 - Full monitoring & observability using [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/)
 - [Valkey](https://valkey.io/) for in-memory storage and queues
 - Privacy minded (GDPR compliant)

Note: Hyperflask-Deploy is pre-installed when using the [Hyperflask-Start template](https://github.com/hyperflask/hyperflask-start).

## Usage

Add to your hyperflask projects:

    pip install hyperflask-deploy

This will add the `deploy` command:

    hyperflask deploy
flask-geo 0.1.0
Geolocation for Flask
License: MIT
Requires Python: <4.0,>=3.8

# Flask-Geo

Geolocation for Flask using Maxmind.

## Installation

    pip install flask-geo

## Usage

Initialize the extension:

```python
from flask import Flask
from flask_geo import Geolocation

app = Flask(__name__)
geo = Geolocation(app)
```

Download a maxmind db:

    flask download-geo-db --license-key=XXX

Get the country or city of the visitor:

```python
from flask_geo import geolocate_country, geolocate_city

@app.route("/")
def index():
    country_iso_code = geolocate_country()
    # or
    city_name, country_iso_code = geolocate_city()
```

> [!IMPORTANT]
> Geolocation results are cached in the session. To clear the cache use `clear_geo_cache()`

> [!TIP]
> When app.debug is true, you can override which ip address to use for geolocation using the `__remoteaddr` query parameter: `http://localhost:5000?__remoteaddr=1.1.1.1`

## Configuration

| Config key | Extension argument | Description | Default |
| --- | --- | --- | --- |
| FLASK_GEO_MAXMIND_DB | maxmind_db | Filename towards the maxmind db | GeoLite2-City.mmdb |
| FLASK_GEO_USE_CITY_DB | is_city_db | Whether it is the city db or the country db | True |
| FLASK_GEO_SILENT | silent | Do not raise any errors whether the db is missing or geolocation fails | True |