Giter Club home page Giter Club logo

parsenoteval.jl's Introduction


version deps pkgeval

ParseNotEval Is a core odd data package that acts as both an implicit and explicit type parser. The main usage for such a thing is in file/string reading, by being able to quickly parse strings into their appropriate types. This is helpful if you want to make secure and fast data readers. This module is moreso ecosystem geared.

adding and using

Until the team is ready to release a stable version (very soon, likely today,) you will need to add the package via URL:

using Pkg
Pkg.add(url = "https://github.com/ChifiSource/ParseNotEval.jl.git")

The only thing that this module exports is the parse method and Dates.DateTime + Dates.Date. The extensions provided to parse() allow for one to pass tons of different types and structures through in order to create them. For example, we could read a Dict in from a string:

dct_str = "A => [5, 10, 15], B => [5, 10, 15]"
parse(Dict, dct_string)
Dict(:A => [5, 10, 15], :B => [5, 10, 15])

# This also works with JSON.
dct_str = "{A : [5, 10, 15], B : [5, 10, 15]}"
parse(Dict, dct_string)
Dict(:A => [5, 10, 15], :B => [5, 10, 15])

There are a lot more structures involved as well, the best choice is to use ?(parse) to get the docs all of the methods for parse, or view the JuliaHub documentation. One notable other example is that of parse(Any, ::String).

typeof(parse(Any, 5.0))
Float64
typeof(parse(Any, 5))
Int64

parsenoteval.jl's People

Contributors

emmaccode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

parsenoteval.jl's Issues

The dict parser still needs a bit of work

we need to separate each value by comma first... The reason why this is on hold is because we also need to at some point check arrays and things in order to ensure that we do not split in the middle of arrays. The best way to do this is probably to use findall() to find seperators such as {} or [], and then we parse those values separately. So to backtrack, step 1 will be to scan for all instances of {} or [], we save the indexes of these points by the nearest =>, using findnext, findall, and findlast -- maybe ranges. You get the idea.

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.