Skip to main content

Клиент для взаимодействия со СМЭВ3 посредством Адаптера

Подключение

settings:

INSTALLED_APPS = [
    'smev_agent_client',
]

apps:

from django.apps import AppConfig as AppConfigBase

class AppConfig(AppConfigBase):

    name = __package__

    def __setup_agent_client(self):
        import smev_agent_client

        smev_agent_client.set_config(
            smev_agent_client.configuration.Config(
                agent_url='http://localhost:8090',
                system_mnemonics='MNSV03',
                timeout=1,
                request_retries=1,
            )
        )

    def ready(self):
        super().ready()
        self.__setup_agent_client()

Эмуляция

Заменить используемый интерфейс на эмулирующий запросы:

smev_agent_client.set_config(
    ...,
    smev_agent_client.configuration.Config(
        interface=(
            'smev_agent_client.contrib.my_edu.interfaces.rest'
            '.OpenAPIInterfaceEmulation'
        )
    )
)

Запуск тестов

$ tox

API

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

from smev_agent_client.adapters import adapter
from smev_agent_client.interfaces import OpenAPIRequest

class Request(OpenAPIRequest):

    def get_url(self):
        return 'http://localhost:8090/MNSV03/myedu/api/edu-upload/v1/multipart/csv'

    def get_method(self):
        return 'post'

    def get_files(self) -> List[str]:
        return [
            Path('files/myedu_schools.csv').as_posix()
        ]

result = adapter.send(Request())

Metadata

Release files for smev-agent-client 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for smev-agent-client 0.5.2
File Interpreter ABI Platform Actions
smev_agent_client-0.5.2-py3-none-any.whl Python 3 none any Details for smev_agent_client-0.5.2-py3-none-any.whl

Release files / smev_agent_client-0.5.2-py3-none-any.whl

Download URL smev_agent_client-0.5.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
99e98fbab1b131b6d6b2da296e979b540d1f30bce91b42caee4640597cd34c98
BLAKE2b-256 checksum
How to use checksums
087578d530401810f273320b20d861f9a80b9d2cfffa99da614a0b484c26dae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Security for smev-agent-client 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page