gazu 1.0.0__tar.gz → 1.0.2__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.
Files changed (57) hide show
  1. {gazu-1.0.0 → gazu-1.0.2}/PKG-INFO +3 -5
  2. gazu-1.0.2/gazu/__version__.py +1 -0
  3. {gazu-1.0.0 → gazu-1.0.2}/gazu/entity.py +12 -0
  4. {gazu-1.0.0 → gazu-1.0.2}/gazu/person.py +208 -0
  5. {gazu-1.0.0 → gazu-1.0.2}/gazu/playlist.py +166 -0
  6. {gazu-1.0.0 → gazu-1.0.2}/gazu/project.py +405 -0
  7. gazu-1.0.2/gazu/search.py +35 -0
  8. {gazu-1.0.0 → gazu-1.0.2}/gazu/task.py +404 -10
  9. {gazu-1.0.0 → gazu-1.0.2}/gazu/user.py +316 -0
  10. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/PKG-INFO +3 -5
  11. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/SOURCES.txt +2 -0
  12. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/requires.txt +2 -4
  13. {gazu-1.0.0 → gazu-1.0.2}/setup.cfg +2 -4
  14. {gazu-1.0.0 → gazu-1.0.2}/tests/test_entity.py +10 -0
  15. {gazu-1.0.0 → gazu-1.0.2}/tests/test_person.py +138 -0
  16. {gazu-1.0.0 → gazu-1.0.2}/tests/test_playlist.py +171 -0
  17. {gazu-1.0.0 → gazu-1.0.2}/tests/test_project.py +257 -0
  18. gazu-1.0.2/tests/test_search.py +108 -0
  19. {gazu-1.0.0 → gazu-1.0.2}/tests/test_task.py +273 -16
  20. {gazu-1.0.0 → gazu-1.0.2}/tests/test_user.py +239 -0
  21. gazu-1.0.0/gazu/__version__.py +0 -1
  22. {gazu-1.0.0 → gazu-1.0.2}/LICENSE +0 -0
  23. {gazu-1.0.0 → gazu-1.0.2}/README.rst +0 -0
  24. {gazu-1.0.0 → gazu-1.0.2}/gazu/__init__.py +0 -0
  25. {gazu-1.0.0 → gazu-1.0.2}/gazu/asset.py +0 -0
  26. {gazu-1.0.0 → gazu-1.0.2}/gazu/cache.py +0 -0
  27. {gazu-1.0.0 → gazu-1.0.2}/gazu/casting.py +0 -0
  28. {gazu-1.0.0 → gazu-1.0.2}/gazu/client.py +0 -0
  29. {gazu-1.0.0 → gazu-1.0.2}/gazu/concept.py +0 -0
  30. {gazu-1.0.0 → gazu-1.0.2}/gazu/context.py +0 -0
  31. {gazu-1.0.0 → gazu-1.0.2}/gazu/edit.py +0 -0
  32. {gazu-1.0.0 → gazu-1.0.2}/gazu/encoder.py +0 -0
  33. {gazu-1.0.0 → gazu-1.0.2}/gazu/events.py +0 -0
  34. {gazu-1.0.0 → gazu-1.0.2}/gazu/exception.py +0 -0
  35. {gazu-1.0.0 → gazu-1.0.2}/gazu/files.py +0 -0
  36. {gazu-1.0.0 → gazu-1.0.2}/gazu/helpers.py +0 -0
  37. {gazu-1.0.0 → gazu-1.0.2}/gazu/scene.py +0 -0
  38. {gazu-1.0.0 → gazu-1.0.2}/gazu/shot.py +0 -0
  39. {gazu-1.0.0 → gazu-1.0.2}/gazu/sorting.py +0 -0
  40. {gazu-1.0.0 → gazu-1.0.2}/gazu/sync.py +0 -0
  41. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/dependency_links.txt +0 -0
  42. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/not-zip-safe +0 -0
  43. {gazu-1.0.0 → gazu-1.0.2}/gazu.egg-info/top_level.txt +0 -0
  44. {gazu-1.0.0 → gazu-1.0.2}/pyproject.toml +0 -0
  45. {gazu-1.0.0 → gazu-1.0.2}/setup.py +0 -0
  46. {gazu-1.0.0 → gazu-1.0.2}/tests/test_asset.py +0 -0
  47. {gazu-1.0.0 → gazu-1.0.2}/tests/test_cache.py +0 -0
  48. {gazu-1.0.0 → gazu-1.0.2}/tests/test_casting.py +0 -0
  49. {gazu-1.0.0 → gazu-1.0.2}/tests/test_client.py +0 -0
  50. {gazu-1.0.0 → gazu-1.0.2}/tests/test_concept.py +0 -0
  51. {gazu-1.0.0 → gazu-1.0.2}/tests/test_context.py +0 -0
  52. {gazu-1.0.0 → gazu-1.0.2}/tests/test_edit.py +0 -0
  53. {gazu-1.0.0 → gazu-1.0.2}/tests/test_files.py +0 -0
  54. {gazu-1.0.0 → gazu-1.0.2}/tests/test_helpers.py +0 -0
  55. {gazu-1.0.0 → gazu-1.0.2}/tests/test_scene.py +0 -0
  56. {gazu-1.0.0 → gazu-1.0.2}/tests/test_shot.py +0 -0
  57. {gazu-1.0.0 → gazu-1.0.2}/tests/test_sync.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gazu
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Gazu is a client for Zou, the API to store the data of your CG production.
5
5
  Home-page: https://gazu.cg-wire.com/
