Skip to content

Commit

Permalink
feat: Sample notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
timgremore committed May 8, 2024
1 parent e069529 commit 944e7fc
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Edix

**TODO: Add description**
[![Run in Livebook](https://livebook.dev/badge/v1/blue.svg)](https://livebook.dev/run?url=https://github.com/headwayio/edix/blob/main/edix.livemd)

## Installation

Expand All @@ -10,7 +10,7 @@ by adding `edix` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:edix, "~> 0.1.0"}
{:edix, "~> 0.1.4"}
]
end
```
Expand Down
33 changes: 33 additions & 0 deletions edix.livemd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- livebook:{"file_entries":[{"name":"sample.edi","type":"attachment"}]} -->

# Edix

```elixir
Mix.install([
{:kino_explorer, "~> 0.1.19"},
{:edix, path: "/Users/timgremore/dev/edix", version: "~> 0.1.4"}
])
```

## Section

```elixir
sample_edi_file = Kino.FS.file_path("sample.edi")
```

```elixir
{:ok, edix_document} = Edix.parse_edi_file(sample_edi_file)

edix_map =
edix_document
|> Map.from_struct()

envelope =
edix_map[:envelope]
|> Enum.map(&Map.from_struct/1)
|> dbg()

edix_map = Map.put(edix_map, :envelope, envelope)

Explorer.DataFrame.new([edix_map])
```
38 changes: 38 additions & 0 deletions files/sample.edi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
ISA*00* *00* *08*915792US00 *02*8TMW *240429*0614*:*00501*204299166*0*P*>~
GS*SM*915792US00*8TMW*20240429*0614*204299166*X*005010~
ST*204*0001~
B2**8TMW**34029920**CC~
B2A*00*LT~
L11*0*ACB~
G62*64*20240429*1*080800*CT~
NTE**No Comments~
N1*OB*Sample Inc*UL*0012842000008~
N7*WM*0*********TF****5300~
S5*1*CL***0*DH~
L11*4208105*P8~
G62*10*20240503~
AT5**ZZ~
N1*SF*FIVE STARS WAREHOUSE*93*4208105~
N3*150 RIDGE ROAD~
N4*DAYTON*NJ*08810~
G61*IC*MOUNIR*TE*7323290791~
G61*IC*MOUNIR*EM*[email protected]~
OID*20*5060796996*34*CAS*341*L*2573*E*1340~
G62*01*20240503~
OID*20*1079154378*23*CAS*724*L*3076*E*1340~
G62*01*20240508~
S5*2*CU***658*DH~
L11*26692139*AO~
G62*78*20240505*3*000000*ET~
AT8*G*L*5649*1065**E*2680~
N1*ST*DC 6014*UL*0078742028927~
N3*1050 VERN CORA RD~
N4*LAURENS*SC*29360~
OID*20*5060796996*34*CAS*341*L*2573*E*1340~
G62*01*20240503~
OID*20*1079154378*23*CAS*724*L*3076*E*1340~
G62*01*20240508~
L3*5649*G*1006.74*PM*100674****2680*E*1065~
SE*34*0001~
GE*1*204299166~
IEA*1*204299166~

0 comments on commit 944e7fc

Please sign in to comment.