Клиент для взаимодействия с Агентом ПОДД СМЭВ
Project description
Клиент для взаимодействия со СМЭВ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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smev_agent_client-0.5.1-py3-none-any.whl.
File metadata
- Download URL: smev_agent_client-0.5.1-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da5968ed2d1f91ea0526a015ab40afb8c8b0ff86ba9fe40f161b3a7c129bda2d
|
|
| MD5 |
fb83faadd733afcfe7172b7b4a0d060b
|
|
| BLAKE2b-256 |
3b4325666898798d2f4a904ac3495460f30e7d02418aa5dab1c86051973881ef
|