sprocket-systems.coda.sdk 1.0.5__tar.gz → 1.1.0__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.
@@ -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.1.0
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>
@@ -29,7 +29,7 @@ classifiers = [
29
29
  dependencies = [
30
30
  "requests",
31
31
  ]
32
- version = "1.0.5"
32
+ version = "1.1.0"
33
33
 
34
34
  [project.urls]
35
35
  Documentation = "https://coda.sprocket.systems/docs/sdks/python/"
@@ -1,6 +1,6 @@
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"
3
+ __version__ = "1.1.0"
4
4
  CODA_APP_SUITE_VERSION = "+coda-1.68.0"
5
5
  FINAL_VERSION = __version__ + CODA_APP_SUITE_VERSION
6
6
 
@@ -756,7 +756,7 @@ class CodaWorkflow(object):
756
756
  self.packages[packtype][pid]["naming_convention_options"] = naming_options
757
757
 
758
758
 
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):
759
+ 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
760
 
761
761
  naming_convention_id=None
762
762
  if naming_convention and type(naming_convention) is str:
@@ -792,9 +792,13 @@ class CodaWorkflow(object):
792
792
  'type':t
793
793
  }
794
794
 
795
- if 'interleaved' not in self.packages:
796
- self.packages['interleaved'] = {}
797
- pid = f"my-interleaved-package-{len(self.packages['interleaved'])+1}"
795
+ tag = 'interleaved'
796
+ if container=='mov':
797
+ tag = 'mov'
798
+
799
+ if tag not in self.packages:
800
+ self.packages[tag] = {}
801
+ pid = f"my-{tag}-package-{len(self.packages[tag])+1}"
798
802
 
799
803
  if not streams:
800
804
  streams = []
@@ -813,7 +817,7 @@ class CodaWorkflow(object):
813
817
  #if fps=='same_as_input':
814
818
  #fps = 'all_from_essence'
815
819
 
816
- self.packages['interleaved'][pid] = {
820
+ self.packages[tag][pid] = {
817
821
  "name": name,
818
822
  "frame_rate": fps,
819
823
  "process_block_ids":blist,
@@ -821,11 +825,11 @@ class CodaWorkflow(object):
821
825
  "include_package_wide_uuid" :package_wide_uuid,
822
826
  }
823
827
  if naming_convention:
824
- self.packages['interleaved'][pid]['naming_convention'] = naming_convention.copy()
828
+ self.packages[tag][pid]['naming_convention'] = naming_convention.copy()
825
829
  if naming_convention_id:
826
- self.packages['interleaved'][pid]['naming_convention_id'] = naming_convention_id
830
+ self.packages[tag][pid]['naming_convention_id'] = naming_convention_id
827
831
  if naming_options:
828
- self.packages['interleaved'][pid]["naming_convention_options"] = naming_options
832
+ self.packages[tag][pid]["naming_convention_options"] = naming_options
829
833
 
830
834
  return
831
835
 
@@ -1430,6 +1434,21 @@ class CodaJob(object):
1430
1434
  print('validate raw :: ',ret.json(),file=sys.stderr)
1431
1435
  return ret.json()
1432
1436
 
1437
+ def get_edge_payload(self):
1438
+ ret = self.validate()
1439
+ if 'errors' in ret or ('success' in ret and not ret['success']):
1440
+ return None
1441
+ J = json.loads(self.json())
1442
+ ret = make_request(requests.post,38383,"/interface/v1/jobs/edge",J)
1443
+ try:
1444
+ J = ret.json()
1445
+ except:
1446
+ print('get_edge_payload::',ret,file=sys.stderr)
1447
+ return None
1448
+ if 'errors' in J:
1449
+ return None
1450
+ return J
1451
+
1433
1452
  def run(self):
1434
1453
  ret = self.validate()
1435
1454
  if 'errors' in ret or ('success' in ret and not ret['success']):