semvec/pypi-packages huggingface dataset:
python-ulid-django 1.3.0
ULID (Universally Unique Lexicographically Sortable Identifier) support for Django.
License: MIT
Requires Python: >=3.10

# python-ulid-django

[ULID (Universally Unique Lexicographically Sortable Identifier)][ulid-spec] support for
Django.

This package uses the ULID type implemented by [`python-ulid`][python-ulid].

> This package is heavily inspired by [`django-ulid`][django-ulid]. The reason I'm
> reinventing the wheel is that I want to use [`python-ulib`][python-ulid]'s
> ULID implementation.

## Usage

### Installation

```shell
pip install python-ulid-django
```

### Model Field

You can then add `ULIDField` to your Django model just like other fields.

Example:

```python
from django.contrib.auth.models import AbstractUser
from ulid import ULID
from ulid_django.models import ULIDField


class User(AbstractUser):
    id = ULIDField(primary_key=True, default=ULID, editable=False)
```

### URL Converter

There is also a URL converter can be used.

```python
from django.urls import path, register_converter
from ulid import ULID
from ulid_django.converters import ULIDConverter


def user_detail_view(request, user_id):
    assert isinstance(user_id, ULID)
    ...


register_converter(ULIDConverter, "ulid")

urlpatterns = [
    path("user/<ulid:user_id>/", user_detail_view),
    ...,
]
```

## Development

Prerequisite: [PDM](https://pdm-project.org/latest/)

Environment setup: `pdm sync`

Run linters: `pdm lint`

Test: `pdm test`

[ulid-spec]: https://github.com/ulid/spec

[python-ulid]: https://github.com/mdomke/python-ulid

[django-ulid]: https://github.com/ahawker/django-ulid
port-oneclick-mw 0.1.3
A Python middleware service for managing Port.io guides (blueprints, actions, mappings, widgets)
License: MIT
Requires Python: >=3.8
Keywords: port, port.io, middleware, blueprints, automation

# Port OneClick Middleware

A Python middleware service for managing Port.io guides, blueprints, actions, mappings, and widgets.

## Quick Start

```bash
# Install dependencies
pip install -r requirements.txt

# Set up environment variables
export PORT_CLIENT_ID=your_client_id
export PORT_CLIENT_SECRET=your_client_secret

# Run the middleware
python main.py
```

## Configuration

### Required Environment Variables

```bash
PORT_CLIENT_ID=your_client_id
PORT_CLIENT_SECRET=your_client_secret
```

### Optional Environment Variables

```bash
# Directory paths (defaults shown)
BLUEPRINTS_DIR=setup/blueprints
ACTIONS_DIR=setup/actions
MAPPINGS_DIR=setup/mappings
WIDGETS_DIR=setup/widgets

# Action filter - what to process
ACTION=all  # Options: all, blueprints, actions, mappings, widgets

# Required folders - comma-separated list
# Only folders in this list will be required to exist
EXPECTED_FOLDERS=blueprints,actions,mappings,widgets  # Default: all folders
```

## Features

### Flexible Folder Requirements

You can specify which folders are required using the `EXPECTED_FOLDERS` environment variable:

- **Default behavior**: All folders (blueprints, actions, mappings, widgets) are required
- **Custom requirements**: Only folders listed in `EXPECTED_FOLDERS` are required
- **Missing non-required folders**: Will be skipped without causing errors

**Example:**

```bash
# Only require blueprints and widgets folders
EXPECTED_FOLDERS=blueprints,widgets python main.py

# If actions or mappings folders are missing, they will be skipped
```

## Usage Examples

```bash
# Process all resources
python main.py

# Process only blueprints
ACTION=blueprints python main.py

# Process everything, but only require blueprints and actions to exist
EXPECTED_FOLDERS=blueprints,actions python main.py
```

For detailed configuration options, see [CONFIG.md](CONFIG.md).