{"id":37050455,"url":"https://github.com/celray/ccfx-cs","last_synced_at":"2026-01-14T05:50:55.616Z","repository":{"id":306094659,"uuid":"1025025523","full_name":"celray/ccfx-cs","owner":"celray","description":"A C# utility library containing functions to speed general development and prototyping.","archived":false,"fork":false,"pushed_at":"2025-07-23T18:04:55.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T01:38:01.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/celray.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-23T15:50:26.000Z","updated_at":"2025-07-23T18:04:59.000Z","dependencies_parsed_at":"2025-07-23T17:09:53.671Z","dependency_job_id":null,"html_url":"https://github.com/celray/ccfx-cs","commit_stats":null,"previous_names":["celray/ccfx-cs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/celray/ccfx-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celray%2Fccfx-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celray%2Fccfx-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celray%2Fccfx-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celray%2Fccfx-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celray","download_url":"https://codeload.github.com/celray/ccfx-cs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celray%2Fccfx-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T05:50:54.911Z","updated_at":"2026-01-14T05:50:55.607Z","avatar_url":"https://github.com/celray.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccfx - C# Utility Library\n\nA C# utility library containing functions to speed general development and prototyping. This is the C# port of the Python ccfx module.\n\n## Features\n\n- **File Operations**: List files, copy files, delete files, get extensions, read/write text files, file size utilities\n- **Directory Operations**: List folders, create paths, copy/move directories, recursive file operations\n- **System Utilities**: Get platform information, display progress bars, file counts, run shell commands\n- **String Utilities**: Format text blocks with line wrapping, byte formatting\n- **Compression**: Create and extract zip files\n- **Network Operations**: HTTP notifications, file downloads with progress tracking\n- **Monitoring**: Watch file count changes, file age utilities, cleanup operations\n- **Cross-Platform**: Works on Windows, Linux, and macOS\n\n## Installation\n\nInstall via NuGet Package Manager:\n\n```bash\ndotnet add package ccfx\n```\n\nOr via Package Manager Console in Visual Studio:\n\n```powershell\nInstall-Package ccfx\n```\n\n## Usage\n\n```csharp\nusing ccfx;\n\n// List all .txt files in a directory\nvar txtFiles = Fx.ListFiles(\"./documents\", \"txt\");\n\n// Create a directory if it doesn't exist\nFx.CreatePath(\"./output/results\");\n\n// Copy files and directories\nFx.CopyFile(\"source.txt\", \"destination.txt\", verbose: true);\nFx.CopyDirectory(\"./source\", \"./backup\", verbose: true);\n\n// Delete a file with verbose output\nbool deleted = Fx.DeleteFile(\"./temp.txt\", verbose: true);\n\n// Format a long string into a text block\nstring formatted = Fx.FormatStringBlock(\"This is a very long string that needs to be wrapped\", 50);\n\n// Show detailed progress bar\nfor (int i = 0; i \u003c= 100; i++)\n{\n    Fx.ShowProgress(i, 100, \"Processing files...\", 50);\n    Thread.Sleep(50);\n}\n\n// File size utilities\nlong size = Fx.GetFileSize(\"./large-file.zip\");\nConsole.WriteLine($\"File size: {Fx.FormatBytes(size)}\");\n\n// Network operations (async)\nbool notified = await Fx.AlertAsync(\"Process completed successfully!\");\nbool downloaded = await Fx.DownloadFileAsync(\"https://example.com/file.zip\", \"./downloads/file.zip\", verbose: true);\n\n// Run system commands\nvar (exitCode, output, error) = Fx.RunCommand(\"git\", \"status\");\nConsole.WriteLine($\"Git status: {output}\");\n\n// File monitoring and cleanup\nFx.WatchFileCount(\"./downloads\", \"zip\", intervalMs: 1000, durationMinutes: 5);\nint cleanedFiles = Fx.CleanupOldFiles(\"./temp\", days: 7, verbose: true);\n\n// Utility functions\nbool inRange = Fx.IsBetween(5.5, 1.0, 10.0); // true\n```\n\n// Get system platform\nstring platform = Fx.SystemPlatform();\n\n// Count files in directory\nint count = Fx.FileCount(\"./data\", \"*.json\");\n\n// Read and write files\nstring[] lines = Fx.ReadFile(\"input.txt\");\nFx.WriteFile(\"output.txt\", lines);\n\n// Extract zip file\nFx.Uncompress(\"archive.zip\", \"./extracted\");\n```\n\n## API Reference\n\n### File Operations\n\n- `ListFiles(string path, string? ext = null)` - List files in directory with optional extension filter\n- `GetExtension(string filePath)` - Get file extension without the dot\n- `DeleteFile(string filePath, bool verbose = false)` - Delete a file\n- `ReadFile(string filename, Encoding? encoding = null, bool verbose = false)` - Read text file\n- `WriteFile(string filename, string[] lines, Encoding? encoding = null, bool verbose = false)` - Write text file\n- `GetFileBaseName(string filePath, bool includeExtension = false)` - Get base filename\n\n### Directory Operations\n\n- `ListFolders(string path)` - List all folders in directory\n- `CreatePath(string pathName, bool verbose = false)` - Create directory if it doesn't exist\n- `DeletePath(string path, bool verbose = false)` - Delete directory\n- `MoveDirectory(string srcDir, string destDir, bool verbose = false)` - Move directory\n- `MoveDirectoryFiles(string srcDir, string destDir, bool verbose = false)` - Move all files between directories\n\n### System Utilities\n\n- `SystemPlatform()` - Get current operating system platform\n- `ProgressBar(int count, int total, string message = \"\")` - Display console progress bar\n- `FileCount(string path = \"./\", string extension = \".*\", bool verbose = true)` - Count files in directory\n\n### String Utilities\n\n- `FormatStringBlock(string inputStr, int maxChars = 70)` - Format text with line wrapping\n\n### Compression\n\n- `Uncompress(string inputFile, string outputDir, bool verbose = false)` - Extract zip files\n\n## Building from Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/celray/ccfx-cs.git\ncd ccfx-cs\n\n# Build the project\ndotnet build\n\n# Create NuGet package\ndotnet pack\n```\n\n## Requirements\n\n- .NET 8.0 or later\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Author\n\n**Celray James CHAWANDA**  \nEmail: celray@chawanda.com  \nRepository: https://github.com/celray/ccfx-cs\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.\n\n## Notes\n\nThis C# library is a port of the Python ccfx module. Some Python-specific functions that don't translate well to C# (such as YouTube downloading, MP3 metadata handling, etc.) have been omitted from this version. The focus is on core utility functions that are commonly needed in C# development.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelray%2Fccfx-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelray%2Fccfx-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelray%2Fccfx-cs/lists"}