sgnl-api 0.0.2__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.1
2
+ Name: sgnl-api
3
+ Version: 0.0.3
4
+ Summary: Asynchronous python wrapper over API sgnl.pro
5
+ Home-page: https://github.com/gritsyuk/sgnl-api
6
+ Download-URL: https://github.com/gritsyuk/sgnl-api/archive/refs/heads/develop.zip
7
+ Author: Igor Gritsyuk
8
+ Author-email: gritsyuk.igor@gmail.com
9
+ Project-URL: GitHub, https://github.com/gritsyuk/sgnl-api
10
+ Keywords: sgnl api signal docs construction supervision operation inspections constarctionsite building management
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.9
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: httpx>=0.27.2
18
+ Requires-Dist: aiofiles>=24.1.0
19
+
20
+ # <img src="./img/logo.svg"> SIGNAL API
21
+
22
+ ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
23
+ ## Обертка над API Signal
24
+ Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
25
+ ## Установка
26
+ ```bash
27
+ pip install -U sgnl-api
28
+ ```
29
+
30
+ ## Пример
31
+ ```python
32
+ import asyncio
33
+ import os
34
+ from sgnl_api import DocsApi
35
+ from dotenv import load_dotenv
36
+
37
+ load_dotenv()
38
+ CLIENT_ID = os.getenv("CLIENT_ID")
39
+ SECRET_ID = os.getenv("SECRET_ID")
40
+
41
+
42
+ async def main():
43
+
44
+ docs = await DocsApi.create(
45
+ client_id=CLIENT_ID,
46
+ client_secret=SECRET_ID
47
+ )
48
+ projects = await docs.project.get_list()
49
+ for project in projects:
50
+ print(project)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ asyncio.run(main())
55
+ ```
56
+ ## Методы
57
+ | Метод | Описание | Возвращает |
58
+ |-------------------------|-----------------------------------------------------------------|--------------------|
59
+ | `item.get_list` | Список файлов в директории | `list[dict]` |
60
+ | `item.count` | Количество файлов в директории | `int` |
61
+ | `item.create_file` | Создает новый файл с версией | `UUID` |
62
+ | `item.create_link` | Создает новую ссылку | `UUID` |
63
+ | `item.get_link` | Получает ссылку для загрузки файла | `dict` |
64
+ | `item.add_version` | Добавляет новую версию к существующему файлу | `None` |
65
+ | `folder.get_list` | Список дочерних папок | `list[dict]` |
66
+ | `folder.create` | Создает новую папку | `UUID` |
67
+ | `folder.rename` | Переименовывает папку | `None` |
68
+ | `project.root_folder` | Информация о корневой папке проекта | `dict` |
69
+ | `project.root_folder_id`| UUID корневой папки проекта | `UUID` |
70
+ | `project.get_list` | Список проектов | `list[dict]` |
71
+ | `project.info` | Информация о проекте | `dict` |
72
+ | `project.users` | Список пользователей проекта | `list[dict]` |
73
+ | `project.roles` | Список ролей проекта | `list[dict]` |
74
+ | `project.users_permissions` | Список прав пользователя в проекте | `list[str]` |
75
+ | `company.users_list` | Список пользователей компании | `list[dict]` |
76
+ | `company.roles_list` | Список ролей компании | `list[dict]` |
77
+ | `version.get_list` | Список версий файла | `list[dict]` |
78
+ | `version.count` | Количество версий файла | `int` |
79
+ | `version.create` | Создает новую версию объекта | `UUID` |
80
+ | `file.get_object_upload`| Получает тикет на загрузку объекта | `dict` |
81
+ | `file.commit_uploading` | Завершает загрузку объекта | `None` |
82
+ | `file.upload` | Загружает файл | `dict` или `None` |
83
+
@@ -0,0 +1,64 @@
1
+ # <img src="./img/logo.svg"> SIGNAL API
2
+
3
+ ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
4
+ ## Обертка над API Signal
5
+ Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
6
+ ## Установка
7
+ ```bash
8
+ pip install -U sgnl-api
9
+ ```
10
+
11
+ ## Пример
12
+ ```python
13
+ import asyncio
14
+ import os
15
+ from sgnl_api import DocsApi
16
+ from dotenv import load_dotenv
17
+
18
+ load_dotenv()
19
+ CLIENT_ID = os.getenv("CLIENT_ID")
20
+ SECRET_ID = os.getenv("SECRET_ID")
21
+
22
+
23
+ async def main():
24
+
25
+ docs = await DocsApi.create(
26
+ client_id=CLIENT_ID,
27
+ client_secret=SECRET_ID
28
+ )
29
+ projects = await docs.project.get_list()
30
+ for project in projects:
31
+ print(project)
32
+
33
+
34
+ if __name__ == "__main__":
35
+ asyncio.run(main())
36
+ ```
37
+ ## Методы
38
+ | Метод | Описание | Возвращает |
39
+ |-------------------------|-----------------------------------------------------------------|--------------------|
40
+ | `item.get_list` | Список файлов в директории | `list[dict]` |
41
+ | `item.count` | Количество файлов в директории | `int` |
42
+ | `item.create_file` | Создает новый файл с версией | `UUID` |
43
+ | `item.create_link` | Создает новую ссылку | `UUID` |
44
+ | `item.get_link` | Получает ссылку для загрузки файла | `dict` |
45
+ | `item.add_version` | Добавляет новую версию к существующему файлу | `None` |
46
+ | `folder.get_list` | Список дочерних папок | `list[dict]` |
47
+ | `folder.create` | Создает новую папку | `UUID` |
48
+ | `folder.rename` | Переименовывает папку | `None` |
49
+ | `project.root_folder` | Информация о корневой папке проекта | `dict` |
50
+ | `project.root_folder_id`| UUID корневой папки проекта | `UUID` |
51
+ | `project.get_list` | Список проектов | `list[dict]` |
52
+ | `project.info` | Информация о проекте | `dict` |
53
+ | `project.users` | Список пользователей проекта | `list[dict]` |
54
+ | `project.roles` | Список ролей проекта | `list[dict]` |
55
+ | `project.users_permissions` | Список прав пользователя в проекте | `list[str]` |
56
+ | `company.users_list` | Список пользователей компании | `list[dict]` |
57
+ | `company.roles_list` | Список ролей компании | `list[dict]` |
58
+ | `version.get_list` | Список версий файла | `list[dict]` |
59
+ | `version.count` | Количество версий файла | `int` |
60
+ | `version.create` | Создает новую версию объекта | `UUID` |
61
+ | `file.get_object_upload`| Получает тикет на загрузку объекта | `dict` |
62
+ | `file.commit_uploading` | Завершает загрузку объекта | `None` |
63
+ | `file.upload` | Загружает файл | `dict` или `None` |
64
+
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name='sgnl-api',
8
- version='0.0.2',
8
+ version='0.0.3',
9
9
  author='Igor Gritsyuk',
