{"id":13828691,"url":"https://github.com/MozillaSecurity/avalanche","last_synced_at":"2025-07-09T06:32:42.521Z","repository":{"id":68740510,"uuid":"63278423","full_name":"MozillaSecurity/avalanche","owner":"MozillaSecurity","description":"Avalanche is a document generator which uses context-free grammars to generate randomized outputs for fuzz-testing.","archived":false,"fork":false,"pushed_at":"2021-05-01T01:32:52.000Z","size":238,"stargazers_count":30,"open_issues_count":4,"forks_count":14,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-08-04T09:09:02.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MozillaSecurity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-13T20:47:54.000Z","updated_at":"2024-07-19T12:22:01.000Z","dependencies_parsed_at":"2023-02-26T15:00:19.354Z","dependency_job_id":null,"html_url":"https://github.com/MozillaSecurity/avalanche","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MozillaSecurity%2Favalanche","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MozillaSecurity%2Favalanche/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MozillaSecurity%2Favalanche/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MozillaSecurity%2Favalanche/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MozillaSecurity","download_url":"https://codeload.github.com/MozillaSecurity/avalanche/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225492420,"owners_count":17482869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:03:00.335Z","updated_at":"2024-11-20T08:30:59.812Z","avatar_url":"https://github.com/MozillaSecurity.png","language":"Python","readme":"# Avalanche\n\n[![Build Status](https://api.travis-ci.com/MozillaSecurity/avalanche.svg)](https://travis-ci.com/MozillaSecurity/avalanche)\n[![codecov](https://codecov.io/gh/MozillaSecurity/avalanche/branch/master/graph/badge.svg)](https://codecov.io/gh/MozillaSecurity/avalanche)\n\n\nAvalanche is a document generator which uses context-free grammars to generate\nrandomized outputs for fuzz-testing.  See the examples folder for some working\ngrammars.\n\n\n## Quickstart\n\nDefine your grammar in a text file (UTF-8 encoding). 'root' is the default start symbol.\n\n###### Example my.gmr:\n```\nroot            \"\u003chtml\u003e\\n\" \\\n                \"\u003cbody\u003e\\n\" \\\n                content{10} \\\n                \"\u003c/body\u003e\\n\" \\\n                \"\u003c/html\u003e\"\n\ncontent         \"\u003c\" (tagname) ' style=\"color:' colour ';\"\u003eHello world\u003c/' @1 \"\u003e\\n\"\n\ncolor           \"#\" /[a-f0-9]{3}/\n\ntagname     1   \"b\"\n            1   \"blink\"\n            1   \"i\"\n            1   \"marquee\"\n            1   \"span\"\n```\n\n###### How to generate:\n```\nwith open('my.gmr') as fd:\n    g = Grammar(fd)\nresult = g.generate()\n```\n\n###### Example value of `result` from the above grammar:\n```\n\u003chtml\u003e\n\u003cbody\u003e\n\u003ci style=\"color:#8b2;\"\u003eHello world\u003c/i\u003e\n\u003cmarquee style=\"color:#d09;\"\u003eHello world\u003c/marquee\u003e\n\u003cb style=\"color:#aa9;\"\u003eHello world\u003c/b\u003e\n\u003cb style=\"color:#93d;\"\u003eHello world\u003c/b\u003e\n\u003cb style=\"color:#ada;\"\u003eHello world\u003c/b\u003e\n\u003cspan style=\"color:#464;\"\u003eHello world\u003c/span\u003e\n\u003cspan style=\"color:#90f;\"\u003eHello world\u003c/span\u003e\n\u003cblink style=\"color:#ee9;\"\u003eHello world\u003c/blink\u003e\n\u003cmarquee style=\"color:#661;\"\u003eHello world\u003c/marquee\u003e\n\u003ci style=\"color:#a21;\"\u003eHello world\u003c/i\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n\n## Syntax Cheatsheet\n\n```\n# TextSymbol\nSymName         \"text\"          # generate u\"text\" in the output\n\n# ChoiceSymbol\nSymName   .5    Defn1           # choose between generating Defn1 (1:3 odds)\n          1     Defn2           #                        or Defn2 (2:3 odds)\n\nSymName2  +     SymName         # '+' imports choices \u0026 weights from SymName into SymName2\n          1     Defn3           #   ie. choices are Defn1 (1:5), Defn2 (2:5) or Defn3 (1:5)\n\nSymName3        (SubSym1 | SubSym2)  # inline choice, SubSym1 \u0026 SubSym2 are generated equally\n                                     # this is also a grouping and can be repeated.\n\n# ConcatSymbol\nSymName         SubSym1 SubSym2             # concat, generate SubSym1 then SubSym2\nSymName         SubSym1 ( SubSym2 SubSym3 ) # inline concat (grouping), SubSym2 \u0026 SubSym3 can be\n                                            #   repeated using RepeatSymbol or referenced later in\n                                            #   the same line using RefSymbol\n\n# RepeatSymbol\nSymName         SubSym{a,b}     # repeat SubSym a random number of times, between a and b\nSymName         SubSym{a}       # repeat SubSym 'a' times\nSymName         SubSym?         # shorthand for {0,1}\n# RepeatSampleSymbol\nSymName         SubSym\u003ca,b\u003e     # repeatedly generate SubSym between [a,b] unique choices\n                                #   SubSym must be a choice or a concat containing exactly\n                                #   one choice\n\n# RegexSymbol\nSymName         /[A-Za-z]{0,4}..?[^a-f]{2}/  # simple regex generator, generate from A-Za-z [0,4]\n                                             # times, '.' generates printable ASCII. [^] inverts\n                                             # characters. ? generates [0,1] instances, etc.\n                                             # Unicode ranges are supported.\n\n# RefSymbol\nSymName         @SymName2       # returns a previously generated instance of SymName2\nSymName         ('abc') @1      # returns the value generated in a previous ConcatSymbol defined in the\n                                #   same line (numbered in order of opening bracket, starting at 1)\n\n# FuncSymbol\nSymName         rndint(a,b)     # rndint, rndflt, rndpow2, eval, id, push, pop are built-in,\n                                #   others can be passed as keyword args to the Grammar constructor\n                                #   args can be numeric literals, or symbol definitions\n\n# Import\nBlah            import('another.gmr')    # can use imported symnames like Blah.SymName\n```\n\n\n## About the name\n\nAvalanche is French for \"Avalanche\".\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMozillaSecurity%2Favalanche","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMozillaSecurity%2Favalanche","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMozillaSecurity%2Favalanche/lists"}