smev-agent-client


Namesmev-agent-client JSON
Version 0.2.4 PyPI version JSON
download
home_pageNone
SummaryКлиент для взаимодействия с Агентом ПОДД СМЭВ
upload_time2024-05-20 09:27:19
maintainerNone
docs_urlNone
authorBARS Group
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Клиент для взаимодействия со СМЭВ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())

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "smev-agent-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "BARS Group",
    "author_email": "education_dev@bars-open.ru",
    "download_url": "https://files.pythonhosted.org/packages/3e/33/381924703b64d18b852cbd119c80f2a95b0f30a86d450603b884f3b8c15c/smev-agent-client-0.2.4.tar.gz",
    "platform": null,
    "description": "# \u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e \u0421\u041c\u042d\u04123 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0410\u0434\u0430\u043f\u0442\u0435\u0440\u0430\n## \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\nsettings:\n\n    INSTALLED_APPS = [\n        'smev_agent_client',\n    ]\n\n\napps:\n\n    from django.apps import AppConfig as AppConfigBase\n\n    class AppConfig(AppConfigBase):\n    \n        name = __package__\n    \n        def __setup_agent_client(self):\n            import smev_agent_client\n    \n            smev_agent_client.set_config(\n                smev_agent_client.configuration.Config(\n                    agent_url='http://localhost:8090',\n                    system_mnemonics='MNSV03',\n                    timeout=1,\n                    request_retries=1,\n                )\n            )\n    \n        def ready(self):\n            super().ready()\n            self.__setup_agent_client()\n\n## \u042d\u043c\u0443\u043b\u044f\u0446\u0438\u044f\n\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u044b:\n\n    smev_agent_client.set_config(\n        ...,\n        smev_agent_client.configuration.Config(\n            interface=(\n                'smev_agent_client.contrib.my_edu.interfaces.rest'\n                '.OpenAPIInterfaceEmulation'\n            )\n        )\n    )\n\n## \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432\n    $ tox\n\n## API\n\n### \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\n\n    from smev_agent_client.adapters import adapter\n    from smev_agent_client.interfaces import OpenAPIRequest\n\n    class Request(OpenAPIRequest):\n\n        def get_url(self):\n            return 'http://localhost:8090/MNSV03/myedu/api/edu-upload/v1/multipart/csv'\n    \n        def get_method(self):\n            return 'post'\n    \n        def get_files(self) -> List[str]:\n            return [\n                Path('files/myedu_schools.csv').as_posix()\n            ]\n\n    result = adapter.send(Request())\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u041a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0410\u0433\u0435\u043d\u0442\u043e\u043c \u041f\u041e\u0414\u0414 \u0421\u041c\u042d\u0412",
    "version": "0.2.4",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96bbffa24ca0a19a076a027d5d46b9551d1afc9fa79657524568f141de12e216",
                "md5": "fba4292bf24598573bf5e74511efd22f",
                "sha256": "3180b1dc51375138c624879524590c06601f47d3590c8f64882e4bab585ef6f2"
            },
            "downloads": -1,
            "filename": "smev_agent_client-0.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fba4292bf24598573bf5e74511efd22f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16457,
            "upload_time": "2024-05-20T09:27:15",
            "upload_time_iso_8601": "2024-05-20T09:27:15.915603Z",
            "url": "https://files.pythonhosted.org/packages/96/bb/ffa24ca0a19a076a027d5d46b9551d1afc9fa79657524568f141de12e216/smev_agent_client-0.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3e33381924703b64d18b852cbd119c80f2a95b0f30a86d450603b884f3b8c15c",
                "md5": "0280852d127a4488b06bc5a62ffcd04b",
                "sha256": "9a79e852b7e7696112d68cc80d3e38f938b88c18474c9672efd45d1d2e2678f3"
            },
            "downloads": -1,
            "filename": "smev-agent-client-0.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0280852d127a4488b06bc5a62ffcd04b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12277,
            "upload_time": "2024-05-20T09:27:19",
            "upload_time_iso_8601": "2024-05-20T09:27:19.004375Z",
            "url": "https://files.pythonhosted.org/packages/3e/33/381924703b64d18b852cbd119c80f2a95b0f30a86d450603b884f3b8c15c/smev-agent-client-0.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-20 09:27:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "smev-agent-client"
}
        
Elapsed time: 0.37688s