{"id":17832417,"url":"https://github.com/decentralizuj/crates","last_synced_at":"2025-07-15T12:34:48.848Z","repository":{"id":56843889,"uuid":"352033327","full_name":"decentralizuj/crates","owner":"decentralizuj","description":"Scrap cryptocurrency prices to CSV table","archived":false,"fork":false,"pushed_at":"2024-02-23T15:09:58.000Z","size":2741,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T15:17:51.350Z","etag":null,"topics":["cryptocurrency","csv","ruby"],"latest_commit_sha":null,"homepage":"","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/decentralizuj.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}},"created_at":"2021-03-27T09:35:32.000Z","updated_at":"2021-04-11T16:26:12.000Z","dependencies_parsed_at":"2024-10-27T20:31:01.439Z","dependency_job_id":"bcc253ae-f099-42d9-a332-b4f0bfe0553d","html_url":"https://github.com/decentralizuj/crates","commit_stats":{"total_commits":22,"total_committers":4,"mean_commits":5.5,"dds":"0.36363636363636365","last_synced_commit":"a8add0229d2909909c8483370ceaed7c2fb93b03"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/decentralizuj/crates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decentralizuj%2Fcrates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decentralizuj%2Fcrates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decentralizuj%2Fcrates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decentralizuj%2Fcrates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decentralizuj","download_url":"https://codeload.github.com/decentralizuj/crates/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decentralizuj%2Fcrates/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265436780,"owners_count":23765031,"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":["cryptocurrency","csv","ruby"],"created_at":"2024-10-27T19:56:49.572Z","updated_at":"2025-07-15T12:34:48.825Z","avatar_url":"https://github.com/decentralizuj.png","language":"Ruby","readme":"# Introduction\nFast and easy way to get all data about all coins in any fiat value.\nGet data for analyze or use it to make a brand new crypto app.\nAfter scrapping prices in CSV file, and printing colorized output,\nyou can access each rate with `#price(coin)`. No configuration, just run.\n\n - Collect prices of defined coins from _cryptocompare.com_\n - Save data into object\n - Save to CSV and print colorized output\n - Print-only without saving\n - Save-only without printing  \n\n# How to install\n\nMake sure you have ruby and git installed:\n\n```bash\n # download repo and install dependencies like colorize and rest-client\n git clone https://github.com/decentralizuj/crates.git\n cd crates\n bundle install\n```  \n\nOr install local:\n\n```ruby\n gem install crates\n\n # install from rubygems\n\n gem 'crates', '~\u003e 0.1.0'\n```  \n\n# How to run\n\nIf you want to edit default coins:\n\n```ruby\n # open 'bin/crates' and edit line(5):\n \u003e (5): COINS = %w[ ... ].freeze\n```  \n\nRun from terminal:\n\n```ruby\n # add fiat currencies as arguments\n # also accept `--no-save` and `--no-print` as args\n\n $ ruby bin/crates usd eur rsd\n $ ruby bin/crates usd eur rsd --no-save\n $ ruby bin/crates usd eur rsd --no-print\n```    \n\n# How to use\n\nInitialize new object with your own configuration. If you want to use defaults:\n\n```ruby\n # you can edit this in 'bin/crates'\n\n - #coins: [BTC, LTC, XMR, ETH, BCH, ZEC]\n - #save:  true  \n - #print: true \n```  \n\nOtherwise, #new accept 'currency' as argument, and an 'options hash':  \n\n```ruby\n - first parameter is currency, defauilt is 'EUR'\n - other accepted options are:  \n     print: boolean\n     save:  boolean\n     coins: array\n```  \n\nExample:\n\n```ruby\n # configure default values\n\n COINS = %w[ BTC XMR LTC ETH ZEC ].freeze\n PRINT = true\n SAVE  = true\n\n # create new object\n\n @rates = C::Rates.new( :eur, coins: COINS, print: PRINT, save: SAVE )\n\n # make single request\n\n @rates.get\n \n # C::Rates#get accept same args as #new, but do not change default values\n\n CURRENCIES = %w[ USD EUR RSD ].freeze\n\n CURRENCIES.each do |currency|\n   @rates.get currency\n  end\n```  \n\nThis will print/save data as configured, while making prices easily\naccessible with Rates#price(:symbol).\n\n```ruby\n # Getter method with all coins and values \n\n @rates.prices\n # =\u003e { \"BTC\"=\u003e48867.67, \"XMR\"=\u003e200.31, \"LTC\"=\u003e164.37 }\n # =\u003e Accessible with @rates['BTC']\n\n\n # Get price for each coin\n # C::Rates#price(:coin)\n\n @rates.price(:btc)      # accept symbol\n # =\u003e 48867.67\n\n @rates.price('xmr')     # or string\n # =\u003e 200.31\n```  \n\nC::Rates has two setter methods:\n\n```ruby\n @rates.currency = 'EUR'\n\n @rates.coins = %w[BTC XMR LTC]\n```  \n\nOther available objects are:\n\n```ruby\n # After new object is initialized, you can use:\n\n @rates.currency\n # =\u003e \"EUR\"\n\n @rates.coins\n # =\u003e \"BTC, XMR, LTC\"\n\n @rates.save?\n # =\u003e save output -\u003e (true/false)\n\n @rates.print?\n # =\u003e print output -\u003e (true/false)\n\n @rates.count\n # =\u003e 0 -\u003e (number of fail requests)\n\n # After you call Rates#get:\n\n @rates.url\n # =\u003e constructed URL\n\n @rates.reponse\n # =\u003e response from RestClient.get (accept #code, #headers, #body)\n\n @rates.data\n # =\u003e JSON parsed object will all data about all coins\n\n @rates.table\n # =\u003e path to saved CSV file\n # =\u003e file is named CURRENCY_rates.csv (eur_rates.csv)\n```  \n\n# TO-DO\n\nThis gem is start of app that I am working on to help me with auto-trades.\nAt the moment I use it to notify me when price change more then 2% from last trade.\nThen I perform crypto-to-crypto trade, and wait for price to change again.\nTo make it reliable and worth of using, plan is to add next functions:\n\n - add more sources to get data from them\n - scrap more data into tables (only data I need)\n - add support for API-KEYS\n - rotate sources if requests are sent too often\n - add support for proxy and headers rotation\n - create charts from prices at given time (each 10min etc)\n - create GIF animation from charts per time (each 30 min etc)\n\n# PREVIEW\n\n![GIF](docs/crates.gif)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecentralizuj%2Fcrates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecentralizuj%2Fcrates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecentralizuj%2Fcrates/lists"}