Skip to content

Data Transform

CSV, JSON, XML, YAML parsing, generation, and pipeline transformations.

16 modules

ModuleDescription
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:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file
delimiterselect (,, ;, , `, `)No,
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8Character encoding for the file
skip_headerbooleanNoFalseSkip first row (header)

Output:

FieldTypeDescription
statusstring작업 상태
dataarray작업 상태
rowsnumber작업 상태
columnsarray행 객체 배열

Example: Example

yaml
file_path: data/users.csv
delimiter: ,
encoding: utf-8

CSV 파일 쓰기

data.csv.write

객체 배열을 CSV 파일에 쓰기

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file
dataarrayYes-Array of data items to process
delimiterselect (,, ;, , `, `)No,
encodingselect (utf-8, ascii, latin-1, utf-16, gbk, big5)Noutf-8Character encoding for the file

Output:

FieldTypeDescription
statusstring작업 상태
file_pathstring작업 상태
rows_writtennumber작업 상태

Example: Example

yaml
file_path: output/results.csv
data: [{"name": "John", "score": 95}, {"name": "Jane", "score": 87}]

JSON 파싱

data.json.parse

JSON 문자열을 객체로 파싱

Parameters:

NameTypeRequiredDefaultDescription
json_stringstringYes-JSON string to parse into an object or array

Output:

FieldTypeDescription
statusstring작업 상태
dataobject작업 상태

Example: Example

yaml
json_string: {"name": "John", "age": 30}

JSON 문자열화

data.json.stringify

객체를 JSON 문자열로 변환

Parameters:

NameTypeRequiredDefaultDescription
dataobjectYes-Data object to process
prettybooleanNoFalseFormat with indentation
indentnumberNo2Indentation spaces (if pretty=true)

Output:

FieldTypeDescription
statusstring작업 상태
jsonstring작업 상태

Example: Example

yaml
data: {"name": "John", "age": 30}
pretty: true

JSON을 CSV로

data.json_to_csv

JSON 데이터 또는 파일을 CSV 형식으로 변환

Parameters:

NameTypeRequiredDefaultDescription
input_dataanyYes-JSON data (array of objects) or path to JSON file
output_pathstringNo/tmp/output.csvPath where the output file will be saved
delimiterselect (,, ;, , `, `)No,
include_headerbooleanNoTrueInclude column headers in first row
flatten_nestedbooleanNoTrueFlatten nested objects using dot notation (e.g., address.city)
columnsarrayNo[]Specific columns to include (empty = all columns)

Output:

FieldTypeDescription
output_pathstring생성된 CSV 파일 경로
row_countnumber생성된 CSV 파일 경로
column_countnumber생성된 CSV 파일 경로
columnsarray작성된 행 수

Example: Convert JSON array to CSV

yaml
input_data: [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]
output_path: /tmp/users.csv

Example: Convert JSON file

yaml
input_data: /path/to/data.json
output_path: /path/to/output.csv

데이터 파이프라인

data.pipeline

여러 데이터 변환을 한 번에 연결

Parameters:

NameTypeRequiredDefaultDescription
inputanyYes-변환할 입력 데이터 (배열 또는 객체)
stepsarrayYes-변환할 입력 데이터 (배열 또는 객체)

Output:

FieldTypeDescription
resultany적용할 변환 단계 배열
original_countinteger변환된 데이터
result_countinteger변환된 데이터
steps_appliedinteger변환 후 항목 수

Example: Example

yaml
input: ${input.users}
steps: [{"filter": {"field": "active", "condition": "eq", "value": true}}, {"sort": {"field": "name", "order": "asc"}}]

Example: Example

yaml
input: ${input.records}
steps: [{"map": {"extract": "id"}}, {"limit": 10}]

Example: Example

yaml
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:

NameTypeRequiredDefaultDescription
templatestringYes-Text template with {variable} placeholders
variablesobjectYes-Object with variable values

Output:

FieldTypeDescription
statusstring작업 상태
resultstring작업 상태

Example: Example

yaml
template: Hello {name}, you scored {score} points!
variables: {"name": "Alice", "score": 95}

XML 생성

data.xml.generate

객체나 배열에서 XML 문자열 생성

Parameters:

