{"id":16679695,"url":"https://github.com/buren/centra","last_synced_at":"2025-05-14T10:34:20.617Z","repository":{"id":62555447,"uuid":"131494840","full_name":"buren/centra","owner":"buren","description":"Dealing with Centra stuff, i.e reading export files and generating summaries.","archived":false,"fork":false,"pushed_at":"2021-11-29T12:12:10.000Z","size":161,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T11:44:07.550Z","etag":null,"topics":["centra","cli","ruby","rubygem"],"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/buren.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}},"created_at":"2018-04-29T13:00:11.000Z","updated_at":"2019-09-16T17:57:16.000Z","dependencies_parsed_at":"2022-11-03T05:30:58.496Z","dependency_job_id":null,"html_url":"https://github.com/buren/centra","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fcentra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fcentra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fcentra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buren%2Fcentra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buren","download_url":"https://codeload.github.com/buren/centra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254121331,"owners_count":22018144,"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":["centra","cli","ruby","rubygem"],"created_at":"2024-10-12T13:36:54.984Z","updated_at":"2025-05-14T10:34:15.604Z","avatar_url":"https://github.com/buren.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Centra\n\nDealing with Centra stuff, features include\n\n- [Reading export files and generating summaries](#cli-usage)\n- [Matching Centra orders with Rule orders](#rule-order-matcher)\n- [Import data to a PostgreSQL database](#database-import)\n- [Anonymize data](#cli-usage)\n- [CLI](#cli-usage)\n\n## CLI Usage\n\nAvailable CLIs:\n\n- `centra_orders` - Various simple tasks\n- `centra_order_import` - Import orders from CSV to database\n- `centra_product_import` - Import products from CSV to database\n- `centra_rule_matcher` - Match Centra and Rule orders\n\nUse `\u003ccommand\u003e --help` to see all options.\n\n__Centra stats__\n\n```\n$ centra_orders --help\n```\n\nExample\n\n```\n$ centra_orders --centra-export=centra-order-export.csv      \\\n                --anonymize                                  \\\n                --order-frequency-output=order-frequency.csv \\\n                --anonymized-output=anonymized_orders.csv    \\\n                --countries=SE,NO                            \\\n                --start-date=2017-01-01                      \\\n                --end-date=2018-01-01\n```\n\nExample output\n\n```\n$ centra_orders --centra-export=sample-centra-order-export.csv --countries=SE\n\nReading Centra order export file..done!\nParsing and anonymizing  CSV-file (this may take a while)..done!\nRunning calculations..done!\n\n=== STATS ===\nFirst order date         2013-03-25 09:57:28 +0100\nLast order date          2015-06-03 19:23:31 +0200\n\nTotal revenue (SEK)      853359.8\nTotal orders             999\nTotal orders (in stats)  735\nTotal pcs                943\nTotal unique emails      647\nTotal currencies         1\nTotal payment types      12\nTotal countries          1\n\nAvg. orders/email        1.544049459041731\nAvg. value/email         1318.948686244204\nAvg. pcs/order           0.943943943943944\nAvg. order value         854.2140140140141\n\nPurchase frequency       1.544049459041731\nCustomer value           1318.948686244204\n```\n\n## Rule order matcher\n\n```\n$ centra_rule_matcher --help\n```\n\nExample\n\n```\n$ centra_rule_matcher --rule=rule_orders.csv       \\\n                      --centra=centra_orders.csv   \\\n                      --max-allowed-diff=90        \\\n                      --output-missing=missing.csv \\\n                      --output-matched=matched.csv \\\n                      --countries=SE,NO            \\\n                      --start-date=2017-01-01      \\\n                      --end-date=2018-01-01\n```\n\n## Database import\n\n__Orders__\n\n```\n$ centra_order_import --help\n```\n\nExample\n\n```\n$ centra_order_import --centra-export=sample-orders.csv \\\n                      --dbname=dbname \\\n                      --user=dbuser \\\n                      --password=dbpassword \\\n                      --host=127.0.0.1 \\\n                      --anonymize \\\n                      --logger=STDOUT\n```\n\n__Products__\n\n```\n$ centra_product_import --help\n```\n\nExample\n\n```\n$ centra_product_import --centra-export=sample-products.csv \\\n                      --dbname=dbname \\\n                      --user=dbuser \\\n                      --password=dbpassword \\\n                      --host=127.0.0.1 \\\n                      --anonymize \\\n                      --logger=STDOUT\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"centra\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install centra\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n:information_source: If you want to test the scripts in `exe` when developing, set the environment variable `CENTRA_GEM_DEV=1`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/buren/centra.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburen%2Fcentra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburen%2Fcentra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburen%2Fcentra/lists"}