Giter Club home page Giter Club logo

nanocsv.jl's Introduction

Nanocsv.jl

A minimal implementation of CSV reader/writer for Julia. It reads and writes DataFrames from/to file on disk.

Installation: at the Julia REPL, using Pkg; Pkg.add(PackageSpec(url="https://github.com/bkamins/Nanocsv.jl"))

Design

  • always use " as quote character, "" represents a quote in quoted field
  • you can change field separator using delim keyword argument
  • when data is written to disk then string function is used to get its representation
  • by default tries to parse columns to Int, Float64 using parse function and falls back to String; you can change list or sequence of tried parsers using parsers keyword argument
  • handles missing values using na keyword argument; na is always unquoted when reading/writing (except if header line is present in a file as then it is read as is); if string equal to na is written it is always quoted; if value equal to na is quoted in file then it is treated as a valid value not missing

Functions provided

Writing CSV to disk:

write_csv(io::IO, df::DataFrame;
          delim::Char=',', na::AbstractString="")
write_csv(filename::AbstractString, df::DataFrame;
          delim::Char=',', na::AbstractString="")

Reading CSV from disk:

read_csv(io::IO;
         delim::Char=',', header::Bool=true, na::String="",
         parsers::Vector{DataType} = [Int, Float64],
         skiphead::Int=0, nrows::Union{Int, Nothing}=nothing)
read_csv(filename::AbstractString;
         delim::Char=',', header::Bool=true, na::String="",
         parsers::Vector{DataType} = [Int, Float64],
         skiphead::Int=0, nrows::Union{Int, Nothing}=nothing)

nanocsv.jl's People

Contributors

bkamins avatar pszufe avatar

Stargazers

STYLIANOS IORDANIS avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

pszufe stjordanis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.