shopmaster export from aliexpress to csv for spree_datashift import

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

shopmaster export from aliexpress to csv for spree_datashift import

fugee ohu
I'm trying to use shopmaster to export from aliexpress to csv for spree_datashift import Spree uses a separate table for prices I notice How am I supposed to do this? Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0ed8f63c-f0a1-48e3-ba83-50c5f6f4959e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

Hassan Schroeder-2
On Mon, Jun 11, 2018 at 1:56 AM, fugee ohu <[hidden email]> wrote:
> I'm trying to use shopmaster to export from aliexpress to csv for
> spree_datashift import Spree uses a separate table for prices I notice How
> am I supposed to do this?

Your choices:

1. Write your own exporter
2. Write your own importer
3. Transform the original exported CSV into the required import format

Assuming the exporter and importer are both complex and mature
(well-tested), #3 is generally the preferred approach.

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yB72wKrsqVhu2ObV9W5go59dFoiapNYhFS02Sg1udwZgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

fugee ohu


On Monday, June 11, 2018 at 8:19:12 AM UTC-4, Hassan Schroeder wrote:
On Mon, Jun 11, 2018 at 1:56 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="qXzV5POWBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
> I'm trying to use shopmaster to export from aliexpress to csv for
> spree_datashift import Spree uses a separate table for prices I notice How
> am I supposed to do this?

Your choices:

1. Write your own exporter
2. Write your own importer
3. Transform the original exported CSV into the required import format

Assuming the exporter and importer are both complex and mature
(well-tested), #3 is generally the preferred approach.

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qXzV5POWBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

I'm looking for a more spree specific answer 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c421ebc3-cc34-4f60-921c-4364c88f41d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

fugee ohu
In reply to this post by Hassan Schroeder-2


On Monday, June 11, 2018 at 8:19:12 AM UTC-4, Hassan Schroeder wrote:
On Mon, Jun 11, 2018 at 1:56 AM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="qXzV5POWBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
> I'm trying to use shopmaster to export from aliexpress to csv for
> spree_datashift import Spree uses a separate table for prices I notice How
> am I supposed to do this?

Your choices:

1. Write your own exporter
2. Write your own importer
3. Transform the original exported CSV into the required import format

Assuming the exporter and importer are both complex and mature
(well-tested), #3 is generally the preferred approach.  

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="qXzV5POWBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Write my own importer using thor or without?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/83271357-bd70-4717-b7b1-d20299ee4133%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

Hassan Schroeder-2
On Mon, Jun 11, 2018 at 1:11 PM, fugee ohu <[hidden email]> wrote:

> Write my own importer using thor or without?

I've never used thor; what are the pros and cons of using it vs. e.g.
rake or `rails runner`?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAVE2EMYbx-3bGMTKYyZd1Y_gPdAcLCN04P7qynDiqRwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

qwan
In reply to this post by fugee ohu
Datashift has template generation for any active record model to csv or excel, for example to create a csv template for a Spree product :

thor  datashift:generate:csv -m Spree::Product --result /tmp/spree_products.csv



You can also export the headers with data via datashift:export:csv


$ more /tmp/spree_products.csv

id,name,description,available_on,deleted_at,slug,meta_description,meta_keywords,tax_category_id,shipping_category_id,created_at,updated_at,promotionable,meta_title,discontinue_on


This gives the required columns into Spree. You can copy the data from your export into the correct Spree fields, the final file can then be imported  via

thor datashift:import:csv -i /tmp/spree_products.csv -m Spree::Product



N.B Spree data model and requirements are complex, simple import may not be enough, you may need to write a few helpers or extend  datashift:import, the README and Wiki are quite extensive

cheers
tom 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5a9cfa09-8fb1-4246-85f3-d6f4f81c9ae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

qwan
p.s The excel template generation is a bit more advanced e.g  does not include Rails cols like id, created_at by default

$ th datashift:generate:excel 

Usage:
  thor datashift:generate:excel -m, --model=MODEL -r, --result=RESULT

Options:
  -m, --model=MODEL                                        # The active record model to export
  -r, --result=RESULT                                      # Create template of model in supplied file
      [--include-rails=INCLUDE_RAILS]                      # Include Rails auto generated columns like :id, created_at, updated_at
  -f, [--force=one two three]                              # Inform datashift of columns that are still call-able even though they're non model methods
  -a, [--associations], [--no-associations]                # Include associations. Can be further refined by :with & :exclude
      [--expand-associations], [--no-expand-associations]  # Expand association data to multiple columns i.e 1 column per attribute

generate a template from an active record model (with optional associations)
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/03c005a5-4d7f-4458-92d6-f00459269635%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

qwan
In reply to this post by Hassan Schroeder-2
thor is a good drop in replacement for rake for CLIs - for me  I much prefer it's argument/option definition and parsing, and it's a bit easier to organise and invoke scripts as they are PORO

for me, rake is good for build orientated tasks, thor for everything else


On Monday, 11 June 2018 22:46:04 UTC+2, Hassan Schroeder wrote:
On Mon, Jun 11, 2018 at 1:11 PM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NvdO15yyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:

> Write my own importer using thor or without?

I've never used thor; what are the pros and cons of using it vs. e.g.
rake or `rails runner`?