10
10
  author_email='gritsyuk.igor@gmail.com',
11
11
  description='Asynchronous python wrapper over API sgnl.pro',
@@ -140,6 +140,14 @@ class DocsApi:
140
140
  take: int = 100,
141
141
  skip: int = 0
142
142
  ) -> list[dict]:
143
+ """
144
+ Required scopes: docs:item:list
145
+ :param folder_id: UUID of the folder
146
+ :param deleted: If true, returns deleted items
147
+ :param take: Number of items to return
148
+ :param skip: Number of items to skip
149
+ :return: Returns a folder`s not nested items list.
150
+ """
143
151
  return await self.api._make_request(
144
152
  method='GET',
145
153
  url=f'{self.api.base_url}/items',
@@ -158,6 +166,12 @@ class DocsApi:
158
166
  folder_id: UUID,
159
167
  deleted: bool = False
160
168
  ) -> int:
169
+ """
170
+ Required scopes: docs:item:list
171
+ :param folder_id: UUID of the folder
172
+ :param deleted: If true, returns deleted items
173
+ :return: Returns a count items in folder`s not nested items list.
174
+ """
161
175
  return await self.api._make_request(
162
176
  method='GET',
163
177
  url=f'{self.api.base_url}/items/count',
@@ -168,31 +182,21 @@ class DocsApi:
168
182
  headers=self.api._get_headers()
169
183
  )
170
184
 
171
- async def download_link(
172
- self,
173
- folder_id: UUID,
174
- version_id: UUID,
175
- file_name: str = None
176
- ):
177
- params = {
178
- 'folderId': folder_id,
179
- 'versionId': version_id
180
- }
181
- if file_name:
182
- params['fileName'] = file_name
183
- return await self.api._make_request(
184
- method='GET',
185
- url=f'{self.api.base_url}/items/download',
186
- params=params,
187
- headers=self.api._get_headers()
188
- )
189
-
190
- async def create(
185
+ @extract_key_from_response(key='data')
186
+ async def create_file(
191
187
  self,
192
188
  name: str,
193
189
  folder_id: UUID,
194
190
  version_id: UUID
195
- ) -> dict:
191
+ ) -> UUID:
192
+ """
193
+ Creates a new File item with a version and attaches it to the item. Returns the id of the created item.
194
+ Required scopes: docs:item:create
195
+ :param name: Name of item to create
196
+ :param folder_id: UUID of the folder
197
+ :param version_id: UUID of the version
198
+ :return: UUID of the created item
199
+ """
196
200
  return await self.api._make_request(
197
201
  method='PUT',
198
202
  url=f'{self.api.base_url}/items/file',
@@ -204,12 +208,21 @@ class DocsApi:
204
208
  headers=self.api._get_headers()
205
209
  )
206
210
 
211
+ @extract_key_from_response(key='data')
207
212
  async def create_link(
208
213
  self,
209
214
  name: str,
210
215
  folder_id: UUID,
211
216
  version_id: UUID
212
- ) -> dict:
217
+ ) -> UUID:
218
+ """
219
+ Creates a new Link item. Returns the id of the created item.
220
+ Required scopes: docs:item:create
221
+ :param name:
222
+ :param folder_id:
223
+ :param version_id:
224
+ :return: UUID of the created link.
225
+ """
213
226
  return await self.api._make_request(
214
227
  method='PUT',
215
228
  url=f'{self.api.base_url}/items/link',
@@ -221,16 +234,49 @@ class DocsApi:
221
234
  headers=self.api._get_headers()
222
235
  )
223
236
 
224
- async def new_version(
237
+ async def get_link(
225
238
  self,
226
239
  item_id: UUID,
227
- version_id: UUID
240
+ version_id: UUID,
241
+ file_name: str = None
228
242
  ) -> dict:
243
+ """
244
+ Required scopes: docs:item:read.
245
+ :param item_id: Item UUID
246
+ :param version_id: Version UUID
247
+ :param file_name: ...
248
+ :return: Returns S3 download link
249
+ """
250
+ params = {
251
+ 'itemId': item_id,
252
+ 'versionId': version_id
253
+ }
254
+ if file_name:
255
+ params['fileName'] = file_name
256
+ return await self.api._make_request(
257
+ method='GET',
258
+ url=f'{self.api.base_url}/items/download',
259
+ params=params,
260
+ headers=self.api._get_headers()
261
+ )
262
+
263
+ async def add_version(
264
+ self,
265
+ item_id: UUID,
266
+ version_id: UUID
267
+ ) -> None:
268
+ """
269
+ Attaches a version to an existing item.
270
+ Required scopes: docs:version:create
271
+ :param item_id:
272
+ :param version_id:
273
+ :return: None
274
+ """
229
275
  return await self.api._make_request(
230
276
  method='PUT',
231
277
  url=f'{self.api.base_url}/items/versions',
232
278
  json={
233
- 'folderId': item_id,
279
+ 'itemId': item_id,
234
280
  'versionId': version_id
235
281
  },
236
282
  headers=self.api._get_headers()
@@ -245,6 +291,12 @@ class DocsApi:
245
291
  folder_id: UUID,
246
292
  deleted: bool = False
247
293
  ) -> list[dict]:
294
+ """
295
+ Required scopes: docs:folder:list
296
+ :param folder_id: UUID of the folder
297
+ :param deleted: If true, returns deleted items
298
+ :return: Returns a list of folder`s children.
299
+ """
248
300
  return await self.api._make_request(
249
301
  method='GET',
250
302
  url=f'{self.api.base_url}/folders/{folder_id}/children',
@@ -254,11 +306,19 @@ class DocsApi:
254
306
  headers=self.api._get_headers()
255
307
  )
256
308
 
309
+ @extract_key_from_response(key='data')
257
310
  async def create(
258
311
  self,
259
312
  parent_id: UUID,
260
313
  name: str = 'new folder from api'
261
- ) -> dict:
314
+ ) -> UUID:
315
+ """
316
+ Creates a new folder.
317
+ Required scopes: docs:folder:create
318
+ :param parent_id: UUID of the parent folder
319
+ :param name: Name of the folder
320
+ :return: UUID of the created folder.
321
+ """
262
322
  return await self.api._make_request(
263
323
  method='PUT',
264
324
  url=f'{self.api.base_url}/folders',
@@ -269,11 +329,18 @@ class DocsApi:
269
329
  headers=self.api._get_headers()
270
330
  )
271
331
 