6
6
  Author: CG Wire
@@ -12,8 +12,6 @@ Classifier: Environment :: Web Environment
12
12
  Classifier: Framework :: Flask
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Natural Language :: English
15
- Classifier: Programming Language :: Python :: 2.7
16
- Classifier: Programming Language :: Python :: 3.6
17
15
  Classifier: Programming Language :: Python :: 3.7
18
16
  Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
@@ -26,10 +24,10 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
26
24
  Classifier: Topic :: Multimedia :: Graphics
27
25
  Requires-Python: >= 2.7, != 3.0.*, != 3.1.*, != 3.2.*, != 3.3.*, != 3.4.*, != 3.5.*, != 3.6.1, != 3.6.2
28
26
  License-File: LICENSE
29
- Requires-Dist: python-socketio[client]<6,>=5.11.0; python_version != "2.7"
27
+ Requires-Dist: python-socketio[client]<6,>=5.11.0
30
28
  Requires-Dist: requests>=2.25.1
31
29
  Requires-Dist: Deprecated==1.3.1
32
- Requires-Dist: pywin32>=308; sys_platform == "win32" and python_version != "2.7"
30
+ Requires-Dist: pywin32>=308; sys_platform == "win32"
33
31
  Provides-Extra: dev
34
32
  Requires-Dist: wheel; extra == "dev"
35
33
  Provides-Extra: test
@@ -0,0 +1 @@
1
+ __version__ = "1.0.2"
@@ -114,6 +114,18 @@ def new_entity_type(name, client=default):
114
114
  return raw.create("entity-types", data, client=client)
115
115
 
116
116
 
117
+ def remove_entity_type(entity_type, client=default):
118
+ """
119
+ Remove given entity type from database.
120
+
121
+ Args:
122
+ entity_type (dict / str): Entity type to remove.
123
+ """
124
+ entity_type = normalize_model_parameter(entity_type)
125
+ path = "data/entity-types/%s" % entity_type["id"]
126
+ return raw.delete(path, client=client)
127
+
128
+
117
129
  def remove_entity(entity, force=False, client=default):
