Клиент для взаимодействия с Загрузчиком данных в витрину
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.8.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for uploader_client-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eaf19a30ad54978b1709b798e2fc71595d9c1c963eb7b0d2423fcbdfcd0237b |
|
MD5 | 85a9e5eded9f72c08b37c60dc8b0a855 |
|
BLAKE2b-256 | 13f8afc6a2214f0e04934fa50fcf8a04743fa6210e71f42d9884a7bacf731605 |