272
- async def update(
332
+ async def rename(
273
333
  self,
274
334
  folder_id: UUID,
275
335
  name: str
276
- ) -> dict:
336
+ ) -> None:
337
+ """
338
+ Updates a folder - rename
339
+ Required scopes: docs:folder:update
340
+ :param folder_id: UUID of the folder
341
+ :param name: New name of the folder
342
+ :return: None
343
+ """
277
344
  return await self.api._make_request(
278
345
  method='PATCH',
279
346
  url=f'{self.api.base_url}/folders',
@@ -288,9 +355,12 @@ class DocsApi:
288
355
  def __init__(self, api: 'DocsApi'):
289
356
  self.api = api
290
357
 
291
- async def root_folder(
292
- self,
293
- project_id: UUID) -> dict:
358
+ async def root_folder(self, project_id: UUID) -> dict:
359
+ """
360
+ Required scopes: project:read
361
+ :param project_id: UUID of the project
362
+ :return: Returns information about a project in Docs.
363
+ """
294
364
  return await self.api._make_request(
295
365
  method='GET',
296
366
  url=f'{self.api.base_url}/docs/projects/{project_id}',
@@ -298,7 +368,12 @@ class DocsApi:
298
368
  )
299
369
 
300
370
  @extract_key_from_response(key='root_folder_id')
301
- async def root_folder_id(self, project_id: UUID) -> dict:
371
+ async def root_folder_id(self, project_id: UUID) -> UUID:
372
+ """
373
+ Required scopes: project:read
374
+ :param project_id: UUID of the project
375
+ :return: Returns root folder UUID of the project.
376
+ """
302
377
  return await self.root_folder(project_id)
303
378
 
304
379
  async def get_list(
@@ -306,6 +381,12 @@ class DocsApi:
306
381
  take: int = 100,
307
382
  skip: int = 0
308
383
  ) -> list[dict]:
384
+ """
385
+ Required scopes: project:list
386
+ :param take: The number of items to return. Default value is 100. Maximum value is 200.
387
+ :param skip: The number of items to skip. Default value is 0.
388
+ :return: Returns a list of projects.
389
+ """
309
390
  return await self.api._make_request(
310
391
  method='GET',
311
392
  url=f'{self.api.base_url}/projects',
@@ -320,6 +401,11 @@ class DocsApi:
320
401
  self,
321
402
  project_id: UUID
322
403
  ) -> dict:
404
+ """
405
+ Required scopes: project:read
406
+ :param project_id: UUID of the project
407
+ :return: Returns information about a project in Docs.
408
+ """
323
409
  return await self.api._make_request(
324
410
  method='GET',
325
411
  url=f'{self.api.base_url}/projects/{project_id}',
@@ -332,6 +418,13 @@ class DocsApi:
332
418
  take: int = 100,
333
419
  skip: int = 0
334
420
  ) -> list[dict]:
421
+ """
422
+ Required scopes: project:user:list
423
+ :param project_id: Project UUID
424
+ :param take: The number of items to return. Default value is 100. Maximum value is 200
425
+ :param skip: The number of items to skip. Default value is 0.
426
+ :return: Returns a list of users associated with a given project.
427
+ """
335
428
  return await self.api._make_request(
336
429
  method='GET',
337
430
  url=f'{self.api.base_url}/projects/{project_id}/users',
@@ -348,6 +441,13 @@ class DocsApi:
348
441
  take: int = 100,
349
442
  skip: int = 0
350
443
  ) -> list[dict]:
444
+ """
445
+ Required scopes: project:role:list.
446
+ :param project_id: Project UUID
447
+ :param take: The number of items to return. Default value is 100. Maximum value is 200
448
+ :param skip: The number of items to skip. Default value is 0
449
+ :return: Returns a list of roles associated with a given project.
450
+ """
351
451
  return await self.api._make_request(
352
452
  method='GET',
353
453
  url=f'{self.api.base_url}/projects/{project_id}/roles',
@@ -358,11 +458,18 @@ class DocsApi:
358
458
  headers=self.api._get_headers()
359
459
  )
360
460
 
461
+ @extract_key_from_response(key='roles')
361
462
  async def users_permissions(
362
463
  self,
363
464
  project_id: UUID,
364
465
  user_id: UUID
365
- ) -> dict:
466
+ ) -> list[str]:
467
+ """
468
+ Required scopes: project:user:read
469
+ :param project_id: Project UUID
470
+ :param user_id: User UUID
471
+ :return: Returns information about a specific user's permissions in a project.
472
+ """
366
473
  return await self.api._make_request(
367
474
  method='GET',
368
475
  url=f'{self.api.base_url}/projects/{project_id}/users/{user_id}/permission',
@@ -374,6 +481,12 @@ class DocsApi:
374
481
  self.api = api
375
482
 
376
483
  async def users_list(self, take: int = 100, skip: int = 0) -> list[dict]:
484
+ """
485
+ Required scopes: company:user:list
486
+ :param take: The number of items to return. Default value is 100. Maximum value is 200.
487
+ :param skip: The number of items to skip. Default value is 0.
488
+ :return: Returns a list of users associated with a company.
489
+ """
377
490
  return await self.api._make_request(
378
491
  method='GET',
379
492
  url=f'{self.api.base_url}/company/users',
@@ -385,6 +498,12 @@ class DocsApi:
385
498
  )
386
499
 
387
500
  async def roles_list(self, take: int = 100, skip: int = 0) -> list[dict]:
501
+ """
502
+ Required scopes: company:role:list
503
+ :param take: The number of items to return. Default value is 100. Maximum value is 200.
504
+ :param skip: The number of items to skip. Default value is 0.
505
+ :return: Returns a list of roles associated with a company.
506
+ """
388
507
  return await self.api._make_request(
389
508
  method='GET',
390
509
  url=f'{self.api.base_url}/company/roles',
@@ -399,12 +518,20 @@ class DocsApi:
399
518
  def __init__(self, api: 'DocsApi'):
400
519
  self.api = api
401
520
 
402
- async def list(
521
+ async def get_list(
403
522
  self,
404
523
  item_id: UUID,
405
524
  take: int = 100,
406
525
  skip: int = 0
407
526
  ) -> list[dict]:
527
+ """
528
+ Returns a list of versions of item
529
+ Required scopes: docs:version:list
530
+ :param item_id: Item UUID
531
+ :param take: The number of items to return. Default value is 100. Maximum value is 200.
532
+ :param skip: The number of items to skip. Default value is 0.
533
+ :return: list of versions of item
534
+ """
408
535
  return await self.api._make_request(
409
536
  method='GET',
410
537
  url=f'{self.api.base_url}/versions',
@@ -420,7 +547,13 @@ class DocsApi:
420
547
  async def count(
421
548
  self,
422
549
  item_id: UUID
423
- ) -> dict:
550
+ ) -> int:
551
+ """
552
+ Returns the count of item`s versions.
553
+ Required scopes: docs:version:list
554
+ :param item_id: Item UUID
555
+ :return: count items
556
+ """
424
557
  return await self.api._make_request(
425
558
  method='GET',
426
559
  url=f'{self.api.base_url}/versions',
@@ -430,13 +563,22 @@ class DocsApi:
430
563
  headers=self.api._get_headers()
431
564
  )
432
565
 
433
- async def new(
566
+ @extract_key_from_response(key="data")
567
+ async def create(
434
568
  self,
435
569
  *,
436
570
  object_id: UUID,
437
571
  project_id: UUID,
438
572
  name: str
439
- ) -> dict:
573
+ ) -> UUID:
574
+ """
575
+ Creates a new version of an object. Returns the id of the created version.
576
+ Required scopes: docs:version:create
577
+ :param object_id: UUID of the object
578
+ :param project_id: UUID of the project
579
+ :param name: ...
580
+ :return: UUID of the created version
581
+ """
440
582
  return await self.api._make_request(
441
583
  method='POST',
442
584
  url=f'{self.api.base_url}/versions',
@@ -458,6 +600,14 @@ class DocsApi:
458
600
  mime_type: str,
459
601
  size: int
460
602
  ) -> dict:
603
+ """
604
+ Returns the object upload ticket. Each object must be committed.
605
+ Required scopes: docs:object:create
606
+ :param project_id: UUID of the project
607
+ :param mime_type: mime type of the file
608
+ :param size: file size in bytes
609
+ :return: dict: Object upload ticket
610
+ """
461
611
  return await self.api._make_request(
462
612
  method='PUT',
463
613
  url=f'{self.api.base_url}/objects',
@@ -472,7 +622,13 @@ class DocsApi:
472
622
  async def commit_uploading(
473
623
  self,
474
624
  object_id: UUID
475
- ) -> dict:
625
+ ) -> None:
626
+ """
627
+ Commiting object upload after put it in S3.
628
+ Required scopes: docs:object:create
629
+ :param object_id: UUID S3 object
630
+ :return: None
631
+ """
476
632
  return await self.api._make_request(
477
633
  method='POST',
478
634
  url=f'{self.api.base_url}/objects/{object_id}/uploading/commit',
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.1
2
+ Name: sgnl-api
3
+ Version: 0.0.3
4
+ Summary: Asynchronous python wrapper over API sgnl.pro
5
+ Home-page: https://github.com/gritsyuk/sgnl-api
6
+ Download-URL: https://github.com/gritsyuk/sgnl-api/archive/refs/heads/develop.zip
7
+ Author: Igor Gritsyuk
8
+ Author-email: gritsyuk.igor@gmail.com
9
+ Project-URL: GitHub, https://github.com/gritsyuk/sgnl-api
10
+ Keywords: sgnl api signal docs construction supervision operation inspections constarctionsite building management
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.9
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: httpx>=0.27.2
18
+ Requires-Dist: aiofiles>=24.1.0
19
+
20
+ # <img src="./img/logo.svg"> SIGNAL API
21
+
22
+ ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
23
+ ## Обертка над API Signal
24
+ Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
25
+ ## Установка
26
+ ```bash
27
+ pip install -U sgnl-api
28
+ ```
29
+
30
+ ## Пример
31
+ ```python
32
+ import asyncio
33
+ import os
34
+ from sgnl_api import DocsApi
35
+ from dotenv import load_dotenv
36
+
37
+ load_dotenv()
38
+ CLIENT_ID = os.getenv("CLIENT_ID")
39
+ SECRET_ID = os.getenv("SECRET_ID")
40
+
41
+
42
+ async def main():
43
+
44
+ docs = await DocsApi.create(
45
+ client_id=CLIENT_ID,
46
+ client_secret=SECRET_ID
47
+ )
48
+ projects = await docs.project.get_list()
49
+ for project in projects:
50
+ print(project)
51
+
52
+
53
+ if __name__ == "__main__":
54
+ asyncio.run(main())
55
+ ```
56
+ ## Методы
57
+ | Метод | Описание | Возвращает |
58
+ |-------------------------|-----------------------------------------------------------------|--------------------|
59
+ | `item.get_list` | Список файлов в директории | `list[dict]` |
60
+ | `item.count` | Количество файлов в директории | `int` |
61
+ | `item.create_file` | Создает новый файл с версией | `UUID` |
62
+ | `item.create_link` | Создает новую ссылку | `UUID` |
63
+ | `item.get_link` | Получает ссылку для загрузки файла | `dict` |
64
+ | `item.add_version` | Добавляет новую версию к существующему файлу | `None` |
65
+ | `folder.get_list` | Список дочерних папок | `list[dict]` |
66
+ | `folder.create` | Создает новую папку | `UUID` |
67
+ | `folder.rename` | Переименовывает папку | `None` |
68
+ | `project.root_folder` | Информация о корневой папке проекта | `dict` |
69
+ | `project.root_folder_id`| UUID корневой папки проекта | `UUID` |
70
+ | `project.get_list` | Список проектов | `list[dict]` |
71
+ | `project.info` | Информация о проекте | `dict` |
72
+ | `project.users` | Список пользователей проекта | `list[dict]` |
73
+ | `project.roles` | Список ролей проекта | `list[dict]` |
74
+ | `project.users_permissions` | Список прав пользователя в проекте | `list[str]` |
75
+ | `company.users_list` | Список пользователей компании | `list[dict]` |
76
+ | `company.roles_list` | Список ролей компании | `list[dict]` |
77
+ | `version.get_list` | Список версий файла | `list[dict]` |
78
+ | `version.count` | Количество версий файла | `int` |
79
+ | `version.create` | Создает новую версию объекта | `UUID` |
80
+ | `file.get_object_upload`| Получает тикет на загрузку объекта | `dict` |
81
+ | `file.commit_uploading` | Завершает загрузку объекта | `None` |
82
+ | `file.upload` | Загружает файл | `dict` или `None` |
83
+
sgnl_api-0.0.2/PKG-INFO DELETED
@@ -1,82 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: sgnl-api
3
- Version: 0.0.2
4
- Summary: Asynchronous python wrapper over API sgnl.pro
5
- Home-page: https://github.com/gritsyuk/sgnl-api
6
- Download-URL: https://github.com/gritsyuk/sgnl-api/archive/refs/heads/develop.zip
7
- Author: Igor Gritsyuk
8
- Author-email: gritsyuk.igor@gmail.com
9
- Project-URL: GitHub, https://github.com/gritsyuk/sgnl-api
10
- Keywords: sgnl api signal docs construction supervision operation inspections constarctionsite building management
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.9
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: httpx>=0.27.2
18
- Requires-Dist: aiofiles>=24.1.0
19
-
20
- # <img src="./img/logo.svg"> SIGNAL API
21
-
22
- ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
23
- ## Обертка над API Signal
24
- Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
25
- ## Установка
26
- ```bash
27
- pip install -U sgnl-api
28
- ```
29
-
30
- ## Пример
31
- ```python
32
- import asyncio
33
- import os
34
- from sgnl_api import DocsApi
35
- from dotenv import load_dotenv
36
-
37
- load_dotenv()
38
- CLIENT_ID = os.getenv("CLIENT_ID")
39
- SECRET_ID = os.getenv("SECRET_ID")
40
-
41
-
42
- async def main():
43
-
44
- docs = await DocsApi.create(
45
- client_id=CLIENT_ID,
46
- client_secret=SECRET_ID
47
- )
48
- projects = await docs.project.get_list()
49
- for project in projects:
50
- print(project)
51
-
52
-
53
- if __name__ == "__main__":
54
- asyncio.run(main())
55
- ```
56
- ## Методы
57
- | Методы | Описание |
58
- |-----------------------------|-----------------------------------------|
59
- | `Item.get_list` | Список файлов в директории |
60
- | `Item.count` | Количество файлов в директории |
61
- | `Item.download_link` | Получить ссылку на скачивание |
62
- | `Item.create` | Создать файл |
63
- | `Item.create_link` | Создать ссылку |
64
- | `Item.new_version` | Создать новую версию |
65
- | `Folder.get_list` | Список подкаталогов в каталоге |
66
- | `Folder.create` | Создать каталог |
67
- | `Folder.update` | Переименовать каталог |
68
- | `Project.root_folder` | Данные корневой папки проекта |
69
- | `Project.root_folder_id` | UUID корневой папки |
70
- | `Project.get_list` | Список проектов |
71
- | `Project.info` | Информация о проекте |
72
- | `Project.users` | Список пользователей проекта |
73
- | `Project.roles` | Список ролей проекта |
74
- | `Project.users_permissions` | Права доступа у пользователя на проекте |
75
- | `Company.users_list` | Список пользователей компании |
76
- | `Company.roles_list` | Список ролей компании |
77
- | `Version.list` | Список версий файла |
78
- | `Version.count` | Количество версий у файла |
79
- | `Version.new` | Новая версия |
80
- | `File.get_object_upload` | Получение ссылки загрузки и id объекта |
81
- | `File.commit_uploading` | Записать сведения в S3 |
82
- | `File.upload` | Загрузка объекта полный цикл |
sgnl_api-0.0.2/README.md DELETED
@@ -1,63 +0,0 @@
1
- # <img src="./img/logo.svg"> SIGNAL API
2
-
3
- ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
4
- ## Обертка над API Signal
5
- Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
6
- ## Установка
7
- ```bash
8
- pip install -U sgnl-api
9
- ```
10
-
11
- ## Пример
12
- ```python
13
- import asyncio
14
- import os
15
- from sgnl_api import DocsApi
16
- from dotenv import load_dotenv
17
-
18
- load_dotenv()
19
- CLIENT_ID = os.getenv("CLIENT_ID")
20
- SECRET_ID = os.getenv("SECRET_ID")
21
-
22
-
23
- async def main():
24
-
25
- docs = await DocsApi.create(
26
- client_id=CLIENT_ID,
27
- client_secret=SECRET_ID
28
- )
29
- projects = await docs.project.get_list()
30
- for project in projects:
31
- print(project)
32
-
33
-
34
- if __name__ == "__main__":
35
- asyncio.run(main())
36
- ```
37
- ## Методы
38
- | Методы | Описание |
39
- |-----------------------------|-----------------------------------------|
40
- | `Item.get_list` | Список файлов в директории |
41
- | `Item.count` | Количество файлов в директории |
42
- | `Item.download_link` | Получить ссылку на скачивание |
43
- | `Item.create` | Создать файл |
44
- | `Item.create_link` | Создать ссылку |
45
- | `Item.new_version` | Создать новую версию |
46
- | `Folder.get_list` | Список подкаталогов в каталоге |
47
- | `Folder.create` | Создать каталог |
48
- | `Folder.update` | Переименовать каталог |
49
- | `Project.root_folder` | Данные корневой папки проекта |
50
- | `Project.root_folder_id` | UUID корневой папки |
51
- | `Project.get_list` | Список проектов |
52
- | `Project.info` | Информация о проекте |
53
- | `Project.users` | Список пользователей проекта |
54
- | `Project.roles` | Список ролей проекта |
55
- | `Project.users_permissions` | Права доступа у пользователя на проекте |
56
- | `Company.users_list` | Список пользователей компании |
57
- | `Company.roles_list` | Список ролей компании |
58
- | `Version.list` | Список версий файла |
59
- | `Version.count` | Количество версий у файла |
60
- | `Version.new` | Новая версия |
61
- | `File.get_object_upload` | Получение ссылки загрузки и id объекта |
62
- | `File.commit_uploading` | Записать сведения в S3 |
63
- | `File.upload` | Загрузка объекта полный цикл |
@@ -1,82 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: sgnl-api
3
- Version: 0.0.2
4
- Summary: Asynchronous python wrapper over API sgnl.pro
5
- Home-page: https://github.com/gritsyuk/sgnl-api
6
- Download-URL: https://github.com/gritsyuk/sgnl-api/archive/refs/heads/develop.zip
7
- Author: Igor Gritsyuk
8
- Author-email: gritsyuk.igor@gmail.com
9
- Project-URL: GitHub, https://github.com/gritsyuk/sgnl-api
10
- Keywords: sgnl api signal docs construction supervision operation inspections constarctionsite building management
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Operating System :: OS Independent
14
- Requires-Python: >=3.9
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: httpx>=0.27.2
18
- Requires-Dist: aiofiles>=24.1.0
19
-
20
- # <img src="./img/logo.svg"> SIGNAL API
21
-
22
- ![PyPI - Version](https://img.shields.io/pypi/v/sgnl-api) [![Telegram chat](https://img.shields.io/badge/Просто_о_BIM-join-blue?logo=telegram)](https://t.me/prostobim)
23
- ## Обертка над API Signal
24
- Официальная документация [https://api.sgnl.pro/openapi/swagger/index.html](https://api.sgnl.pro/openapi/swagger/index.html)
25
- ## Установка
26
- ```bash
27
- pip install -U sgnl-api
28
- ```
29
-
30
- ## Пример
31
- ```python
32
- import asyncio
33
- import os
34
- from sgnl_api import DocsApi
35
- from dotenv import load_dotenv
36
-
37
- load_dotenv()
38
- CLIENT_ID = os.getenv("CLIENT_ID")
39
- SECRET_ID = os.getenv("SECRET_ID")
40
-
41
-
42
- async def main():
43
-
44
- docs = await DocsApi.create(
45
- client_id=CLIENT_ID,
46
- client_secret=SECRET_ID
47
- )
48
- projects = await docs.project.get_list()
49
- for project in projects:
50
- print(project)
51
-
52
-
53
- if __name__ == "__main__":
54
- asyncio.run(main())
55
- ```
56
- ## Методы
57
- | Методы | Описание |
58
- |-----------------------------|-----------------------------------------|
59
- | `Item.get_list` | Список файлов в директории |
60
- | `Item.count` | Количество файлов в директории |
61
- | `Item.download_link` | Получить ссылку на скачивание |
62
- | `Item.create` | Создать файл |
63
- | `Item.create_link` | Создать ссылку |
64
- | `Item.new_version` | Создать новую версию |
65
- | `Folder.get_list` | Список подкаталогов в каталоге |
66
- | `Folder.create` | Создать каталог |
67
- | `Folder.update` | Переименовать каталог |
68
- | `Project.root_folder` | Данные корневой папки проекта |
69
- | `Project.root_folder_id` | UUID корневой папки |
70
- | `Project.get_list` | Список проектов |
71
- | `Project.info` | Информация о проекте |
72
- | `Project.users` | Список пользователей проекта |
73
- | `Project.roles` | Список ролей проекта |
74
- | `Project.users_permissions` | Права доступа у пользователя на проекте |
75
- | `Company.users_list` | Список пользователей компании |
76
- | `Company.roles_list` | Список ролей компании |
77
- | `Version.list` | Список версий файла |
78
- | `Version.count` | Количество версий у файла |
79
- | `Version.new` | Новая версия |
80
- | `File.get_object_upload` | Получение ссылки загрузки и id объекта |
81
- | `File.commit_uploading` | Записать сведения в S3 |
82
- | `File.upload` | Загрузка объекта полный цикл |
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes