{"id":22835183,"url":"https://github.com/jchristn/blobject","last_synced_at":"2025-04-04T14:06:33.941Z","repository":{"id":45306328,"uuid":"127020418","full_name":"jchristn/Blobject","owner":"jchristn","description":"BlobHelper is a common, consistent storage interface for Microsoft Azure, Amazon S3 (and S3-compliant storage), and local filesystem written in C#.","archived":false,"fork":false,"pushed_at":"2025-03-23T06:37:15.000Z","size":589,"stargazers_count":62,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T13:08:44.022Z","etag":null,"topics":["aws-s3","azure","azure-storage","blob","blob-storage","blob-storage-wrapper","client","disk","komodo","kvpbase","nuget","rest","restful","s3","s3-bucket","storage"],"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/jchristn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jchristn"],"custom":["https://paypal.me/joelchristner"]}},"created_at":"2018-03-27T17:09:16.000Z","updated_at":"2025-03-23T06:37:19.000Z","dependencies_parsed_at":"2024-11-14T16:23:36.563Z","dependency_job_id":"a3a2b158-83c2-4238-8903-4c64ecbcd66f","html_url":"https://github.com/jchristn/Blobject","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.07692307692307687,"last_synced_commit":"55c9e79223948955b645366eb70ec55920709a9d"},"previous_names":["jchristn/blobject","jchristn/blobhelper"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FBlobject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FBlobject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FBlobject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2FBlobject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristn","download_url":"https://codeload.github.com/jchristn/Blobject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"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":["aws-s3","azure","azure-storage","blob","blob-storage","blob-storage-wrapper","client","disk","komodo","kvpbase","nuget","rest","restful","s3","s3-bucket","storage"],"created_at":"2024-12-12T22:08:38.004Z","updated_at":"2025-04-04T14:06:33.921Z","avatar_url":"https://github.com/jchristn.png","language":"C#","readme":"![](https://github.com/jchristn/BlobHelper/blob/master/assets/icon.png?raw=true)\n\n# Blobject\n\nBlobject (formerly BlobHelper) is a common, consistent storage interface for Microsoft Azure, Amazon S3, S3 compatible storage (i.e. Minio, Less3, View), CIFS (Windows file shares), NFS (Linux and UNIX file shares), and local filesystem written in C#.\n\n## Help, Feedback, Contribute\n\nIf you have any issues or feedback, please file an issue here in Github. We'd love to have you help by contributing code for new features, optimization to the existing codebase, ideas for future releases, or fixes!\n\n## Overview\n\nThis project was built to provide a simple interface over external storage to help support projects that need to work with potentially multiple storage providers.  It is by no means a comprehensive interface, rather, it supports core methods for creation, retrieval, deletion, metadata, and enumeration.\n\n## Contributors\n\n- @phpfui for adding the original code for BLOB copy functionality\n- @Revazashvili for fixes related to byte array instantiation, Azure, and refactoring\n- @courtzzz for keeping the region list updated\n\n## Dependencies\n\nThough this library is MIT licensed, it is dependent upon other libraries, some of which carry a different license.  Each of these libraries are included by reference, that is, none of their code has been modified.\n\n| Package | URL | License |\n|---------|-----|---------|\n| AWSSDK.S3 | https://github.com/aws/aws-sdk-net | Apache 2.0 |\n| Azure.Storage.Blobs | https://github.com/Azure/azure-sdk-for-net | MIT |\n| EzSmb | https://github.com/ume05rw/EzSmb | LGPL-3.0 |\n| SMBLibrary | https://github.com/TalAloni/SMBLibrary | LGPL-3.0 |\n| NFS-Client | https://github.com/SonnyX/NFS-Client | Unknown, public |\n| Nekodrive | https://github.com/nekoni/nekodrive | Unknown, public | \n| S3Lite | https://github.com/jchristn/S3Lite | MIT |\n\n## New in v5.0.x\n\n- Rename from `BlobHelper` to `Blobject`\n- Added support for CIFS and NFS\n- Remove use of continuation tokens for disk\n- Add `S3Lite` variant, not dependent on AWSSDK\n- Enumerate APIs now return an `IEnumerable\u003cBlobMetadata\u003e`, no pagination required\n- Refactor\n\n## Example Project\n\nRefer to the `Test` project for exercising the library.\n\n## Getting Started - AWS S3\n```csharp\nusing Blobject;\n\nAwsSettings settings = new AwsSettings(\n\taccessKey, \n\tsecretKey, \n\t\"us-west-1\",\n\tbucket);\n\nBlobClient blobs = new BlobClient(settings); \n```\n\n## Getting Started - AWS S3 Compatible Storage (Minio, Less3, etc)\n```csharp\nusing Blobject.AmazonS3;\n\nAwsSettings settings = new AwsSettings(\n\tendpoint,      // http://localhost:8000/\n\ttrue,          // enable or disable SSL\n\taccessKey, \n\tsecretKey, \n\t\"us-west-1\",\n\tbucket,\n\tbaseUrl        // i.e. http://localhost:8000/{bucket}/{key}\n\t);\n\nAmazonS3BlobClient blobs = new AmazonS3BlobClient(settings); \n```\n\n## Getting Started - AWS S3 Lite (non-AWS library to reduce dependency drag)\n```csharp\nusing Blobject.AmazonS3Lite;\n\n// Initialize settings as above\nAmazonS3LiteBlobClient blobs = new AmazonS3LiteBlobClient(settings); \n```\n\n## Getting Started - Azure\n```csharp\nusing Blobject.AzureBlob;\n\nAzureBlobSettings settings = new AzureBlobSettings(\n\taccountName, \n\taccessKey, \n\t\"https://[accountName].blob.core.windows.net/\", \n\tcontainerName);\n\nAzureBlobClient blobs = new AzureBlobClient(settings); \n```\n\n## Getting Started - CIFS\n```csharp\nusing Blobject.CIFS;\n\nCifsSettings settings = new CifsSettings(\n\t\"localhost\",\n\tusername,\n\tpassword,\n\tsharename);\n\nCifsBlobClient blobs = new CifsBlobClient(settings);\n```\n\n## Getting Started - Disk\n```csharp\nusing Blobject.Disk;\n\nDiskSettings settings = new DiskSettings(\"blobs\"); \n\nDiskBlobClient blobs = new DiskBlobClient(settings);\n```\n\n## Getting Started - NFS\n```csharp\nusing Blobject.NFS;\n\nNfsSettings settings = new NfsSettings(\n\t\"localhost\",\n\t0, // user ID\n\t0, // group ID,\n\tsharename,\n\tNfsVersionEnum.V3 // V2, V3, or V4\n\t);\n\nNfsBlobClient = new NfsBlobClient(settings);\n```\n\n## Getting Started (Byte Arrays for Smaller Objects)\n```csharp\nawait blobs.WriteAsync(\"test\", \"text/plain\", \"This is some data\");  // throws IOException\nbyte[] data = await blobs.GetAsync(\"test\");                         // throws IOException\nbool exists = await blobs.ExistsAsync(\"test\");\nawait blobs.DeleteAsync(\"test\");\n```\n\n## Getting Started (Streams for Larger Objects)\n```csharp\n// Writing a file using a stream\nFileInfo fi = new FileInfo(inputFile);\nlong contentLength = fi.Length;\n\nusing (FileStream fs = new FileStream(inputFile, FileMode.Open))\n{\n    await _Blobs.WriteAsync(\"key\", \"content-type\", contentLength, fs);  // throws IOException\n}\n\n// Downloading to a stream\nBlobData blob = await _Blobs.GetStreamAsync(key);\n// read blob.ContentLength bytes from blob.Data\n```\n\n## Accessing Files within Folders\n```csharp\n//\n// Use a key of the form [path]/[to]/[file]/[filename].[ext]\n//\nawait blobs.WriteAsync(\"subdirectory/filename.ext\", \"text/plain\", \"Hello!\");\n```\n\n## Metadata and Enumeration\n\nEnumeration is always full; the library will manage any continuation tokens (e.g. AWS S3, S3 compatible, Azure) and also recurse into subdirectories for file, CIFS, and NFS.\n\n```csharp\n// Get BLOB metadata\nBlobMetadata md = await _Blobs.GetMetadataAsync(\"key\");\n\n// Enumerate BLOBs\nforeach (BlobMetadata blob in await _Blobs.EnumerateAsync())\n  Console.WriteLine(blob.Key + \" \" + blob.ContentLength + \" folder? \" + blob.IsFolder);\n```\n\n## Copying BLOBs from Repository to Repository\n\nIf you have multiple storage repositories and wish to move BLOBs from one repository to another, use the ```BlobCopy``` class (refer to the ```Test.Copy``` project for a full working example).\n\nThanks to @phpfui for contributing code and the idea for this enhancement!\n\n```csharp\n// instantiate two BLOB clients\nBlobCopy copy = new BlobCopy(from, to);\nCopyStatistics stats = copy.Start();\n/*\n\t{\n\t  \"Success\": true,\n\t  \"Time\": {\n\t    \"Start\": \"2021-12-22T18:44:42.9098249Z\",\n\t    \"End\": \"2021-12-22T18:44:42.9379215Z\",\n\t    \"TotalMs\": 28.1\n\t  },\n\t  \"ContinuationTokens\": 0,\n\t  \"BlobsEnumerated\": 12,\n\t  \"BytesEnumerated\": 1371041,\n\t  \"BlobsRead\": 12,\n\t  \"BytesRead\": 1371041,\n\t  \"BlobsWritten\": 12,\n\t  \"BytesWritten\": 1371041,\n\t  \"Keys\": [\n\t    \"filename.txt\",\n\t    ...\n\t  ]\n\t}\n */\n```\n\n## Version History\n\nRefer to CHANGELOG.md for version history.\n","funding_links":["https://github.com/sponsors/jchristn","https://paypal.me/joelchristner"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Fblobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristn%2Fblobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Fblobject/lists"}