semvec/pypi-packages huggingface dataset:
psycopg2logger 0.4.0
Psycopg2 logging / profiling tool
License: MIT
Requires Python: >=3.9

# Psycopg2Logger
Psycopg2Logger is made to work with https://github.com/larswise/pgquerymon and is a logging library that captures PostgreSQL database queries from psycopg2 and transmits them via TCP to the monitoring application in real-time. It provides detailed SQL query logging with parameter interpolation, execution duration tracking. The logger is optimized for development use with connection pooling, reflection caching, compiled regex patterns, and async logging to minimize performance impact on your application. **Do not run this in production; this is intended for development only.**

## Installation

Install the package via pip:

```bash
pip install psycopg2logger
```

## Usage

### For FastAPI Applications

```python
from fastapi import FastAPI
from fastapisupport.middleware import Psycopg2InterceptorMiddleware

app = FastAPI()

# Add the middleware to your FastAPI application
app.add_middleware(Psycopg2InterceptorMiddleware)

@app.get("/example")
async def example_endpoint():
    # Your database logic here
    return {"message": "Example endpoint"}

# Run your FastAPI application
# uvicorn main:app --reload
```

## Monitoring Application

To view the captured SQL queries, you'll need the companion monitoring application [pgquerymon](https://github.com/larswise/pgquerymon) which provides a real-time dashboard for analyzing your database interactions.

## Features

- **Real-time SQL logging** with parameter interpolation
- **Execution duration tracking** for performance analysis
- **Intelligent caller detection** to identify source business logic
- **High-performance design** with connection pooling and caching
- **Async logging** to prevent blocking your application
- **Support for FastAPI applications**
- **Configurable performance settings** for different use cases
mkdocs-vwidalias 0.1.5
MkDocs plugin to create /<ID>/ redirects from front-matter IDs
License: MIT
Requires Python: >=3.8

# mkdocs-vwidalias

**mkdocs-vwidalias** is a tiny MkDocs plugin that generates **root-level alias URLs**
based on a page’s front-matter ID.

- Front-matter:
```yaml
  ---
  id: SV-OVERVIEW
  title: Services Overview
  ---
```

* Build output:

```
  site/SV-OVERVIEW.html
```
* When opened, it **redirects** to the canonical page (by default appending `#SV-OVERVIEW`):

```
  /path/to/page/#SV-OVERVIEW
```

Now you can share short links like:

```
https://yoursite/SV-OVERVIEW/
```

## Features

* Reads a configurable front-matter field (`id_field`, default `id`)
* Emits alias pages at `/<ID>.html` (or `/prefix/<ID>.html`)
* Optional `alias_prefix` (e.g., `/id/SV-OVERVIEW.html`)
* Optional `url_prefix` (e.g., `safe/` to produce `safe/services/#ID`)
* Optional `#ID` appended to the target (`append_hash: true`)
* Duplicate ID detection (warn or fail)
* Verbose logging for easy debugging

## Install

```bash
pip install mkdocs-vwidalias
```

## Configure (`mkdocs.yml`)

```yaml
plugins:
  - search
  - vwidalias:
      id_field: "id"          # front-matter key
      alias_prefix: ""        # "" => /<ID>.html ; "id" => /id/<ID>.html
      url_prefix: ""          # prepend to redirect target (e.g., "safe/")
      append_hash: true       # append '#<ID>' to target URL
      fail_on_duplicate: false
```

## Author pages

```markdown
---
id: SV-OVERVIEW
title: Services Overview
---

# Services Overview
Hello!
```

Build the site and you’ll get:

* Alias: `site/SV-OVERVIEW.html`
* Redirect target: `/services/overview/#SV-OVERVIEW` (default) or `safe/services/overview/#SV-OVERVIEW` when `url_prefix: "safe/"`

## Debugging

Run with verbose logs:

```bash
mkdocs build -v
# or
mkdocs serve -v
```

You should see:

```
[mkdocs_vwidalias] Aliases to emit: 1
[mkdocs_vwidalias] Emitted 1 alias pages. Prefix=''
```

## Notes

* Keep `id` values **unique** across pages.
* Works best with MkDocs **pretty URLs** (default).
* Alias pages include a canonical link to the target for SEO.