semvec/pypi-packages huggingface dataset:
django-lti 0.9.2
LTI tool support for Django
Requires Python: >=3.9

# django-lti

A [Django reusable app](https://docs.djangoproject.com/en/4.0/intro/reusable-apps/) providing support for LTI Advantage.

## Installation

Install using pip.

```
pip install django-lti
```

## Setup

Start by adding `lti_tool` to your project's `INSTALLED_APPS`.

```python
INSTALLED_APPS = [
    ...
    "lti_tool",
]
```

Then, add `lti_tool.middleware.LtiLaunchMiddleware` to the `MIDDLEWARE` setting.
It's important to list the `LtiLaunchMiddleware` _after_ `SessionMiddleware`.

```python
MIDDLEWARE = [
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'lti_tool.middleware.LtiLaunchMiddleware',
]
```

Finally, run migrations to initialize the needed database tables.

```
python manage.py migrate lti_tool
```

## Usage

### Adding JWKS and OIDC initiation URLs

To allow LTI platforms to retrieve a JWKS and initiate a launch, add paths for
`lti_tool.views.jwks` and `lti_tool.views.OIDCLoginInitView` to `urls.py`

```python
...

from lti_tool.views import jwks, OIDCLoginInitView

urlpatterns = [
    path(".well-known/jwks.json", jwks, name="jwks"),
    path("init/<uuid:registration_uuid>/", OIDCLoginInitView.as_view(), name="init"),
]

```

### Generating and rotating keys

Keys for the JWKS can be generated using the `rotate_keys` management command.

```
python manage.py rotate_keys
```

### Registering an LTI platform

An LTI platform can be registered through the Django admin, or using a custom
interface.

### Handling an LTI launch

To handle the LTI launch, inherit from `LtiLaunchBaseView` and implement the handler
methods for the types of LTI message types that the application supports.

```python
class ApplicationLaunchView(LtiLaunchBaseView):

    def handle_resource_launch(self, request, lti_launch):
        ...  # Required. Typically redirects the users to the appropriate page.

    def handle_deep_linking_launch(self, request, lti_launch):
        ...  # Optional.

    def handle_submission_review_launch(self, request, lti_launch):
        ...  # Optional.

    def handle_data_privacy_launch(self, request, lti_launch):
        ...  # Optional.
```

Each handler method receives the request, as well as a `LtiLaunch` object.

When a session is initiated by an LTI launch, data about the launch is available from
the request at `request.lti_launch` as an `LtiLaunch` object. During a non-LTI session
`request.lti_launch` will refer to an `AbsentLtiLaunch` object.

It is possible to distinguish between `LtiLaunch` and `AbsentLtiLaunch` objects using
the `.is_present` and `.is_absent` properties.
data7 1.0.1
Data7 streams CSV/Parquet datasets over HTTP from SQL queries.
Requires Python: >=3.11
Keywords: CSV, HTTP, Parquet, SQL, database, dataset

# Data7 ⚡ Open your data in minutes

> Pronounced data·set (**7** like **sept** in French).

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jmaupetit/data7/quality.yml)
![PyPI - Version](https://img.shields.io/pypi/v/data7)

## The idea 💡

**TL;DR** Data7 is a high performance web server that generates dynamic datasets
(in [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) or
[Parquet](https://en.wikipedia.org/wiki/Apache_Parquet) formats) from existing
databases and streams them over HTTP 🎉

## A quick example

Let say you have a `restaurant` table in your PostgreSQL database, and you want
to make this table an always-up-to-date dataset that can be easily used by the
rest of the world.

All you have to do is to initialize your project:

```sh
data7 init
```

✍️ Edit configuration files:

```yaml
# settings.yaml
production:
  host: "https://data7.wonderful-places.org"
  port: 80

# .secrets.yaml
production:
  DATABASE_URL: "postgresql+asyncpg://user:pass@server:port/wonderful-places"

# data7.yaml
production:
  datasets:
    - basename: restaurants
      query: "SELECT * FROM restaurant"
```

🏎️ Fire up the `data7` server:

```sh
data7 run
```

💥 Your dataset is available at:

- [https://data7.wonderful-places.org/d/restaurants.csv](https://data7.wonderful-places.org/d/restaurants.csv)
  (CSV)
- [https://data7.wonderful-places.org/d/restaurants.parquet](https://data7.wonderful-places.org/d/restaurants.parquet)
  (Parquet)

## Documentation

The complete documentation of the project is avaiable at:
[https://jmaupetit.github.io/data7/](https://jmaupetit.github.io/data7/)

## License

This work is released under the MIT License.