Клиент для взаимодействия с Загрузчиком данных в витрину
Project description
Клиент для взаимодействия с РВД посредством Адаптера
Подключение
settings:
INSTALLED_APPS = [
'uploader_client',
]
apps:
from django.apps import AppConfig as AppConfigBase
class AppConfig(AppConfigBase):
name = __package__
def __setup_uploader_client(self):
import uploader_client
uploader_client.set_config(
uploader_client.configuration.Config(
agent_url='http://localhost:8090',
system_mnemonics='MNSV03',
timeout=1,
request_retries=1,
)
)
def ready(self):
super().ready()
self.__setup_uploader_client()
Эмуляция
Заменить используемый интерфейс на эмулирующий запросы:
uploader_client.set_config(
...,
uploader_client.configuration.Config(
interface=(
'uploader_client.contrib.rdm.interfaces.rest'
'.OpenAPIInterfaceEmulation'
)
)
)
Запуск тестов
$ tox
API
Передача сообщения
from uploader_client.adapters import adapter
from uploader_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 Distribution
uploader-client-0.1.9.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for uploader_client-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4afef3fafd1af69739ca61d90e07a9f0d40de79a0c7b1ceb32916502077a2d23 |
|
MD5 | 76c86c0603ee12275d14cc09bd92fd96 |
|
BLAKE2b-256 | 33405cbbaac59c05e68d4ddf7c4a46550db2134b7b82d89fab466da13c3ed580 |