sprocket-systems.coda.sdk 1.0.5__py3-none-any.whl → 1.2.2__py3-none-any.whl

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.
coda/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # The versions below will be replaced automatically in CI.
2
2
  # You do not need to modify any of the versions below.
3
- __version__ = "1.0.5"
4
- CODA_APP_SUITE_VERSION = "+coda-1.68.0"
3
+ __version__ = "1.2.2"
4
+ CODA_APP_SUITE_VERSION = "+coda-1.72.0"
5
5
  FINAL_VERSION = __version__ + CODA_APP_SUITE_VERSION
6
6
 
7
7
  import sys
coda/sdk.py CHANGED
@@ -5,6 +5,7 @@ import subprocess
5
5
  import requests
6
6
  import copy
7
7
  import shutil
8
+ import time
8
9
 
9
10
  from .tc_tools import time_seconds_to_vid_frames,vid_frames_to_tc, tc_to_time_seconds
10
11
 
@@ -357,7 +358,7 @@ class CodaWorkflow(object):
357
358
  self.processBlocks[pid] = pblock
358
359
  return
359
360
 
360
- def addDCPPackage(self,name,process_blocks,reels=False,naming_convention=None,naming_options=None,package_wide_uuid=False):
361
+ def addDCPPackage(self,name,process_blocks,ofps="24",double_frame_rate=False,reels=False,naming_convention=None,naming_options=None,package_wide_uuid=False):
361
362
 
362
363
  naming_convention_id=None
363
364
  if naming_convention and type(naming_convention) is str:
@@ -383,12 +384,16 @@ class CodaWorkflow(object):
383
384
  blist += block
384
385
  block = self.processBlocks[block[0]]
385
386
  assert(block['output_settings']['venue']=='theatrical')
386
- fps = "24"
387
+ if not isinstance(ofps, list):
388
+ FPS = [ofps]
389
+ else:
390
+ FPS = ofps
387
391
  fmt = ["atmos"]
388
392
  typ = ["printmaster"]
389
393
  for F in fmt:
390
- for t in typ:
391
- block['output_essences'][t+'_'+fps+'_'+F]= {
394
+ for fps in FPS:
395
+ for t in typ:
396
+ block['output_essences'][t+'_'+fps+'_'+F]= {
392
397
  'audio_format': F,
393
398
  'frame_rate': fps,
394
399
  'type':t
@@ -399,6 +404,7 @@ class CodaWorkflow(object):
399
404
 
400
405
  self.packages['dcp_mxf'][pid] = {
401
406
  "name": name,
407
+ "double_frame_rate":double_frame_rate,
402
408
  "process_block_ids":blist,
403
409
  "include_reel_splitting" : reels,
404
410
  "include_package_wide_uuid" :package_wide_uuid,
@@ -410,6 +416,7 @@ class CodaWorkflow(object):
410
416
  if naming_options:
411
417
  self.packages['dcp_mxf'][pid]["naming_convention_options"] = naming_options
412
418
 
419
+
413
420
  def addSuperSessionPackage(self,name,process_blocks,essences,super_session_profile=None,naming_convention=None,naming_options=None,package_wide_uuid=False):
414
421
 
415
422
  naming_convention_id=None
@@ -756,7 +763,7 @@ class CodaWorkflow(object):
756
763
  self.packages[packtype][pid]["naming_convention_options"] = naming_options
757
764
 
758
765
 
759
- def addInterleavedPackage(self,name,process_blocks,essences=('same_as_input',['same_as_input'],['same_as_input']),streams=None,naming_convention=None,naming_options=None,package_wide_uuid=False):
766
+ def addInterleavedPackage(self,name,process_blocks,essences=('same_as_input',['same_as_input'],['same_as_input']),container='wav',streams=None,naming_convention=None,naming_options=None,package_wide_uuid=False):
760
767
 
761
768
  naming_convention_id=None
762
769
  if naming_convention and type(naming_convention) is str:
@@ -792,9 +799,13 @@ class CodaWorkflow(object):
792
799
  'type':t
793
800
  }
794
801
 
795
- if 'interleaved' not in self.packages:
796
- self.packages['interleaved'] = {}
797
- pid = f"my-interleaved-package-{len(self.packages['interleaved'])+1}"
802
+ tag = 'interleaved'
803
+ if container=='mov':
804
+ tag = 'mov'
805
+
806
+ if tag not in self.packages:
807
+ self.packages[tag] = {}
808
+ pid = f"my-{tag}-package-{len(self.packages[tag])+1}"
798
809
 
799
810
  if not streams:
800
811
  streams = []
@@ -813,7 +824,7 @@ class CodaWorkflow(object):
813
824
  #if fps=='same_as_input':
814
825
  #fps = 'all_from_essence'
815
826
 
816
- self.packages['interleaved'][pid] = {
827
+ self.packages[tag][pid] = {
817
828
  "name": name,
818
829
  "frame_rate": fps,
819
830
  "process_block_ids":blist,
@@ -821,11 +832,11 @@ class CodaWorkflow(object):
821
832
  "include_package_wide_uuid" :package_wide_uuid,
822
833
  }
823
834
  if naming_convention:
824
- self.packages['interleaved'][pid]['naming_convention'] = naming_convention.copy()
835
+ self.packages[tag][pid]['naming_convention'] = naming_convention.copy()
825
836
  if naming_convention_id:
826
- self.packages['interleaved'][pid]['naming_convention_id'] = naming_convention_id
837
+ self.packages[tag][pid]['naming_convention_id'] = naming_convention_id
827
838
  if naming_options:
828
- self.packages['interleaved'][pid]["naming_convention_options"] = naming_options
839
+ self.packages[tag][pid]["naming_convention_options"] = naming_options
829
840
 
830
841
  return
831
842
 
@@ -1292,7 +1303,7 @@ class CodaJob(object):
1292
1303
  if force_fps is not None:
1293
1304
  fpsflag = [ '--frame-rate'] + [ force_fps ]
1294
1305
 
1295
- ret = subprocess.run([codaexe] +['inspect']+ ['-i'] + fpsflag + absfiles,shell=False,check=True,stdout = subprocess.PIPE)
1306
+ ret = subprocess.run([codaexe] +['inspect']+ fpsflag + ['-i'] + absfiles,shell=False,check=True,stdout = subprocess.PIPE)
1296
1307
  j = json.loads(ret.stdout)
1297
1308
  for t in j['sources']:
1298
1309
  for g in j['sources'][t]:
@@ -1430,6 +1441,21 @@ class CodaJob(object):
1430
1441
  print('validate raw :: ',ret.json(),file=sys.stderr)
1431
1442
  return ret.json()
1432
1443
 
1444
+ def get_edge_payload(self):
1445
+ ret = self.validate()
1446
+ if 'errors' in ret or ('success' in ret and not ret['success']):
1447
+ return None
1448
+ J = json.loads(self.json())
1449
+ ret = make_request(requests.post,38383,"/interface/v1/jobs/edge",J)
1450
+ try:
1451
+ J = ret.json()
1452
+ except:
1453
+ print('get_edge_payload::',ret,file=sys.stderr)
1454
+ return None
1455
+ if 'errors' in J:
1456
+ return None
1457
+ return J
1458
+
1433
1459
  def run(self):
1434
1460
  ret = self.validate()
1435
1461
  if 'errors' in ret or ('success' in ret and not ret['success']):
@@ -1560,6 +1586,8 @@ class CodaJob(object):
1560
1586
  #print(t,k,'::',wdef['packages'][t][p][k])
1561
1587
  if not ('venue' in k or 'element' in k or 'format' in k or 'frame' in k):
1562
1588
  continue
1589
+ if k == 'double_frame_rate':
1590
+ continue
1563
1591
  if 'same_as_input' in wdef['packages'][t][p][k]:
1564
1592
  if 'venue' in k:
1565
1593
  if type(wdef['packages'][t][p][k]) is list:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sprocket-systems.coda.sdk
3
- Version: 1.0.5
3
+ Version: 1.2.2
4
4
  Summary: The Coda SDK provides a Python interface to define Coda workflows, create jobs and run them.
5
5
  Keywords: python,coda,sdk
6
6
  Author-Email: Sprocket Systems <support@sprocket.systems>
@@ -0,0 +1,8 @@
1
+ coda/__init__.py,sha256=CA2guGGMUGh2U0G7XKLDcCnkTFSsgoyVdmNJzEnZMy0,1034
2
+ coda/sdk.py,sha256=xoaMRfAhCOl1gjpxw_CUqhwJV6Ws772idQJBGUAbdnY,70144
3
+ coda/tc_tools.py,sha256=55aoPnfIJRtPJCeaOHJatWU9D2ZZ5lFdYO0JM3W_Qig,37020
4
+ sprocket_systems_coda_sdk-1.2.2.dist-info/METADATA,sha256=OWWZSWqqfc9rOjh24QaPMP1_Mkg3PmI-42KkRxSqd7Q,1213
5
+ sprocket_systems_coda_sdk-1.2.2.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
6
+ sprocket_systems_coda_sdk-1.2.2.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
7
+ sprocket_systems_coda_sdk-1.2.2.dist-info/licenses/LICENSE,sha256=wrFjizFlraIAPW8JIteGftNH2laAZBBRhdEnPVUsKTM,10198
8
+ sprocket_systems_coda_sdk-1.2.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- coda/__init__.py,sha256=3jts9GuffGBZ3A7gfzYr45ihX1QZ3jFNeMBjE3JnVww,1034
2
- coda/sdk.py,sha256=4zTPrzhHnWmjzevyvdNhzULZUJXVN-_0ssKQRA2qy8s,69321
3
- coda/tc_tools.py,sha256=55aoPnfIJRtPJCeaOHJatWU9D2ZZ5lFdYO0JM3W_Qig,37020
4
- sprocket_systems_coda_sdk-1.0.5.dist-info/METADATA,sha256=X1GwuzwwUPSXNnsrgMV6N844Ru2C0e4ZURryEMpy2I0,1213
5
- sprocket_systems_coda_sdk-1.0.5.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
6
- sprocket_systems_coda_sdk-1.0.5.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
7
- sprocket_systems_coda_sdk-1.0.5.dist-info/licenses/LICENSE,sha256=wrFjizFlraIAPW8JIteGftNH2laAZBBRhdEnPVUsKTM,10198
8
- sprocket_systems_coda_sdk-1.0.5.dist-info/RECORD,,