--
Hassan Schroeder ------------------------ <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NvdO15yyBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">hassan.s...@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/22309959-116d-43a0-b4c4-6f5abdcff9f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

fugee ohu


On Tuesday, June 12, 2018 at 5:00:58 AM UTC-4, qwan wrote:
thor is a good drop in replacement for rake for CLIs - for me  I much prefer it's argument/option definition and parsing, and it's a bit easier to organise and invoke scripts as they are PORO

for me, rake is good for build orientated tasks, thor for everything else


On Monday, 11 June 2018 22:46:04 UTC+2, Hassan Schroeder wrote:
On Mon, Jun 11, 2018 at 1:11 PM, fugee ohu <[hidden email]> wrote:

> Write my own importer using thor or without?

I've never used thor; what are the pros and cons of using it vs. e.g.
rake or `rails runner`?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

This is the spree products tables structures Everything's spread out across different tables

  create_table "spree_prices", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.integer  "variant_id",                          null: false
    t.decimal  "amount",     precision: 10, scale: 2
    t.string   "currency"
    t.datetime "deleted_at"
    t.index ["deleted_at"], name: "index_spree_prices_on_deleted_at", using: :btree
    t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency", using: :btree
    t.index ["variant_id"], name: "index_spree_prices_on_variant_id", using: :btree
  end

  create_table "spree_product_option_types", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.integer  "position"
    t.integer  "product_id"
    t.integer  "option_type_id"
    t.datetime "created_at",     null: false
    t.datetime "updated_at",     null: false
    t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id", using: :btree
    t.index ["position"], name: "index_spree_product_option_types_on_position", using: :btree
    t.index ["product_id"], name: "index_spree_product_option_types_on_product_id", using: :btree
  end

  create_table "spree_product_promotion_rules", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.integer "product_id"
    t.integer "promotion_rule_id"
    t.index ["product_id"], name: "index_products_promotion_rules_on_product_id", using: :btree
    t.index ["promotion_rule_id", "product_id"], name: "index_products_promotion_rules_on_promotion_rule_and_product", using: :btree
  end

  create_table "spree_product_properties", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.string   "value"
    t.integer  "product_id"
    t.integer  "property_id"
    t.datetime "created_at",              null: false
    t.datetime "updated_at",              null: false
    t.integer  "position",    default: 0
    t.index ["position"], name: "index_spree_product_properties_on_position", using: :btree
    t.index ["product_id"], name: "index_product_properties_on_product_id", using: :btree
    t.index ["property_id"], name: "index_spree_product_properties_on_property_id", using: :btree
  end

  create_table "spree_products", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.string   "name",                               default: "",   null: false
    t.text     "description",          limit: 65535
    t.datetime "available_on"
    t.datetime "discontinue_on"
    t.datetime "deleted_at"
    t.string   "slug"
    t.text     "meta_description",     limit: 65535
    t.string   "meta_keywords"
    t.integer  "tax_category_id"
    t.integer  "shipping_category_id"
    t.datetime "created_at",                                        null: false
    t.datetime "updated_at",                                        null: false
    t.boolean  "promotionable",                      default: true
    t.string   "meta_title"
    t.index ["available_on"], name: "index_spree_products_on_available_on", using: :btree
    t.index ["deleted_at"], name: "index_spree_products_on_deleted_at", using: :btree
    t.index ["discontinue_on"], name: "index_spree_products_on_discontinue_on", using: :btree
    t.index ["name"], name: "index_spree_products_on_name", using: :btree
    t.index ["shipping_category_id"], name: "index_spree_products_on_shipping_category_id", using: :btree
    t.index ["slug"], name: "index_spree_products_on_slug", unique: true, using: :btree
    t.index ["tax_category_id"], name: "index_spree_products_on_tax_category_id", using: :btree
  end

  create_table "spree_products_taxons", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
    t.integer "product_id"
    t.integer "taxon_id"
    t.integer "position"
    t.index ["position"], name: "index_spree_products_taxons_on_position", using: :btree
    t.index ["product_id"], name: "index_spree_products_taxons_on_product_id", using: :btree
    t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id", using: :btree
  end

 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6da3a518-b86a-4be6-9397-d05844a133a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: shopmaster export from aliexpress to csv for spree_datashift import

fugee ohu
In reply to this post by qwan


On Tuesday, June 12, 2018 at 4:47:04 AM UTC-4, qwan wrote:
Datashift has template generation for any active record model to csv or excel, for example to create a csv template for a Spree product :

thor  datashift:generate:csv -m Spree::Product --result /tmp/spree_products.csv



You can also export the headers with data via datashift:export:csv


$ more /tmp/spree_products.csv

id,name,description,available_on,deleted_at,slug,meta_description,meta_keywords,tax_category_id,shipping_category_id,created_at,updated_at,promotionable,meta_title,discontinue_on


This gives the required columns into Spree. You can copy the data from your export into the correct Spree fields, the final file can then be imported  via

thor datashift:import:csv -i /tmp/spree_products.csv -m Spree::Product



N.B Spree data model and requirements are complex, simple import may not be enough, you may need to write a few helpers or extend  datashift:import, the README and Wiki are quite extensive

cheers
tom 

"You can copy the data from your export into the correct Spree fields"
How would I do that?
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6b592661-59d0-4be9-9e63-fba1800f6180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.