ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - erpuno/ecsv: 💠 ECSV: Потоковий CSV парсер
💠 ECSV: Потоковий CSV парсер. Contribute to erpuno/ecsv development by creating an account on GitHub.
Visit Site

GitHub - erpuno/ecsv: 💠 ECSV: Потоковий CSV парсер

GitHub - erpuno/ecsv: 💠 ECSV: Потоковий CSV парсер

Erlang NIF CSV parser and writer

Hex pm

Copyright (c) 2016 Altworx

Version: 0.2.0

Authors: Hynek Vychodil ([email protected]).

See also: ecsv.

ecsv is fast NIF parser and writer based on libcsv

The main purpose of the module is the fast parsing of CSV data in GB volumes. This requirement leads to the necessity of stream oriented API (see ecsv:parse_stream/4).

Building

Application requires development files for libcsv version 3.0.x (tested with 3.0.3). For example in debian you need run

apt-get install libcsv3 libcsv-dev

For building you need installed rebar3.

rebar3 compile

And run tests using

rebar3 eunit

Running

For interactive Erlang shell use

rebar3 shell

Try as starter

1> ecsv:parse(<<"Hello,World">>).
[{<<"Hello">>,<<"World">>}]

See ecsv for API description.

Known performance caveats

ecsv:write/1 and ecsv:write_lines/1 doesn't perform as expected. For an unknown reason, it is slower than pure Erlang implementation when compiled using HiPE and used in a real application. On the other hand, ecsv:parse_stream/5 met expectations and performs around 100MB/s on commodity HW (i7 2.6GHz).

Current implementation uses enif_make_new_binary() for parsed fields. From our experience, this call allocates small binaries on the process heap in contrast to enif_alloc_binary() always allocates on the binary heap which is slightly slower. Fields from currently parsed line is kept between NIF calls in an own environment which could lead to bad behavior when parse_raw/3 is called with very short binaries and there is a long row with many fields. In an extreme case, one long line with short or in worst case empty fields will lead to quadratic behavior if fed one byte a time. If you would like parse CSV file with more than 20kB rows with thousands of fields you should probably use another parser or fix the issue.

Modules

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory