{"id":27223930,"url":"https://github.com/red-data-tools/red-remote-input","last_synced_at":"2025-06-12T21:07:13.827Z","repository":{"id":233722175,"uuid":"779068235","full_name":"red-data-tools/red-remote-input","owner":"red-data-tools","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-06T07:31:11.000Z","size":23,"stargazers_count":0,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T12:51:05.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/red-data-tools.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-29T01:07:56.000Z","updated_at":"2025-03-06T07:31:23.000Z","dependencies_parsed_at":"2024-04-17T07:55:59.405Z","dependency_job_id":"accd6bd3-6973-46f3-93c5-036808d83100","html_url":"https://github.com/red-data-tools/red-remote-input","commit_stats":null,"previous_names":["red-data-tools/red-datastock","red-data-tools/red-remote-input"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/red-data-tools/red-remote-input","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2Fred-remote-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2Fred-remote-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2Fred-remote-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2Fred-remote-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red-data-tools","download_url":"https://codeload.github.com/red-data-tools/red-remote-input/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red-data-tools%2Fred-remote-input/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259530147,"owners_count":22872114,"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":[],"created_at":"2025-04-10T09:59:23.278Z","updated_at":"2025-06-12T21:07:13.815Z","avatar_url":"https://github.com/red-data-tools.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Red DataStock\n\n:alembic: This project is currently under preparation :canned_food: The project name will be changed.\n\n## Description\n\nRed DataStock is a Ruby library designed to manage data download, cache, and extraction from specific URLs.\nUseful when you need to consistently retrieve, cache, and process data files from the Internet.\n\n## Installation\n\nTo install Red DataStock:\n\n```\ngem install red-datastock\n```\n\n## Usage\n\nTo use Red DataStock in your code, you need to require it first:\n\n```rb\nrequire 'datastock'\n```\n\nNow you can use the `Downloader`, `CachePath`, and `ZipExtractor` classes for managing your data.\n\nHere's an example of how to download, cache, and extract a zip file using Red DataStock:\n\n```rb\nrequire 'datastock'\n\n# Prepare the Downloader with your desired URL\ndownloader = DataStock::Downloader.new(\"http://example.com/data.zip\")\n\n# Define where you want to cache the downloaded data\ncache_path = DataStock::CachePath.new(\"my_data_id\")\n\n# Define your output path\noutput_path = cache_path.base_dir + \"data.zip\"\n\n# Download and cache the data if it's not already cached\ndownloader.download(cache_path) unless File.exist?(output_path)\n\n# Prepare the ZipExtractor with your cached data\nzip_extractor = DataStock::ZipExtractor.new(output_path)\n\n# Extract files from the zip\nzip_extractor.extract_files do |input|\n  # Your code to process each input file\nend\n\n# Clean up the cache directory\ncache_path.clean\n```\n\nIn this example, we download a zip file from `http://example.com/data.zip`, store it in a cache directory, and then extract all files from the zip. You can replace the URL with your actual data source.\n\n## Contributing\n\nPlease create a fork, make your proposed changes, and submit a pull request.\n\n## License\n\nThe MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-data-tools%2Fred-remote-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred-data-tools%2Fred-remote-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred-data-tools%2Fred-remote-input/lists"}