{"id":20602455,"url":"https://github.com/augustunderground/psfclj","last_synced_at":"2026-04-30T06:37:02.329Z","repository":{"id":112836260,"uuid":"318476095","full_name":"AugustUnderground/psfclj","owner":"AugustUnderground","description":"Read PSF Traces in Clojure/Java","archived":false,"fork":false,"pushed_at":"2020-12-04T10:07:26.000Z","size":475,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T16:36:50.360Z","etag":null,"topics":["bnf","clojure","csv","java","psf","psf-data"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AugustUnderground.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-04T10:06:44.000Z","updated_at":"2021-05-27T07:54:01.000Z","dependencies_parsed_at":"2023-05-31T10:15:25.142Z","dependency_job_id":null,"html_url":"https://github.com/AugustUnderground/psfclj","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AugustUnderground/psfclj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fpsfclj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fpsfclj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fpsfclj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fpsfclj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AugustUnderground","download_url":"https://codeload.github.com/AugustUnderground/psfclj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustUnderground%2Fpsfclj/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259727132,"owners_count":22902181,"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":["bnf","clojure","csv","java","psf","psf-data"],"created_at":"2024-11-16T09:13:54.314Z","updated_at":"2026-04-30T06:37:02.292Z","avatar_url":"https://github.com/AugustUnderground.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psfclj\n\nPSF parser for JVM written in clojure.\n\n## Building\n\nRequires [Leiningen](https://leiningen.org/index.html) to run, see\ntheir docs for more information.\n\n### Build and Install as MAVEN dependency for Java InterOp\n\n```bash\n$ lein pom \u0026\u0026 lein install\n```\n\n### Build JAR/UBERJAR\n\n```bash\n$ lein jar\n$ lein uberjar\n```\n\n### Build Standalone Executable\n\nSimply run `make` and the `Makefile` will take care of it.\nThe executable will be `./target/psfconvert`.\n\n## Usage\n\nAfter building with lein you can run:\n\n```bash\n$ java -jar psfclj-0.1.0-standalone.jar [options] \u003cpsf-file\u003e\n```\n\nThe standalone executable can be run like so:\n\n```bash\n$ psfconvert [options] \u003cpsf-file\u003e\n```\n\nDepending on the option, this will produce output to `STDOUT`.\nThis can be redirected to a file, or processed further with something\nlike [jq](https://stedolan.github.io/jq/) \nor [gron](https://github.com/TomNomNom/gron).\nIf no `\u003cpsf-file\u003e` is specified, it will try to read from `STDIN`.\n\n### Options\n\n- `-g \u003cgrammar\u003e` Specify path to alternative `\u003cgrammar\u003e`.\n- `-j` JSON output (default).\n- `-c` CSV output (values only).\n- `-h` or `--help` for a short help.\n\n### Exit States\n\n- `0`: Success!\n- `-1`: Failed with parse error, usually caused by wrong sytnax.\n- `-2`: Erronious command line arguments.\n- `-3`: No output format specified.\n\n### Example\n\n```bash\n# Read ./noise2.noise, pipe json output in gron, \n# grep for \"fn.xf2\" of \"I0.M0.m1\" and inspect with bat\n$ ./target/psfconvert -j ./noise2.noise | gron | grep \"I0.M0.m1\" | grep \"fn.xf2\" | bat\n\n# Pipe json ouput into fzf for interactive search\n$ ./target/psfconvert -j ./noise2.noise | gron | fzf\n\n# Read from stdin and redirect output into file\n$ cat ./noise2.noise | ./target/psfconvert -c \u003e noise2.csv\n```\n\n## PSF BNF\n\nThe default grammar can be found in `resources/psf.bnf`:\n\n```bnf\n\u003cpsf\u003e = \u003csection\u003e *\n\n\u003csection\u003e = HEADER \u003cattribute\u003e *\n          | TYPE   \u003cattribute\u003e *\n          | SWEEP  \u003cattribute\u003e *\n          | TRACE  \u003cattribute\u003e *\n          | VALUE  \u003cattribute\u003e *\n          | END\n\n\u003cattribute\u003e = \u003ckey\u003e [\u003cunit\u003e] \u003cvalues\u003e [\u003cprop\u003e]\n            | \u003ckey\u003e \u003ctypes\u003e \u003cprop\u003e\n            | \u003ckey\u003e \u003cstruct\u003e [\u003cprop\u003e]\n\n\u003ckey\u003e = \" * \"\n\n\u003cunit\u003e = \" * \"\n\nvalues = \u003cvalue\u003e\n       | ( \u003cvalue\u003e * )\n\n\u003cvalue\u003e = #'\\S+'\n        | \" * \"\n\n\u003ctypes\u003e = \u003ctype\u003e\n        | \u003ctype\u003e *\n\n\u003ctype\u003e = FLOAT\n       | DOUBLE\n       | COMPLEX\n\n\u003cprop\u003e = PROP( \u003cattribute\u003e * )\n\n\u003cstruct\u003e = STRUCT( \u003cattribute\u003e * )\n```\n\n## Java API Reference\n\nAfter installing with \n\n```bash\n$ lein pom \u0026\u0026 lein install\n``` \n\nthe `psfclj*.jar` should be in your local repository and classpath.\n\n### Example\n\n```java\nimport java.io.File;\nimport java.io.IOException;\nimport org.apache.commons.io.FileUtils;\nimport clojure.lang.APersistentMap;\nimport psfclj.PSFParser.Parser;\n\npublic class PSFParserExample {\n\n  public static void main(String[] args) throws IOException {\n    \n    Parser parser = new Parser();\n    \n    String psfContent = FileUtils.readFileToString(\n        new File(\"./noise2.noise\"));\n    \n    APersistentMap map = parser.parsePSF(psfContent);\n      \n  }\n}\n```\n\n## TODO\n\n- [X] CSV Output\n- [ ] Comment Code\n- [ ] Read PSF with `\u003cunit\u003e` in `VALUE` section.\n- [ ] Implemented tests\n- [ ] XML Output\n\n## License\n\nCopyright © 2020 Yannick Uhlmann\n\nThis program and the accompanying materials are made available under the\nterms of the the beer-ware license (Revision 42):\nAs long as you retain this notice you can do whatever you want with this stuff. \nIf we meet some day, and you think this stuff is worth it, \nyou can buy me a beer in return.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustunderground%2Fpsfclj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugustunderground%2Fpsfclj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustunderground%2Fpsfclj/lists"}