{"id":15043279,"url":"https://github.com/fmbenhassine/unix-stream","last_synced_at":"2026-02-24T05:27:01.993Z","repository":{"id":57732583,"uuid":"43795380","full_name":"fmbenhassine/unix-stream","owner":"fmbenhassine","description":"Turn Java 8 Streams into Unix like pipelines","archived":false,"fork":false,"pushed_at":"2018-12-12T22:07:13.000Z","size":1811,"stargazers_count":123,"open_issues_count":0,"forks_count":15,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-10T00:41:29.917Z","etag":null,"topics":["java-8","pipeline","unix","unix-command"],"latest_commit_sha":null,"homepage":"https://github.com/benas/unix-stream/wiki","language":"Java","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/fmbenhassine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-07T04:37:57.000Z","updated_at":"2025-01-05T13:38:34.000Z","dependencies_parsed_at":"2022-09-11T16:41:21.617Z","dependency_job_id":null,"html_url":"https://github.com/fmbenhassine/unix-stream","commit_stats":null,"previous_names":["benas/xstream","benas/ustream","benas/unix-stream"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmbenhassine%2Funix-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmbenhassine%2Funix-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmbenhassine%2Funix-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmbenhassine%2Funix-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmbenhassine","download_url":"https://codeload.github.com/fmbenhassine/unix-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137999,"owners_count":21053775,"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":["java-8","pipeline","unix","unix-command"],"created_at":"2024-09-24T20:48:47.976Z","updated_at":"2026-02-24T05:26:56.963Z","avatar_url":"https://github.com/fmbenhassine.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is UnixStream?\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/benas/unix-stream?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](http://opensource.org/licenses/MIT)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.benas/unix-stream/badge.svg?style=flat)](http://search.maven.org/#artifactdetails|io.github.benas|unix-stream|0.5|)\n[![Build Status](https://travis-ci.org/benas/unix-stream.svg?branch=master)](https://travis-ci.org/benas/unix-stream)\n[![Coverage Status](https://coveralls.io/repos/github/benas/unix-stream/badge.svg?branch=master)](https://coveralls.io/github/benas/unix-stream?branch=master)\n\nUnixStream is an extension of the Java 8 Stream API to process data pipelines the Unix way.\nIt provides a set of components that mimic Unix commands (and more).\n\n# Features\n\n* 100% compatible with Java 8 Streams\n* Intuitive, flexible and extensible API\n* A toolbox of reusable components\n* No dependencies\n* Free and open source\n\n# How to use it?\n\nYou can use UnixStream in 3 ways:\n\n#### 1. Either unixify your stream and process it the unix way:\n\n```java\nStream\u003cString\u003e stream = Stream.of(\"foo\", \"bar\", \"bar\", \"baz\");\n\nUnixStream.unixify(stream)\n        .grep(\"a\")\n        .sort()\n        .uniq()\n        .nl()\n        .to(stdOut());\n        \n// prints:\n// 1 bar\n// 2 baz\n```\n\n#### 2. Or write your pipelines as you read them:\n\n```java\n// cat input.txt | grep a | sort | uniq | nl \u003e output.txt\n\nUnixStream.cat(\"input.txt\")\n        .pipe(grep(\"a\"))\n        .pipe(sort())\n        .pipe(uniq())\n        .pipe(nl())\n        .to(file(\"output.txt\"));\n```\n\n#### 3. Or use functions and predicates provided by UnixStream with the standard Stream API:\n\n```java\nStream.of(\"1,foo\", \"2,bar\")\n        .filter(grep(\"a\"))\n        .map(cut(\",\", 2))\n        .forEach(System.out::println);\n        \n//prints:\n//bar\n```\n\n# Where to find it?\n\nAdd the following maven dependency to your project:\n\n ```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.benas\u003c/groupId\u003e\n    \u003cartifactId\u003eunix-stream\u003c/artifactId\u003e\n    \u003cversion\u003e0.5\u003c/version\u003e\n\u003c/dependency\u003e\n ```\n\nOr [download the jar file](https://oss.sonatype.org/content/groups/public/io/github/benas/unix-stream/0.5/unix-stream-0.5.jar) and add it to your application's classpath.\n\n# Components library\n\nUnixStream provides a toolbox of reusable components that mimic Unix commands (and more).\nComponents are inspired by the [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy#Mike_Gancarz:_The_UNIX_Philosophy) and are intended to be:\n\n* Small\n* Portable\n* Do one thing and do it well\n* Side-effect free\n\nHere are some of the built-in components:\n\n![](https://github.com/benas/unix-stream/raw/master/unix-stream.jpeg)\n\nYou can find a complete reference of components in the [wiki page](https://github.com/benas/unix-stream/wiki).\n\n# How to extend it ?\n\nThe `Stage` interface represents a stage of the pipeline:\n\n```java\npublic interface Stage\u003cI,O\u003e {\n\n  Stream\u003cO\u003e apply(Stream\u003cI\u003e input);\n\n}\n```\n\nAll built-in components are implemented as filters/transformers through this interface.\nYou can of course implement this interface to create your own components.\n\n# Contribution\n\nThere are a lot of options for current components that are not implemented yet.\nYou are welcome to improve existing components or add new ones to make the toolbox as rich as possible!\n\n# License\n\n UnixStream is released under the [MIT License](http://opensource.org/licenses/mit-license.php/):\n\n ```\n The MIT License\n\n Copyright (c) 2018, Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmbenhassine%2Funix-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmbenhassine%2Funix-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmbenhassine%2Funix-stream/lists"}