{"id":25181073,"url":"https://github.com/trygu/pxtools.bucket","last_synced_at":"2026-05-19T14:33:28.381Z","repository":{"id":189027850,"uuid":"679902815","full_name":"trygu/PxTools.Bucket","owner":"trygu","description":"The BucketClient library provides a simple wrapper around the Amazon S3 SDK to interact with Amazon S3 buckets and objects. It includes methods for creating buckets, listing files, uploading files, deleting files, deleting buckets, and reading file contents.","archived":false,"fork":false,"pushed_at":"2023-11-21T13:25:10.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T13:47:29.579Z","etag":null,"topics":["dotnet","s3"],"latest_commit_sha":null,"homepage":"","language":"C#","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/trygu.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-17T22:12:57.000Z","updated_at":"2023-11-15T22:05:42.000Z","dependencies_parsed_at":"2023-11-15T23:24:31.019Z","dependency_job_id":"6963612e-68d2-475f-ba5d-db58b854e5f9","html_url":"https://github.com/trygu/PxTools.Bucket","commit_stats":null,"previous_names":["trygu/pcaxis.s3","trygu/pcaxis.bucket","trygu/pxtools.bucket"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trygu/PxTools.Bucket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trygu%2FPxTools.Bucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trygu%2FPxTools.Bucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trygu%2FPxTools.Bucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trygu%2FPxTools.Bucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trygu","download_url":"https://codeload.github.com/trygu/PxTools.Bucket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trygu%2FPxTools.Bucket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275998211,"owners_count":25567385,"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-09-19T02:00:09.700Z","response_time":108,"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":["dotnet","s3"],"created_at":"2025-02-09T16:38:27.041Z","updated_at":"2025-09-19T20:35:50.482Z","avatar_url":"https://github.com/trygu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BucketClient Library\n\nThe `BucketClient` library provides a simple wrapper around the Amazon S3 SDK and Google Cloud Storage to interact with Amazon S3 buckets, Google Cloud Storage buckets, and their objects. It includes methods for creating buckets, listing files, uploading files, deleting files, deleting buckets, and reading file contents.\n\n## Usage\n\nYou can use the `BucketClient` for both Amazon S3 and Google Cloud Storage based on the provided configuration.\n\n### For Amazon S3:\n\n```csharp\nusing PxTools.Bucket.Client;\n\nclass Program\n{\n    static void Main()\n    {\n        // Initialize BucketClient for Amazon S3\n        var bucketClient = new BucketClient(\"http://s3.dapla.ssb.no\", \"fakeKey\", \"fakeSecret\", false, \"fakePxBucket\");\n\n        // List files in the default bucket\n        var files = bucketClient.ListFiles();\n        foreach (var file in files)\n        {\n            Console.WriteLine($\"File Key: {file.Key}\");\n        }\n\n        // Create a new bucket\n        bucketClient.CreateBucket(\"newBucket\");\n\n        // Upload a file to the default bucket\n        using (var fileStream = File.OpenRead(\"file.txt\"))\n        {\n            bucketClient.UploadFile(\"fileKey\", fileStream);\n        }\n\n        // Delete a file from the default bucket\n        bucketClient.DeleteFile(\"fileKey\");\n\n        // Delete a bucket\n        bucketClient.DeleteBucket(\"newBucket\");\n\n        // Read file content\n        bucketClient.ReadFile(\"fileKey\", stream =\u003e\n        {\n            using var reader = new StreamReader(stream);\n            var content = reader.ReadToEnd();\n            Console.WriteLine($\"File Content: {content}\");\n        });\n    }\n}\n```\n### For Google Cloud Storage:\n\n```csharp\nusing PCAxis.S3.Client;\n\nclass Program\n{\n    static void Main()\n    {\n        // Initialize BucketClient for Google Cloud Storage\n        var bucketClient = new BucketClient(\"http://storage.googleapis.com\", \"fakeKey\", \"fakeSecret\", true, \"fakePxBucket\");\n        // List files in the default bucket\n        var files = bucketClient.ListFiles();\n        foreach (var file in files)\n        {\n            Console.WriteLine($\"File Key: {file.Key}\");\n        }\n\n        // Create a new bucket\n        bucketClient.CreateBucket(\"newBucket\");\n\n        // Upload a file to the default bucket\n        using (var fileStream = File.OpenRead(\"file.txt\"))\n        {\n            bucketClient.UploadFile(\"fileKey\", fileStream);\n        }\n\n        // Delete a file from the default bucket\n        bucketClient.DeleteFile(\"fileKey\");\n\n        // Delete a bucket\n        bucketClient.DeleteBucket(\"newBucket\");\n\n        // Read file content\n        bucketClient.ReadFile(\"fileKey\", stream =\u003e\n        {\n            using var reader = new StreamReader(stream);\n            var content = reader.ReadToEnd();\n            Console.WriteLine($\"File Content: {content}\");\n        });\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrygu%2Fpxtools.bucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrygu%2Fpxtools.bucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrygu%2Fpxtools.bucket/lists"}