NameTypeRequiredDefaultDescription
dataobjectYes-XML로 변환할 데이터
root_tagstringNoroot루트 요소 태그 이름
prettybooleanNoTrueXML 출력을 보기 좋게 출력
encodingstringNoutf-8XML 출력의 문자 인코딩
declarationbooleanNoTrueXML 선언 헤더 포함

Output:

FieldTypeDescription
xmlstring생성된 XML 문자열

Example: Example

yaml
data: {"user": {"@attributes": {"id": "1"}, "name": "John", "age": "30"}}
root_tag: users
pretty: true

XML 파싱

data.xml.parse

XML 문자열을 객체로 파싱

Parameters:

NameTypeRequiredDefaultDescription
contentstringNo-파싱할 XML 문자열
file_pathstringNo-파싱할 XML 파일 경로
preserve_attributesbooleanNoTrue파싱된 출력에서 XML 속성 유지

Output:

FieldTypeDescription
resultobject객체로 파싱된 XML
root_tagstring루트 요소 태그 이름

Example: Example

yaml
content: <users><user id="1"><name>John</name></user></users>
preserve_attributes: true

YAML 생성

data.yaml.generate

객체나 배열에서 YAML 문자열 생성

Parameters:

NameTypeRequiredDefaultDescription
dataanyYes-YAML로 변환할 데이터
default_flow_stylebooleanNoFalse중첩 구조에 플로우 스타일 사용
sort_keysbooleanNoFalse키를 알파벳 순으로 정렬
indentnumberNo2들여쓰기 공백 수
allow_unicodebooleanNoTrue출력에 유니코드 문자 허용

Output:

FieldTypeDescription
yamlstring생성된 YAML 문자열

Example: Example

yaml
data: {"name": "John", "age": 30, "cities": ["NYC", "LA"]}
sort_keys: false
indent: 2

YAML 파싱

data.yaml.parse

YAML 문자열을 객체로 파싱

Parameters:

NameTypeRequiredDefaultDescription
contentstringNo-파싱할 YAML 문자열
file_pathstringNo-파싱할 YAML 파일 경로
multi_documentbooleanNoFalse다중 문서 YAML 파싱 (---로 구분)

Output:

FieldTypeDescription
resultany객체나 배열로 파싱된 YAML
typestring파싱된 결과의 유형

Example: Example

yaml
content: name: John
age: 30
cities:
  - NYC
  - LA
multi_document: false

Example: Example

yaml
content: ---
name: John
---
name: Jane
multi_document: true

객체 키

object.keys

객체에서 모든 키 가져오기

Parameters:

NameTypeRequiredDefaultDescription
objectobjectYes-Input object/dictionary

Output:

FieldTypeDescription
keysarray객체 키 목록
countnumber객체 키 목록

Example: Get object keys

yaml
object: {"name": "John", "age": 30, "city": "NYC"}

객체 병합

object.merge

여러 객체를 하나로 병합

Parameters:

NameTypeRequiredDefaultDescription
objectsarrayYes-Array of objects to process

Output:

FieldTypeDescription
resultobject병합된 객체

Example: Merge user data

yaml
objects: [{"name": "John", "age": 30}, {"city": "NYC", "country": "USA"}, {"job": "Engineer"}]

객체 제외

object.omit

객체에서 특정 키 제외

Parameters:

NameTypeRequiredDefaultDescription
objectobjectYes-Input object/dictionary
keysarrayYes-Keys to pick or omit

Output:

FieldTypeDescription
resultobject제외된 키가 없는 객체

Example: Omit sensitive fields

yaml
object: {"name": "John", "age": 30, "password": "secret", "ssn": "123-45-6789"}
keys: ["password", "ssn"]

객체 선택

object.pick

객체에서 특정 키만 선택

Parameters:

NameTypeRequiredDefaultDescription
objectobjectYes-Input object/dictionary
keysarrayYes-Keys to pick or omit

Output:

FieldTypeDescription
resultobject선택된 키만 있는 객체

Example: Pick user fields

yaml
object: {"name": "John", "age": 30, "email": "john@example.com", "password": "secret"}
keys: ["name", "email"]

객체 값

object.values

객체에서 모든 값 가져오기

Parameters:

NameTypeRequiredDefaultDescription
objectobjectYes-Input object/dictionary

Output:

FieldTypeDescription
valuesarray객체 값 목록
countnumber객체 값 목록

Example: Get object values

yaml
object: {"name": "John", "age": 30, "city": "NYC"}

Released under the Apache 2.0 License.