{"id":19481485,"url":"https://github.com/blackgard/dkc-api","last_synced_at":"2026-06-10T22:31:10.160Z","repository":{"id":57422919,"uuid":"391276215","full_name":"Blackgard/dkc-api","owner":"Blackgard","description":"Connector for connecting via api to DKC. Allows you to easily retrieve product and news data.","archived":false,"fork":false,"pushed_at":"2021-08-09T02:52:01.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T07:17:18.906Z","etag":null,"topics":["api","connector","dkc","loader","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blackgard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-31T06:39:33.000Z","updated_at":"2022-03-09T06:09:58.000Z","dependencies_parsed_at":"2022-09-10T21:31:49.376Z","dependency_job_id":null,"html_url":"https://github.com/Blackgard/dkc-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Fdkc-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Fdkc-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Fdkc-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blackgard%2Fdkc-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blackgard","download_url":"https://codeload.github.com/Blackgard/dkc-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240712854,"owners_count":19845551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","connector","dkc","loader","python"],"created_at":"2024-11-10T20:05:03.885Z","updated_at":"2026-06-10T22:31:10.143Z","avatar_url":"https://github.com/Blackgard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003eDKC API v1\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Status](https://img.shields.io/badge/status-active-success.svg)]()\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e Connector to DKC API v1 (\u003ca href=\"https://www.dkc.ru/ru/\"\u003edkc.ru\u003c/a\u003e)\n    \u003cbr\u003e\n\u003c/p\u003e\n\n## 📚 Table of Contents\n\n- [About](#about)\n- [Getting Started](#getting_started)\n- [Available models](#available_models)\n- [Usage](#usage)\n\n## 💬 About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nConnector for connecting via api to DKC. Allows you to easily retrieve product and news data.\n\n## 🧵 Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\nFor download use pip:\n\n```cmd\npython -m pip install dkc-api\n```\n\n### Init\n\nTo get started, you need to import the main class DkcAPI.\n\n```python\nfrom dkc_api.v1.dkc_api import DkcAPI\n```\n\nNext, we pass the initialization parameters to the class. If you want to use environment variables, then the file [.env.example](https://github.com/Blackgard/dkc-api/blob/master/.env.example) is prepared for this.\n\n```python\ndkc_api = DkcAPI(\n    master_key=os.getenv(\"TOKEN\"),\n    debug=True,\n    storage=storage.FileTokenStorage(),\n    logger=logger\n)\n```\n\n## 📌 Available models \u003ca name=\"available_models\"\u003e\u003c/a\u003e\n\nSo far, only five DkcAPI models are available for work:\n\n1. Catalog\n2. Content\n3. Delivery\n4. News\n5. Project (In developing)\n\n## 🧰 Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n### 🪑 Methods Catalog\n\nCatalog object name:\n\n```python\n\u003e\u003e\u003e dkc_api.Catalog.*\n```\n\n#### GetMaterialStock\n\nThis method retrieves data on stock balances.\n\nArgs:\n- code (list[str], str, int, None): Material code list. If present, ‘Material ID’ is not taken into account. Defaults to [].\n- id (list[str], str, int, None): Material id list. Defaults to [].\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialStock()\n\u003e\u003e\u003e resolve\nGetMaterialStock({create: datetime, materials: [{ id: 81, status: true, code: 1200, warehouse: [{code: 2765, ...]}, ...]}, ...] })\n```\n\n#### GetMaterial\n\nThis method returns all data for the specified material.\n\nArgs:\n- code (str): Material code.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterial(code=1200)\n\u003e\u003e\u003e resolve\nGetMaterial({material: {id: 81, node_id: 1234, etim_class_id: \"ETIM\", name: \"Product name\", type: \"Type\", ...})\n```\n\n#### getMaterialAnalogs\n\nThis method returns a list of product analogues. \n\nArgs:\n- code (str, None): Material code.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialAnalogs(code=1200)\n\u003e\u003e\u003e resolve\nGetMaterialAnalogs({analogs: { \"1200\": [ *product_analogue_codes* ]}})\n```\n\nYou can get a list of all analogs for all products, for this you need to leave the \"code\" parameter empty.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialAnalogs()\n\u003e\u003e\u003e resolve\nGetMaterialAnalogs({analogs: { *product_codes*: [ *product_analogue_codes* ]}})\n```\n\n\n#### getMaterialAccessories\n\nThis method returns a list of product accessories. \n\nArgs:\n- code (str, None): Material code.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialAccessories(code=1200)\n\u003e\u003e\u003e resolve\nGetMaterialAccessories({accessories: { \"1200\": [ *product_analogue_codes* ]}})\n```\n\nYou can get a list of all accessories for all products, for this you need to leave the \"code\" parameter empty.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialAccessories()\n\u003e\u003e\u003e resolve\nGetMaterialAccessories({accessories: { *product_codes*: [ *product_analogue_codes* ]}})\n```\n\n#### getMaterialCertificates\n\nThis method returns a list of product certificates. \n\nArgs:\n- code (str): Material code.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Catalog.getMaterialCertificates(code=1200)\n\u003e\u003e\u003e resolve\nGetMaterialCertificates({certificates: { \"1200\": [ *product_analogue_codes* ]}})\n```\n\n#### List other methods \n\n- getMaterialRelated\n- getMaterialVideo\n- getMaterialDrawingsSketch\n- getMaterialDescription\n- getMaterialSpecification\n\n### 🏢 Methods Content\n\nContent object name:\n\n```python\n\u003e\u003e\u003e dkc_api.Content.*\n```\n\n#### getRevisionDrawings\n\nThe method allows you to get editorial drawings by product code\n\nArgs:\n- last_updated (datetime, None): if specified, only processes changes from the specified date. Timestamp format.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Content.getRevisionDrawings(code=1200)\n\u003e\u003e\u003e resolve\nGetRevisionDrawings({revision: { delta: bool, drawings: { updated: [id: 1200, name: \"Name\", links: { type: \"Type\", ...}], removed: [...]}})\n```\n\n\n#### getRevisionMaterials\n\nThe method allows you to get editorial materials by product code\n\nArgs:\n- last_updated (datetime, optional): if specified, only processes changes from the specified date. Timestamp format.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Content.getRevisionMaterials(code=1200)\n\u003e\u003e\u003e resolve\nGetRevisionMaterials({revision: { delta: bool, materials: { updated: [id: 1200, name: \"Name\", links: { type: \"Type\", ...}], removed: [...]}})\n```\n\n\n#### postFile\n\nThis method allows you to upload files to the dkc api repository\n\nArgs:\n- file_content (PostFileContent): file content\n\n```python\n\u003e\u003e\u003e post_file_content = PostFileContent(name=\"name_file\", value=\"value_file\")\n\u003e\u003e\u003e resolve = dkc_api.Content.postFile(file_content=post_file_content)\n\u003e\u003e\u003e resolve\nPostFile({revision: { id: 872} })\n```\n\n#### getFile\n\nThis method allows you to get files from the dkc api repository\n\nArgs:\n- file_id (int): file id\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.Content.getFile(file_id=872)\n\u003e\u003e\u003e resolve\nPostFile({revision: { name: \"name_file\", value: \"value_file\" } })\n```\n\n#### List other methods \n\n- getRevisionCertificates\n- getRevisionsLastSize\n- getRevisionsLast\n\n### 🏃 Methods Delivery\n\nDelivery object name:\n\n```python\n\u003e\u003e\u003e dkc_api.Delivery.*\n```\n\n#### getDeliveryTime\n\nThe method returns the date of shipment of goods\n\nArgs:\n- delivery_time_content (DeliveryTimeContent): delivery time content. Work how filter.\n\n```python\n\u003e\u003e\u003e delivery_time_content = DeliveryTimeContent(company_warehouse=\"test\", items=[])\n\u003e\u003e\u003e resolve = dkc_api.Delivery.getDeliveryTime(delivery_time_content=delivery_time_content)\n\u003e\u003e\u003e resolve\nGetDeliveryTime({items: [{ code: 172, status: true, date_last: {date: *datetime*, amount: 1689030}, date_detail: [...]}, ...] })\n```\n\n### 📰 Methods News\n\nNews object name:\n\n```python\n\u003e\u003e\u003e dkc_api.News.*\n```\n\n#### getNewsCompany\n\nThe method returns company news.\n\nArgs:\n- page_index (int): Page index how need load. Default first (0) page.\n- length (int): Count news on page. Default 10 news.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.News.getNewsCompany()\n\u003e\u003e\u003e resolve\nGetNewsCompany({news: [{title: \"Title\", text: \"Text\", thumbnail_url: \"Url\", images: [\"URL\", ...], timestamp: *datetime*}, ...]})\n```\n\n\n#### getNewsProducts\n\nThe method returns products news.\n\nArgs:\n- page_index (int): Page index how need load. Default first (0) page.\n- length (int): Count news on page. Default 10 news.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.News.getNewsProducts()\n\u003e\u003e\u003e resolve\nGetNewsProducts({news: [{title: \"Title\", text: \"Text\", thumbnail_url: \"Url\", images: [\"URL\", ...], timestamp: *datetime*}, ...]})\n```\n\n#### getNewsCommunity\n\nThe method returns community news.\n\nArgs:\n- page_index (int): Page index how need load. Default first (0) page.\n- length (int): Count news on page. Default 10 news.\n\n```python\n\u003e\u003e\u003e resolve = dkc_api.News.getNewsCommunity()\n\u003e\u003e\u003e resolve\nGetNewsCommunity({news: [{text: \"Text\", timestamp: \"08.08.2021\"}, ...]})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackgard%2Fdkc-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackgard%2Fdkc-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackgard%2Fdkc-api/lists"}