https://github.com/biojulia/automa.jl

A julia code generator for regular expressions

https://github.com/biojulia/automa.jl

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 12 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

julia regular-expression

Keywords from Contributors

programming-language numerical julialang ecology tabular-data dataframes data-frame biology cryptography ida
Last synced: 5 months ago · JSON representation

Repository

A julia code generator for regular expressions

Basic Info
  • Host: GitHub
  • Owner: BioJulia
  • License: other
  • Language: Julia
  • Default Branch: master
  • Homepage:
  • Size: 2.45 MB
Statistics
  • Stars: 192
  • Watchers: 14
  • Forks: 16
  • Open Issues: 9
  • Releases: 28
Topics
julia regular-expression
Created about 9 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

Automa.jl

Unit tests Status Downstream tests Status Docs Stable codecov.io

Automa is a regex-to-Julia compiler. By compiling regex to Julia code in the form of Expr objects, Automa provides facilities to create efficient and robust regex-based lexers, tokenizers and parsers using Julia's metaprogramming capabilities. You can view Automa as a regex engine that can insert arbitrary Julia code into its input matching process, which will be executed when certain parts of the regex matches an input.

Schema of Automa.jl

Automa is designed to generate very efficient code to scan large text data, often much faster than handcrafted code.

For more information read the documentation, or read the examples below and in the examples/ directory in this repository.

Examples

Validate some text is composed only of ASCII alphanumeric characters

```julia using Automa

generatebuffervalidator(:validate_alphanumeric, re"[a-zA-Z0-9]*") |> eval

for s in ["abc", "aU81m", "!,>"] println("$s is alphanumeric? $(isnothing(validate_alphanumeric(s)))") end ```

Making a lexer

```julia using Automa

tokens = [ :identifier => re"[A-Za-z][0-9A-Za-z!]*", :lparens => re"(", :rparens => re")", :comma => re",", :quot => re"\"", :space => re"[\t\f ]+", ]; @eval @enum Token errortoken $(first.(tokens)...) make_tokenizer((errortoken, [Token(i) => j for (i,j) in enumerate(last.(tokens))] )) |> eval

collect(tokenize(Token, """(alpha, "beta15")""")) ```

Make a simple TSV file parser

```julia using Automa

machine = let name = onexit!(onenter!(re"[^\t\r\n]+", :mark), :name) field = onexit!(onenter!(re"[^\t\r\n]+", :mark), :field) nameline = name * rep('\t' * name) record = onexit!(field * rep('\t' * field), :record) compile(nameline * re"\r?\n" * record * rep(re"\r?\n" * record) * rep(re"\r?\n")) end

actions = Dict( :mark => :(pos = p), :name => :(push!(headers, String(data[pos:p-1]))), :field => quote nfields += 1 push!(fields, String(data[pos:p-1])) end, :record => quote nfields == length(headers) || error("Malformed TSV") n_fields = 0 end )

@eval function parsetsv(data) headers = String[] fields = String[] pos = nfields = 0 $(generate_code(machine, actions)) (headers, reshape(fields, length(headers), :)) end

header, data = parse_tsv("a\tabc\n12\t13\r\nxyc\tz\n\n") ```

Owner

  • Name: BioJulia
  • Login: BioJulia
  • Kind: organization

Bioinformatics and Computational Biology in Julia

GitHub Events

Total
  • Create event: 1
  • Commit comment event: 2
  • Issues event: 2
  • Release event: 1
  • Watch event: 2
  • Issue comment event: 8
  • Push event: 5
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 1
Last Year
  • Create event: 1
  • Commit comment event: 2
  • Issues event: 2
  • Release event: 1
  • Watch event: 2
  • Issue comment event: 8
  • Push event: 5
  • Pull request review event: 1
  • Pull request event: 5
  • Fork event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 327
  • Total Committers: 12
  • Avg Commits per committer: 27.25
  • Development Distribution Score (DDS): 0.453
Past Year
  • Commits: 8
  • Committers: 3
  • Avg Commits per committer: 2.667
  • Development Distribution Score (DDS): 0.375
Top Committers
Name Email Commits
Kenta Sato b****5@g****m 179
Jakob Nybo Nissen j****n@g****m 126
Kevin Bonham k****m@g****m 6
Ben J. Ward w****0@g****m 5
Ciarán O'Mara C****a@u****u 2
SundaraRaman R s****r@a****n 2
nhz2 n****2@c****u 2
= = 1
Daniel C. Jones d****s@c****u 1
Elliot Saba s****t@g****m 1
denshd 7****d 1
femtocleaner[bot] f****] 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 47
  • Total pull requests: 73
  • Average time to close issues: 7 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 14
  • Total pull request authors: 12
  • Average comments per issue: 2.17
  • Average comments per pull request: 1.73
  • Merged pull requests: 67
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 1
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jakobnissen (31)
  • Kolaru (4)
  • jtrakk (1)
  • Azzaare (1)
  • richardreeve (1)
  • andreypopp (1)
  • sjoelund (1)
  • tlienart (1)
  • lesshaste (1)
  • cmcaine (1)
  • jagot (1)
  • racinmat (1)
  • SabrinaJaye (1)
  • JuliaTagBot (1)
Pull Request Authors
  • jakobnissen (44)
  • bicycle1885 (15)
  • kescobo (3)
  • SabrinaJaye (3)
  • nhz2 (2)
  • femtocleaner[bot] (2)
  • digital-carver (2)
  • richiejp (1)
  • denshd (1)
  • dcjones (1)
  • CiaranOMara (1)
  • macd (1)
Top Labels
Issue Labels
enhancement (4) bug (2) Out of scope (1) question (1) wontfix (1) future (1)
Pull Request Labels
enhancement (1) Documentation (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 4,275 total
  • Total dependent packages: 19
  • Total dependent repositories: 18
  • Total versions: 12
juliahub.com: Automa

A julia code generator for regular expressions

  • Versions: 12
  • Dependent Packages: 19
  • Dependent Repositories: 18
  • Downloads: 4,275 Total
Rankings
Dependent repos count: 2.0%
Dependent packages count: 4.0%
Stargazers count: 4.4%
Average: 4.8%
Forks count: 8.7%
Last synced: 6 months ago

Dependencies

.github/workflows/Documentation.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg latest composite
  • julia-actions/julia-docdeploy latest composite
.github/workflows/Downstream.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg latest composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/UnitTests.yml actions
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest latest composite
  • julia-actions/setup-julia v1 composite