semvec/pypi-packages huggingface dataset:
paas-service 2.0.3
A Django application for developing BK-PaaS add-on services.
License: MIT
Requires Python: <3.12,>=3.8

# Paas Service

蓝鲸 PaaS 平台增强服务框架


## 版本历史

详见 `CHANGES.md`。

## 使用指南

1. 更新 settings：
```python
INSTALLED_APPS = [
    ...
    'paas_service',
    ...
]

MIDDLEWARE = [
    ...
    'paas_service.auth.middleware.VerifiedClientMiddleware',
    ...
]

# 数据库敏感字段加密 Key
BKKRILL_ENCRYPT_SECRET_KEY = base64.b64encode(b'\x01' * 32)

# 与 PaaS 平台通信的 JWT 信息
PAAS_SERVICE_JWT_CLIENTS = [
    {
        "iss": "paas-v3",
        "key": "123..........",
        "algorithm": "HS256",
    },
]

# 增强服务供应商类
PAAS_SERVICE_PROVIDER_CLS = "svc_xxx.vendor.provider.Provider"
# 增强服务实例信息渲染函数
PAAS_SERVICE_SVC_INSTANCE_RENDER_FUNC = "svc_xxx.vendor.render.render_instance_data"

# 设置语言，注意：目前国际化只支持: 简体中文 和 English
LANGUAGE_CODE = 'zh-cn'

LANGUAGES = [("zh-cn", "简体中文"), ("en", "English")]
```

2. 单元测试

首先，安装 pytest、pytest-django。

然后执行 `make test` 运行所有单元测试。
spacy-coref 0.1.1
Lightweight cross-lingual coreference resolution with spaCy using ONNX Runtime inference of transformer models.
License: MIT
Requires Python: <3.13,>=3.11
Keywords: coreference, coreference resolution, onnx, onnxruntime, spacy, nlp, natural language processing, transformers, crosslingual, multilingual, huggingface

# spacy-coref

Lightweight, fast co-reference resolution using a distilled version of AllenNLP's coreference model (exported to ONNX). 

## ✨ Features

- 🧠 Cross-lingual coreference resolution
- 🪶 Lightweight model based on AllenNLP’s coref modeling
- ⚡  Fast inference via ONNX
- 🔌 Easy integration with spaCy

---

## 📦 Installation

```bash
$ pip install spacy-coref
```

## 🚀 Quickstart

Usage as a standalone component

```python
from spacy_coref import CoreferenceResolver, decode_clusters

resolver = CoreferenceResolver.from_pretrained("talmago/allennlp-coref-onnx-mMiniLMv2-L12-H384-distilled-from-XLMR-Large")

sentences = [
    ["Barack", "Obama", "was", "the", "44th", "President", "of", "the", "United", "States", "."],
    ["He", "was", "born", "in", "Hawaii", "."]
]

pred = resolver(sentences)

print(decode_clusters(sentences, pred["clusters"][0]))

# Output is:
# [['Barack Obama', 'He']]
```

Usage with spaCy

```python
import spacy

from spacy_coref import create_coref_minilm_component

nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("coref_minilm")

doc = nlp("Barack Obama was born in Hawaii. He was elected president in 2008.")
print(doc._.coref_clusters[0])
print(doc._.cluster_heads)
print(doc._.resolved_text)

# Output is:
# [Barack Obama, He]
# {'Barack Obama': Barack Obama}
# Barack Obama was born in Hawaii. Barack Obama was elected president in 2008.
```

## 🛠️ Development

Set up virtualenv

```sh
$ make env
```

Set PYTHONPATH

```sh
$ export PYTHONPATH=$PYTHONPATH:/Users/talmago/git/spacy-coref/src
```

Code formatting

```sh
$ make format
```

### 📚 References

This project builds on the work of the following repositories:

- **[crosslingual-coreference](https://github.com/davidberenstein1957/crosslingual-coreference)**  
  David Berenstein's implementation of multilingual coreference resolution, adapted from the original AllenNLP coref model.  
  GitHub: [davidberenstein1957/crosslingual-coreference](https://github.com/davidberenstein1957/crosslingual-coreference)

- **[AllenNLP coreference model](https://github.com/allenai/allennlp-models/tree/b1f372248c17ad12684d344955fbcd98e957e77e/allennlp_models/coref)**  
  Official AllenNLP implementation of coreference resolution.  
  GitHub: [allenai/allennlp-models](https://github.com/allenai/allennlp-models)
django-secux 6.0.0
All-in-One Django Security & Optimization
License: MIT
Requires Python: >=3.8

# django-secux - All-in-One Django Security & Optimization

![django-secux](https://raw.githubusercontent.com/xo-aria/django-secux/refs/heads/main/django-secux.png)

[![Downloads](https://pepy.tech/badge/django-secux)](https://pepy.tech/project/django-secux)
[![PyPI version](https://img.shields.io/pypi/v/django-secux.svg)](https://pypi.org/project/django-secux/)
![Django](https://img.shields.io/badge/Django-3.2%20|%204.2%20|%205.0-green?logo=django)
[![License](https://img.shields.io/github/license/xo-aria/django-secux)](https://github.com/xo-aria/django-secux/blob/main/LICENSE)
![Status](https://img.shields.io/badge/status-active-brightgreen)

- [Document](https://xo-aria.github.io/django-secux/doc/) 
- [Telegram](https://t.me/xo_community_dev)
- [Author](https://t.me/ghanon_dar)

### For install
```
pip install django-secux
```

### For update package
```
pip install django-secux -U
```

## Features
`v1.0.0`
- [+] AI ratelimit ( Check website/page traffic, and when abnormal traffic is detected, block the page. )
- [+] Fake CDN ( Smart compressor with built-in caching )

`v2.0.0`
- [+] Minifing all pages

`v3.0.0`
- [+] Manage user sessions ( Manage an account with all sessions for that account )
- [+] Utils ( A simple and safe method for get `IP` and `User Agent` and ... )

`v4.0.0`
- [+] Attack notification ( you can use it for `signals.py` )
- [+] Compress images size ( for `imageField` in `models` )

`v5.0.0` **[SOON]**
- [+] Captcha ( A captcha image system )
- [+] JS Challenge ( a way to detect robots )
- Honeypot ( A trap for url and fake web page )

`v6.0.0` **[SOON]**
- CSP Rules
- SEO ( automatic generate meta seo tags )
- Support `async`

`v7.0.0` **[SOON]**
- Admin dashboard
- Detect suspicious file on upload ( e.g: `image.png.php` )
- Session Signature ( Prevent session theft )

`v8.0.0` **[SOON]**
- Protect uploaded files
- Detect and clean up useless files for `media` and `static`

`v9.0.0` **[SOON]**
- Sensitive path locking ( It has a password system that repels bots and the password is secured in the backend )
- Smart protection ( sensitive pages such as login and contact us are automatically closed when attacked )
- Creating Automatic Preloading Meta Tags ( CAPMT )
adapter-client 3.1.0.dev1
Клиент для взаимодействия со СМЭВ3 посредством Адаптера
License: MIT

# Клиент для взаимодействия со СМЭВ3 посредством Адаптера
## Подключение
settings:

    INSTALLED_APPS = [
        'adapter_client'
    ]

services:
    
    from adapter_client.adapters.smev.adapter import adapter
    from adapter_client.adapters.smev.services.base import AbstractService
    from adapter_client.core.domain.model import Message


    class ROGDINFService(AbstractService):
        """
        Сервис обрабатывающий сообщения со сведениями о рождении.
        """
        message_type = 'urn://x-artefacts-zags-rogdinf/root/112-51/4.0.1'
    
        def process_message(self, message: Message):
			# сообщение на которое получен ответ
			reply_to = message.reply.to
            ...
    
    class ApplicationRequestService(AbstractService):
        """
        Сервис обрабатывающий запросы на зачисление (в качестве поставщика).
        """
        message_type = (
            'http://epgu.gosuslugi.ru/concentrator/kindergarten/3.2.1'
        )
        def process_message(self, message: Message):
            # обрабатываем сообщение-запрос
            ...

            # отправляем ответ на запрос
            adapter.send(
                Message(
                    # необходимо указать что сообщение является ответом
                    reply_to=message,
                    # остальные поля сообщения
                    ...
                )
            )


apps:

    from django.apps.config import AppConfig as AppConfigBase

    class AppConfig(AppConfigBase):

        name = __package__

        def ready(self):
            self._init_adapter_client()
            self._register_services()

        def _init_adapter_client(self):
            from adapter_client.config import ProductConfig, set_config
            from tasks import BaseTask

            set_config(ProductConfig(async_task_base=BaseTask))
        
        def _register_services(self):
        from adapter_client.adapters.smev.adapter import adapter
        from .services import ApplicationRequestService, ROGDINFService
        
        adapter.register_service(ApplicationRequestService(), ROGDINFService())


## Запуск тестов
    $ tox

## API

### Передача сообщения

    from adapter_client.adapters.smev.adapter import adapter
    from adapter_client.core.domain.model import Message

    message = Message(
        message_type='Foo',
        body='<foo>bar</foo>',
        attachments=['http://domain.com/attach1', 'http://domain.com/attach2'],
        test=True
    )

    adapter.send(message)

Дальнейшая обработка сообщений производится Celery в фоновом режиме.

### Получение ответа на сообщение

Ответы на отправленные сообщения собираются периодической задачей 
и передаются зарегистрированным сервисам.