118
130
  """
119
131
  Remove given entity from database.
@@ -446,3 +446,211 @@ def invite_person(person, client=default):
446
446
  "actions/persons/%s/invite" % (person["id"]),
447
447
  client=client,
448
448
  )
449
+
450
+
451
+ @cache
452
+ def get_time_spents_by_date(person, date, client=default):
453
+ """
454
+ Get time spents for a person on a specific date.
455
+
456
+ Args:
457
+ person (dict / ID): The person dict or id.
458
+ date (str): Date in YYYY-MM-DD format.
459
+
460
+ Returns:
461
+ list: Time spents for the date.
462
+ """
463
+ person = normalize_model_parameter(person)
464
+ return raw.get(
465
+ "data/persons/%s/time-spents/by-date" % person["id"],
466
+ params={"date": date},
467
+ client=client,
468
+ )
469
+
470
+
471
+ @cache
472
+ def get_week_time_spents(person, year, week, client=default):
473
+ """
474
+ Get time spents for a person for a specific week.
475
+
476
+ Args:
477
+ person (dict / ID): The person dict or id.
478
+ year (int): Year.
479
+ week (int): Week number.
480
+
481
+ Returns:
482
+ list: Time spents for the week.
483
+ """
484
+ person = normalize_model_parameter(person)
485
+ return raw.get(
486
+ "data/persons/%s/time-spents/week/%s/%s" % (person["id"], year, week),
487
+ client=client,
488
+ )
489
+
490
+
491
+ @cache
492
+ def get_year_time_spents(person, year, client=default):
493
+ """
494
+ Get time spents for a person for a specific year.
495
+
496
+ Args:
497
+ person (dict / ID): The person dict or id.
498
+ year (int): Year.
499
+
500
+ Returns:
501
+ list: Time spents for the year.
502
+ """
503
+ person = normalize_model_parameter(person)
504
+ return raw.get(
505
+ "data/persons/%s/time-spents/year/%s" % (person["id"], year),
506
+ client=client,
507
+ )
508
+
509
+
510
+ @cache
511
+ def get_day_offs(person, client=default):
512
+ """
513
+ Get day offs for a person.
514
+
515
+ Args:
516
+ person (dict / ID): The person dict or id.
517
+
518
+ Returns:
519
+ list: Day offs for the person.
520
+ """
521
+ person = normalize_model_parameter(person)
522
+ return raw.fetch_all(
523
+ "persons/%s/day-offs" % person["id"], client=client
524
+ )
525
+
526
+
527
+ @cache
528
+ def get_week_day_offs(person, year, week, client=default):
529
+ """
530
+ Get day offs for a person for a specific week.
531
+
532
+ Args:
533
+ person (dict / ID): The person dict or id.
534
+ year (int): Year.
535
+ week (int): Week number.
536
+
537
+ Returns:
538
+ list: Day offs for the week.
539
+ """
540
+ person = normalize_model_parameter(person)
541
+ return raw.get(
542
+ "data/persons/%s/day-offs/week/%s/%s" % (person["id"], year, week),
543
+ client=client,
544
+ )
545
+
546
+
547
+ @cache
548
+ def get_month_day_offs(person, year, month, client=default):
549
+ """
550
+ Get day offs for a person for a specific month.
551
+
552
+ Args:
553
+ person (dict / ID): The person dict or id.
554
+ year (int): Year.
555
+ month (int): Month number.
556
+
557
+ Returns:
558
+ list: Day offs for the month.
559
+ """
560
+ person = normalize_model_parameter(person)
561
+ return raw.get(
562
+ "data/persons/%s/day-offs/month/%s/%s"
563
+ % (person["id"], year, str(month).zfill(2)),
564
+ client=client,
565
+ )
566
+
567
+
568
+ @cache
569
+ def get_year_day_offs(person, year, client=default):
570
+ """
571
+ Get day offs for a person for a specific year.
572
+
573
+ Args:
574
+ person (dict / ID): The person dict or id.
575
+ year (int): Year.
576
+
577
+ Returns:
578
+ list: Day offs for the year.
579
+ """
580
+ person = normalize_model_parameter(person)
581
+ return raw.get(
582
+ "data/persons/%s/day-offs/year/%s" % (person["id"], year),
583
+ client=client,
584
+ )
585
+
586
+
587
+ def add_person_to_department(person, department, client=default):
588
+ """
589
+ Add a person to a department.
590
+
591
+ Args:
592
+ person (dict / ID): The person dict or id.
593
+ department (dict / ID): The department dict or id.
594
+
595
+ Returns:
596
+ dict: Response information.
597
+ """
598
+ person = normalize_model_parameter(person)
599
+ department = normalize_model_parameter(department)
600
+ return raw.post(
601
+ "data/persons/%s/departments" % person["id"],
602
+ {"department_id": department["id"]},
603
+ client=client,
604
+ )
605
+
606
+
607
+ def remove_person_from_department(person, department, client=default):
608
+ """
609
+ Remove a person from a department.
610
+
611
+ Args:
612
+ person (dict / ID): The person dict or id.
613
+ department (dict / ID): The department dict or id.
614
+
615
+ Returns:
616
+ Response: Request response object.
617
+ """
618
+ person = normalize_model_parameter(person)
619
+ department = normalize_model_parameter(department)
620
+ return raw.delete(
621
+ "data/persons/%s/departments/%s" % (person["id"], department["id"]),
622
+ client=client,
623
+ )
624
+
625
+
626
+ def disable_two_factor_authentication(person, client=default):
627
+ """
628
+ Disable two factor authentication for a person.
629
+
630
+ Args:
631
+ person (dict / ID): The person dict or id.
632
+
633
+ Returns:
634
+ Response: Request response object.
635
+ """
636
+ person = normalize_model_parameter(person)
637
+ return raw.delete(
638
+ "data/persons/%s/two-factor-authentication" % person["id"],
639
+ client=client,
640
+ )
641
+
642
+
643
+ def clear_person_avatar(person, client=default):
644
+ """
645
+ Clear avatar for a person.
646
+
647
+ Args:
648
+ person (dict / ID): The person dict or id.
649
+
650
+ Returns:
651
+ Response: Request response object.
652
+ """
653
+ person = normalize_model_parameter(person)
654
+ return raw.delete(
655
+ "data/persons/%s/avatar" % person["id"], client=client
656
+ )
@@ -253,3 +253,169 @@ def update_entity_preview(
253
253
  if persist:
254
254
  update_playlist(playlist, client=client)
255
255
  return playlist
256
+
257
+
258
+ @cache
259
+ def delete_playlist(playlist, client=default):
260
+ """
261
+ Delete a playlist.
262
+
263
+ Args:
264
+ playlist (dict / ID): The playlist dict or id.
265
+
266
+ Returns:
267
+ Response: Request response object.
268
+ """
269
+ playlist = normalize_model_parameter(playlist)
270
+ return raw.delete("data/playlists/%s" % playlist["id"], client=client)
271
+
272
+
273
+ @cache
274
+ def get_entity_previews(playlist, client=default):
275
+ """
276
+ Get entity previews for a playlist.
277
+
278
+ Args:
279
+ playlist (dict / ID): The playlist dict or id.
280
+
281
+ Returns:
282
+ list: Entity previews for the playlist.
283
+ """
284
+ playlist = normalize_model_parameter(playlist)
285
+ return raw.fetch_all(
286
+ "playlists/%s/entity-previews" % playlist["id"], client=client
287
+ )
288
+
289
+
290
+ @cache
291
+ def get_build_job(build_job, client=default):
292
+ """
293
+ Get a build job.
294
+
295
+ Args:
296
+ build_job (dict / ID): The build job dict or id.
297
+
298
+ Returns:
299
+ dict: Build job information.
300
+ """
301
+ build_job = normalize_model_parameter(build_job)
302
+ return raw.fetch_one("playlists/build-jobs", build_job["id"], client=client)
303
+
304
+
305
+ def remove_build_job(build_job, client=default):
306
+ """
307
+ Delete a build job.
308
+
309
+ Args:
310
+ build_job (dict / ID): The build job dict or id.
311
+
312
+ Returns:
313
+ Response: Request response object.
314
+ """
315
+ build_job = normalize_model_parameter(build_job)
316
+ return raw.delete(
317
+ "data/playlists/build-jobs/%s" % build_job["id"], client=client
318
+ )
319
+
320
+
321
+ @cache
322
+ def all_build_jobs_for_project(project, client=default):
323
+ """
324
+ Get all build jobs for a project.
325
+
326
+ Args:
327
+ project (dict / ID): The project dict or id.
328
+
329
+ Returns:
330
+ list: All build jobs for the project.
331
+ """
332
+ project = normalize_model_parameter(project)
333
+ return raw.fetch_all(
334
+ "projects/%s/build-jobs" % project["id"], client=client
335
+ )
336
+
337
+
338
+ def build_playlist_movie(playlist, client=default):
339
+ """
340
+ Build a movie for a playlist.
341
+
342
+ Args:
343
+ playlist (dict / ID): The playlist dict or id.
344
+
345
+ Returns:
346
+ dict: Build job information.
347
+ """
348
+ playlist = normalize_model_parameter(playlist)
349
+ return raw.post(
350
+ "data/playlists/%s/build-movie" % playlist["id"], {}, client=client
351
+ )
352
+
353
+
354
+ def download_playlist_build(playlist, build_job, file_path, client=default):
355
+ """
356
+ Download a playlist build.
357
+
358
+ Args:
359
+ playlist (dict / ID): The playlist dict or id.
360
+ build_job (dict / ID): The build job dict or id.
361
+ file_path (str): The location to store the file on the hard drive.
362
+
363
+ Returns:
364
+ Response: Request response object.
365
+ """
366
+ playlist = normalize_model_parameter(playlist)
367
+ build_job = normalize_model_parameter(build_job)
368
+ path = "data/playlists/%s/build-jobs/%s/download" % (
369
+ playlist["id"],
370
+ build_job["id"],
371
+ )
372
+ return raw.download(path, file_path, client=client)
373
+
374
+
375
+ def download_playlist_zip(playlist, file_path, client=default):
376
+ """
377
+ Download a playlist as a zip file.
378
+
379
+ Args:
380
+ playlist (dict / ID): The playlist dict or id.
381
+ file_path (str): The location to store the file on the hard drive.
382
+
383
+ Returns:
384
+ Response: Request response object.
385
+ """
386
+ playlist = normalize_model_parameter(playlist)
387
+ path = "data/playlists/%s/download/zip" % playlist["id"]
388
+ return raw.download(path, file_path, client=client)
389
+
390
+
391
+ def generate_temp_playlist(project, data, client=default):
392
+ """
393
+ Generate a temporary playlist.
394
+
395
+ Args:
396
+ project (dict / ID): The project dict or id.
397
+ data (dict): Playlist generation data.
398
+
399
+ Returns:
400
+ dict: Generated temporary playlist.
401
+ """
402
+ project = normalize_model_parameter(project)
403
+ return raw.post(
404
+ "data/projects/%s/playlists/temp" % project["id"], data, client=client
405
+ )
406
+
407
+
408
+ def notify_clients_playlist_ready(playlist, client=default):
409
+ """
410
+ Notify clients that a playlist is ready.
411
+
412
+ Args:
413
+ playlist (dict / ID): The playlist dict or id.
414
+
415
+ Returns:
416
+ dict: Notification response.
417
+ """
418
+ playlist = normalize_model_parameter(playlist)
419
+ return raw.post(
420
+ "data/playlists/%s/notify" % playlist["id"], {}, client=client
421
+ )