Data Transform
CSV, JSON, XML, YAML parsing, generation, and pipeline transformations.
16 modules
| Module | Description |
|---|---|
| CSV 파일 읽기 | CSV 파일을 읽고 객체 배열로 파싱 |
| CSV 파일 쓰기 | 객체 배열을 CSV 파일에 쓰기 |
| JSON 파싱 | JSON 문자열을 객체로 파싱 |
| JSON 문자열화 | 객체를 JSON 문자열로 변환 |
| JSON을 CSV로 | JSON 데이터 또는 파일을 CSV 형식으로 변환 |
| 데이터 파이프라인 | 여러 데이터 변환을 한 번에 연결 |
| 텍스트 템플릿 | 변수로 텍스트 템플릿 채우기 |
| XML 생성 | 객체나 배열에서 XML 문자열 생성 |
| XML 파싱 | XML 문자열을 객체로 파싱 |
| YAML 생성 | 객체나 배열에서 YAML 문자열 생성 |
| YAML 파싱 | YAML 문자열을 객체로 파싱 |
| 객체 키 | 객체에서 모든 키 가져오기 |
| 객체 병합 | 여러 객체를 하나로 병합 |
| 객체 제외 | 객체에서 특정 키 제외 |
| 객체 선택 | 객체에서 특정 키만 선택 |
| 객체 값 | 객체에서 모든 값 가져오기 |
Modules
CSV 파일 읽기
data.csv.read
CSV 파일을 읽고 객체 배열로 파싱
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | - | Path to the file |
delimiter | select (,, ;, , ` | , `) | No | , |
encoding | select (utf-8, ascii, latin-1, utf-16, gbk, big5) | No | utf-8 | Character encoding for the file |
skip_header | boolean | No | False | Skip first row (header) |
Output:
| Field | Type | Description |
|---|---|---|
status | string | 작업 상태 |
data | array | 작업 상태 |
rows | number | 작업 상태 |
columns | array | 행 객체 배열 |
Example: Example
file_path: data/users.csv
delimiter: ,
encoding: utf-8CSV 파일 쓰기
data.csv.write
객체 배열을 CSV 파일에 쓰기
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | - | Path to the file |
data | array | Yes | - | Array of data items to process |
delimiter | select (,, ;, , ` | , `) | No | , |
encoding | select (utf-8, ascii, latin-1, utf-16, gbk, big5) | No | utf-8 | Character encoding for the file |
Output:
| Field | Type | Description |
|---|---|---|
status | string | 작업 상태 |
file_path | string | 작업 상태 |
rows_written | number | 작업 상태 |
Example: Example
file_path: output/results.csv
data: [{"name": "John", "score": 95}, {"name": "Jane", "score": 87}]JSON 파싱
data.json.parse
JSON 문자열을 객체로 파싱
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
json_string | string | Yes | - | JSON string to parse into an object or array |
Output:
| Field | Type | Description |
|---|---|---|
status | string | 작업 상태 |
data | object | 작업 상태 |
Example: Example
json_string: {"name": "John", "age": 30}JSON 문자열화
data.json.stringify
객체를 JSON 문자열로 변환
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
data | object | Yes | - | Data object to process |
pretty | boolean | No | False | Format with indentation |
indent | number | No | 2 | Indentation spaces (if pretty=true) |
Output:
| Field | Type | Description |
|---|---|---|
status | string | 작업 상태 |
json | string | 작업 상태 |
Example: Example
data: {"name": "John", "age": 30}
pretty: trueJSON을 CSV로
data.json_to_csv
JSON 데이터 또는 파일을 CSV 형식으로 변환
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
input_data | any | Yes | - | JSON data (array of objects) or path to JSON file |
output_path | string | No | /tmp/output.csv | Path where the output file will be saved |
delimiter | select (,, ;, , ` | , `) | No | , |
include_header | boolean | No | True | Include column headers in first row |
flatten_nested | boolean | No | True | Flatten nested objects using dot notation (e.g., address.city) |
columns | array | No | [] | Specific columns to include (empty = all columns) |
Output:
| Field | Type | Description |
|---|---|---|
output_path | string | 생성된 CSV 파일 경로 |
row_count | number | 생성된 CSV 파일 경로 |
column_count | number | 생성된 CSV 파일 경로 |
columns | array | 작성된 행 수 |
Example: Convert JSON array to CSV
input_data: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
output_path: /tmp/users.csvExample: Convert JSON file
input_data: /path/to/data.json
output_path: /path/to/output.csv데이터 파이프라인
data.pipeline
여러 데이터 변환을 한 번에 연결
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
input | any | Yes | - | 변환할 입력 데이터 (배열 또는 객체) |
steps | array | Yes | - | 변환할 입력 데이터 (배열 또는 객체) |
Output:
| Field | Type | Description |
|---|---|---|
result | any | 적용할 변환 단계 배열 |
original_count | integer | 변환된 데이터 |
result_count | integer | 변환된 데이터 |
steps_applied | integer | 변환 후 항목 수 |
Example: Example
input: ${input.users}
steps: [{"filter": {"field": "active", "condition": "eq", "value": true}}, {"sort": {"field": "name", "order": "asc"}}]Example: Example
input: ${input.records}
steps: [{"map": {"extract": "id"}}, {"limit": 10}]Example: Example
input: ${input.data}
steps: [{"filter": {"field": "status", "condition": "eq", "value": "completed"}}, {"pick": ["id", "name", "timestamp"]}, {"sort": {"field": "timestamp", "order": "desc"}}, {"skip": 5}, {"limit": 20}]텍스트 템플릿
data.text.template
변수로 텍스트 템플릿 채우기
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
template | string | Yes | - | Text template with {variable} placeholders |
variables | object | Yes | - | Object with variable values |
Output:
| Field | Type | Description |
|---|---|---|
status | string | 작업 상태 |
result | string | 작업 상태 |
Example: Example
template: Hello {name}, you scored {score} points!
variables: {"name": "Alice", "score": 95}XML 생성
data.xml.generate
객체나 배열에서 XML 문자열 생성
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
data | object | Yes | - | XML로 변환할 데이터 |
root_tag | string | No | root | 루트 요소 태그 이름 |
pretty | boolean | No | True | XML 출력을 보기 좋게 출력 |
encoding | string | No | utf-8 | XML 출력의 문자 인코딩 |
declaration | boolean | No | True | XML 선언 헤더 포함 |
Output:
| Field | Type | Description |
|---|---|---|
xml | string | 생성된 XML 문자열 |
Example: Example
data: {"user": {"@attributes": {"id": "1"}, "name": "John", "age": "30"}}
root_tag: users
pretty: trueXML 파싱
data.xml.parse
XML 문자열을 객체로 파싱
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
content | string | No | - | 파싱할 XML 문자열 |
file_path | string | No | - | 파싱할 XML 파일 경로 |
preserve_attributes | boolean | No | True | 파싱된 출력에서 XML 속성 유지 |
Output:
| Field | Type | Description |
|---|---|---|
result | object | 객체로 파싱된 XML |
root_tag | string | 루트 요소 태그 이름 |
Example: Example
content: <users><user id="1"><name>John</name></user></users>
preserve_attributes: trueYAML 생성
data.yaml.generate
객체나 배열에서 YAML 문자열 생성
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
data | any | Yes | - | YAML로 변환할 데이터 |
default_flow_style | boolean | No | False | 중첩 구조에 플로우 스타일 사용 |
sort_keys | boolean | No | False | 키를 알파벳 순으로 정렬 |
indent | number | No | 2 | 들여쓰기 공백 수 |
allow_unicode | boolean | No | True | 출력에 유니코드 문자 허용 |
Output:
| Field | Type | Description |
|---|---|---|
yaml | string | 생성된 YAML 문자열 |
Example: Example
data: {"name": "John", "age": 30, "cities": ["NYC", "LA"]}
sort_keys: false
indent: 2YAML 파싱
data.yaml.parse
YAML 문자열을 객체로 파싱
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
content | string | No | - | 파싱할 YAML 문자열 |
file_path | string | No | - | 파싱할 YAML 파일 경로 |
multi_document | boolean | No | False | 다중 문서 YAML 파싱 (---로 구분) |
Output:
| Field | Type | Description |
|---|---|---|
result | any | 객체나 배열로 파싱된 YAML |
type | string | 파싱된 결과의 유형 |
Example: Example
content: name: John
age: 30
cities:
- NYC
- LA
multi_document: falseExample: Example
content: ---
name: John
---
name: Jane
multi_document: true객체 키
object.keys
객체에서 모든 키 가져오기
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | object | Yes | - | Input object/dictionary |
Output:
| Field | Type | Description |
|---|---|---|
keys | array | 객체 키 목록 |
count | number | 객체 키 목록 |
Example: Get object keys
object: {"name": "John", "age": 30, "city": "NYC"}객체 병합
object.merge
여러 객체를 하나로 병합
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
objects | array | Yes | - | Array of objects to process |
Output:
| Field | Type | Description |
|---|---|---|
result | object | 병합된 객체 |
Example: Merge user data
objects: [{"name": "John", "age": 30}, {"city": "NYC", "country": "USA"}, {"job": "Engineer"}]객체 제외
object.omit
객체에서 특정 키 제외
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | object | Yes | - | Input object/dictionary |
keys | array | Yes | - | Keys to pick or omit |
Output:
| Field | Type | Description |
|---|---|---|
result | object | 제외된 키가 없는 객체 |
Example: Omit sensitive fields
object: {"name": "John", "age": 30, "password": "secret", "ssn": "123-45-6789"}
keys: ["password", "ssn"]객체 선택
object.pick
객체에서 특정 키만 선택
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | object | Yes | - | Input object/dictionary |
keys | array | Yes | - | Keys to pick or omit |
Output:
| Field | Type | Description |
|---|---|---|
result | object | 선택된 키만 있는 객체 |
Example: Pick user fields
object: {"name": "John", "age": 30, "email": "john@example.com", "password": "secret"}
keys: ["name", "email"]객체 값
object.values
객체에서 모든 값 가져오기
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
object | object | Yes | - | Input object/dictionary |
Output:
| Field | Type | Description |
|---|---|---|
values | array | 객체 값 목록 |
count | number | 객체 값 목록 |
Example: Get object values
object: {"name": "John", "age": 30, "city": "NYC"}