{"id":20068442,"url":"https://github.com/guiabolso/s3-file-line-rewriter","last_synced_at":"2025-10-19T21:19:45.723Z","repository":{"id":45403298,"uuid":"251455892","full_name":"GuiaBolso/s3-file-line-rewriter","owner":"GuiaBolso","description":"Filter lines out of your S3 files to comply with any regulations and more!","archived":false,"fork":false,"pushed_at":"2021-12-15T15:38:23.000Z","size":75,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-02T11:24:33.019Z","etag":null,"topics":["regulations","rewriter","rewriting-lines","s3"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/GuiaBolso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T23:56:56.000Z","updated_at":"2024-12-09T19:55:27.000Z","dependencies_parsed_at":"2022-08-30T13:21:27.404Z","dependency_job_id":null,"html_url":"https://github.com/GuiaBolso/s3-file-line-rewriter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/GuiaBolso/s3-file-line-rewriter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuiaBolso%2Fs3-file-line-rewriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuiaBolso%2Fs3-file-line-rewriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuiaBolso%2Fs3-file-line-rewriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuiaBolso%2Fs3-file-line-rewriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuiaBolso","download_url":"https://codeload.github.com/GuiaBolso/s3-file-line-rewriter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuiaBolso%2Fs3-file-line-rewriter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279914440,"owners_count":26243251,"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","status":"online","status_checked_at":"2025-10-19T02:00:07.647Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["regulations","rewriter","rewriting-lines","s3"],"created_at":"2024-11-13T14:07:01.271Z","updated_at":"2025-10-19T21:19:45.679Z","avatar_url":"https://github.com/GuiaBolso.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# S3 File Line Rewriter\n\n![Build Status](https://img.shields.io/github/workflow/status/GuiaBolso/s3-file-line-rewriter/Check)\n[![GitHub](https://img.shields.io/github/license/GuiaBolso/s3-file-line-rewriter)](https://github.com/GuiaBolso/s3-file-line-rewriter/blob/master/LICENSE)\n[![Bintray Download](https://img.shields.io/bintray/v/gb-opensource/maven/s3-file-line-rewriter)](https://bintray.com/gb-opensource/maven/s3-file-line-rewriter)\n\n## Introduction\n\nWith many countries creating law to protect user's privacy and data - such as European GDPR or Brazilian LGPD - companies are rushing to find a way to comply to these regulations.\n\nWhen storing multiple user's data in the same S3 file and we want to wipe a single user, we have to open the S3 File, remove all lines with data from a specific user and then reupload the file with that data removed or anonymized.\n\nThe **S3 File Line Rewriter** library aims to ease the process of rewriting those files, with a clean API that will do everything with little memory footprint by processing everything with streams.\n\n## Using with Gradle\n\nThis library is published to `Bintray jcenter`, so you'll need to configure that in your repositories:\n```kotlin\nrepositories {\n    mavenCentral()\n    jcenter()\n}\n```\n\nAnd then you can import it into your dependencies:\n```kotlin\ndependencies {\n    implementation(\"br.com.guiabolso:s3-file-line-rewriter:{version}\")\n}\n```\n\n## Usage\n\nUsing this library is very easy:\n\n#### Declaring the Rewriter:\n```kotlin\nval rewriter = S3FileLineRewriter(myAmazonS3Client)\n```\n\n#### Rewriting lines from a single file:\n```kotlin\nrewriter.rewriteFile(\n    bucket = \"bucket\",\n    key = \"key\"\n) { lines: Sequence\u003cString\u003e -\u003e \n    lines.map { it.replace(\"StringIWantToRedact\", \"*****\") } \n}\n```\n\n#### Rewriting lines from every file with a specific prefix:\n```kotlin\nrewriter.rewriteAll(\n    bucket = \"bucket\",\n    prefix = \"MyDirectory/SubDirectory\"\n) { lines: Sequence\u003cString\u003e -\u003e \n    lines.map { it.replace(\"StringIWantToRedact\", \"*****\") } \n}\n```\n\n## Advanced Usage\n\n#### Line Breaks\nBy default, when rewriting, this library will use `\\n` as the new line character. This can be changed by the System Property `br.com.guiabolso.s3filelinerewriter.newline`\n\n#### Empty Lines\nBy default, when rewriting, if a line becomes empty after transforming it, this library will remove the empty lines from the file. This can be changed by the System Property `br.com.guiabolso.s3filelinerewriter.removeblank`\n\n\n## Contributing\nIf you have any improvements, please feel free to file a PR!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguiabolso%2Fs3-file-line-rewriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguiabolso%2Fs3-file-line-rewriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguiabolso%2Fs3-file-line-rewriter/lists"}