codeflowhub 0.2.1__tar.gz → 0.2.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.
Files changed (32) hide show
  1. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/PKG-INFO +1 -1
  2. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/airflow/xcom.py +15 -2
  3. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/flow.py +5 -1
  4. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub.egg-info/PKG-INFO +1 -1
  5. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/setup.py +1 -1
  6. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/LICENSE +0 -0
  7. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/README.md +0 -0
  8. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/__init__.py +0 -0
  9. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/action.py +0 -0
  10. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/airflow/__init__.py +0 -0
  11. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/base.py +0 -0
  12. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/model.py +0 -0
  13. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/service/__init__.py +0 -0
  14. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/service/airflow_exporter.py +0 -0
  15. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/storage/__init__.py +0 -0
  16. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/storage/local_storage.py +0 -0
  17. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/storage/s3_storage.py +0 -0
  18. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/storage/storage.py +0 -0
  19. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/task.py +0 -0
  20. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/__init__.py +0 -0
  21. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/analyze_speaker_pkg/__init__.py +0 -0
  22. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/analyze_speaker_pkg/main.py +0 -0
  23. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/extract_voice_pkg/__init__.py +0 -0
  24. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/extract_voice_pkg/main.py +0 -0
  25. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/read_pdf_pkg/__init__.py +0 -0
  26. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/read_pdf_pkg/main.py +0 -0
  27. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/transcript_pkg/__init__.py +0 -0
  28. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub/template/transcript_pkg/main.py +0 -0
  29. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub.egg-info/SOURCES.txt +0 -0
  30. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub.egg-info/dependency_links.txt +0 -0
  31. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/codeflowhub.egg-info/top_level.txt +0 -0
  32. {codeflowhub-0.2.1 → codeflowhub-0.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeflowhub
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: workflow development tools
5
5
  Author: creaddiscans
6
6
  Author-email: creaddiscans@gmail.com
@@ -69,11 +69,24 @@ def _api_request(path: str):
69
69
 
70
70
 
71
71
  def _write_json(content, output_path: str):
72
- """Write JSON content to file."""
72
+ """Write JSON content to file.
73
+
74
+ Handles both parsed objects (dict/list) and string values.
75
+ String values may be valid JSON or Python repr (single quotes) —
76
+ both are normalized to valid JSON output.
77
+ """
73
78
  os.makedirs(os.path.dirname(output_path) or '.', exist_ok=True)
74
79
  with open(output_path, 'w') as f:
75
80
  if isinstance(content, str):
76
- f.write(content)
81
+ # Airflow XCom API가 Python repr 문자열로 반환할 수 있음
82
+ # e.g. "{'key': 'value'}" (싱글쿼트) → valid JSON으로 변환 필요
83
+ try:
84
+ json.loads(content) # 이미 valid JSON이면 그대로 출력
85
+ f.write(content)
86
+ except json.JSONDecodeError:
87
+ import ast
88
+ parsed = ast.literal_eval(content)
89
+ json.dump(parsed, f)
77
90
  else:
78
91
  json.dump(content, f)
79
92
 
@@ -81,7 +81,7 @@ class FlowDecorator(BaseDecorator):
81
81
  def _create_parser(cls, add_help=True):
82
82
  """FlowhHub CLI 파서 생성"""
83
83
  parser = argparse.ArgumentParser(description='FlowhHub Workflow', add_help=add_help)
84
- parser.add_argument('--env', type=str, default='default', help='Environment to use (default: default)')
84
+ parser.add_argument('--env', type=str, default=None, help='Environment to use (default: default, or --export value if exporting)')
85
85
  parser.add_argument('--id', type=str, default=None, help='Workflow run ID (default: run)')
86
86
  parser.add_argument('--export', type=str, default=None, help='Export to external system (airflow)')
87
87
  parser.add_argument('--job', type=str, default=None, help='Job directory path (auto-sets --input-data and --run-log)')
@@ -186,6 +186,10 @@ class FlowDecorator(BaseDecorator):
186
186
  parser = self._create_parser(add_help=False)
187
187
  args, _ = parser.parse_known_args()
188
188
 
189
+ # --env 미지정 시: --export가 있으면 export 값, 없으면 'default'
190
+ if args.env is None:
191
+ args.env = args.export if args.export and args.export in self.env_config else 'default'
192
+
189
193
  if args.env and args.env in self.env_config:
190
194
  self.select_env(args.env)
191
195
  print(f'Using environment: {args.env}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeflowhub
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: workflow development tools
5
5
  Author: creaddiscans
6
6
  Author-email: creaddiscans@gmail.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='codeflowhub',
5
- version='0.2.1',
5
+ version='0.2.3',
6
6
  description='workflow development tools',
7
7
  author='creaddiscans',
8
8
  author_email='creaddiscans@gmail.com',
File without changes
File without changes
File without changes