<commit_before>= ImportCsv

This project rocks and uses MIT-LICENSE.

* Provides mechanism to import csv.

* Records imports to database to display them to user.

* Supports async importing.

== Usage

=== To import objects via CSV:

* Setup import csv initializer as per:
  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/models/csv_imports/company.rb

* Define a strategy to build the imported object from csv attributes as per:

  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/strategies/build_for_csv_import/company.rb

* Launch the import as per:

  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/controllers/csv_imports/companies_controller.rb

  or launch manually as per:

  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/interactors/import_via_csv/companies.rb

=== Check out the application on local to see how it looks

    git clone <EMAIL>:astrauka/import_csv.git
    cd import_csv/spec/dummy
    spring rails s

Launch http://localhost:3000

=== To reuse base controllers and views

    git clone <EMAIL>:astrauka/import_csv.git
    cd import_csv

    cp spec/dummy/app/assets/javascripts/common/csv_imports_table.js.coffee <my_app>/app/assets/javascripts/
    cp spec/dummy/app/helpers/csv_imports_helper.rb <my_app>/app/helpers/
    cp -r spec/dummy/app/controllers/csv_imports <my_app>/app/controllers/
    cp -r spec/dummy/app/views/csv_imports <my_app>/app/views/
    cp -r spec/dummy/app/decorators <my_app>/app/

Ensure that you have localization helper defined:

https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/helpers/application_helper.rb#L30

== TODO

* Currently supports only ActiveRecord

* Currently supports carrierwave uploaders

* Currently depends on Sidekiq for async execution

== Development

* Clone the repository

* Migrate database

`
bundle exec rake -f spec/dummy/Rakefile db:create db:migrate
RAILS_ENV=test bundle exec rake -f spec/dummy/Rakefile db:migrate
`

* Run specs

    rspec

* Launch dummy application

    cd spec/dummy
    spring rails s

Visit http://localhost:3000<commit_msg>nicer readme formatting<commit_after>= ImportCsv

This project rocks and uses MIT-LICENSE.

* Provides mechanism to import csv.
* Records imports to database to display them to user.
* Supports async importing.

== Usage

=== To import objects via CSV:

* Setup import csv initializer as per:
  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/models/csv_imports/company.rb

* Define a strategy to build the imported object from csv attributes as per:
  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/strategies/build_for_csv_import/company.rb

* Launch the import as per:
  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/controllers/csv_imports/companies_controller.rb

  or launch manually as per:
  https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/interactors/import_via_csv/companies.rb

=== Check out the application on local to see how it looks

    git clone <EMAIL>:astrauka/import_csv.git
    cd import_csv/spec/dummy
    bundle
    spring rails s

Launch at http://localhost:3000

=== To reuse base controllers and views

    git clone <EMAIL>:astrauka/import_csv.git
    cd import_csv

    cp spec/dummy/app/assets/javascripts/common/csv_imports_table.js.coffee <my_app>/app/assets/javascripts/
    cp spec/dummy/app/helpers/csv_imports_helper.rb <my_app>/app/helpers/
    cp -r spec/dummy/app/controllers/csv_imports <my_app>/app/controllers/
    cp -r spec/dummy/app/views/csv_imports <my_app>/app/views/
    cp -r spec/dummy/app/decorators <my_app>/app/

Ensure that you have localization helper defined:
https://github.com/astrauka/import_csv/blob/master/spec/dummy/app/helpers/application_helper.rb#L30

== TODO

* Currently supports only ActiveRecord
* Currently supports carrierwave uploaders
* Currently depends on Sidekiq for async execution

== Development

* Clone the repository
* Migrate database

    bundle exec rake -f spec/dummy/Rakefile db:create db:migrate
    RAILS_ENV=test bundle exec rake -f spec/dummy/Rakefile db:migrate

* Run specs

    rspec

* Launch dummy application

    cd spec/dummy
    spring rails s

Visit http://localhost:3000
{'fraction_non_alphanumeric': 0.09450292397660819, 'fraction_numerical': 0.004678362573099415, 'mean_word_length': 4.054373522458629, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4837780', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1363, 'n_words': 345}