← back to Kravet Sheet Sync 2026 04 20

__pycache__/bulk_push_v1.cpython-314.pyc

227 lines

+
x
YjpL���Rt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RI	H
t
Ht]PPRR4tRtR]R2tRR	.tR
tR]!R4P+R
4P-4,t0R'mtRtRtR(RltRtRtRtR)RltRt Rt!Rt"Rt#Rt$Rt%Rt&Rt'Rt(Rt)Rt*R t+R!t,R"t-R#t.R$t/R%t0]1R&8Xd
]0!4R#R#)*u�
Bulk-push DWKK NEW-bucket wallcoverings to Shopify as active products.

Pipeline per SKU:
  1) dw_sku_registry INSERT
  2) productCreate (status=DRAFT, vendor, productType, tags, basic description)
  3) productVariantsBulkUpdate main variant: DWKK SKU, MAP price, cost
  4) productVariantsBulkCreate sample variant: DWKK-Sample at $4.25
  5) productCreateMedia with real Brandfolder URL
  6) shopify_products INSERT (enables Full Monty)
  7) Full Monty API call (ai tags, silas, spin)
  8) kravet_finalize (title, SEO, body, sanitized tags)
  9) collectionAddProducts → New Arrivals
 10) productUpdate status=ACTIVE (if width + image present)
 11) kravet_catalog UPSERT

Run:
  python3 bulk_push_v1.py --limit 10
N)�ThreadPoolExecutor�as_completed�SHOPIFY_ADMIN_TOKEN�z)designer-laboratory-sandbox.myshopify.comzhttps://z/admin/api/2024-10/graphql.json�sshzroot@45.61.58.125z%gid://shopify/Collection/167327760435zBasic �base64sadmin:DWSecure2024!c���^RIp^RIp\P!\RVR2.,RRRR7pVPVP
VP44Uu.uFqD'gKVNK	up#uupi)�NzLPGPASSWORD=DW2024! psql -h 127.0.0.1 -U dw_admin -d dw_unified --csv -t -c "�"T��capture_output�text�check)�csv�io�
subprocess�run�SSH�reader�StringIO�stdout)�sqlrr�r�rows&    �,kravet-sheet-sync-2026-04-20/bulk_push_v1.py�pgr!sm������s�
V�WZ�V[�[\�]�_�_��$�d�	4�A��:�:�b�k�k�!�(�(�&;�<�D�<�C��C�C�<�D�D��Ds�	A6�-A6c�Z�\P!\RVR2.,RRRR7R#)zCPGPASSWORD=DW2024! psql -h 127.0.0.1 -U dw_admin -d dw_unified -c "r
TrN)rrr)rs&r�pg_execr)s0���N�N�3�
M�c�U�RS�T�V�V��$�d�4�c	��\P!RTRT;'g//4P4p\PP\VRRRR\/R7p\P!\PPV^R7P44pRV9d\VR,4hVR	,#)
�query�	variables�POST�Content-Type�application/jsonzX-Shopify-Access-Token��data�method�headers��timeout�errorsr&)�json�dumps�encode�urllib�request�Request�GQL�TOKEN�loads�urlopen�read�RuntimeError)�q�v�body�req�ds&&   r�gqlr=/s����:�:�w��;����R�8�9�@�@�B�D��>�>�!�!�#�D��#�$6�7O�PU�V�"�X�C��
�
�6�>�>�)�)�#�r�)�:�?�?�A�B�A��1�}�L��8��5�5��V�9�rc���V'gR#\P!RVP4P44p.Rr2VF|pVP4'gVP	V4K,V'gV\
9dVP	V4KRVP	\P!RRV44RpK~	RPV4P4#)rz(\s+)Tz(^|[\s&/-])([a-z])c�l�VP^4VP^4P4,#)�)�group�upper)�ms&r�<lambda>�title_case.<locals>.<lambda>@s#��q�w�w�q�z�!�'�'�RS�*�JZ�JZ�J\�?\rF)�re�split�strip�lower�append�SMALL�sub�join)�s�words�out�first�ws&    r�
title_caserS8s����R��H�H�X�q�w�w�y���0�1�E��T��
���w�w�y�y�#�*�*�Q�-����e��S�Z�Z��]��J�J�r�v�v�3�5\�^_�`�a��E���7�7�3�<����rc��V'gV#\P!RRV\PR7p\P!RRV\PR7pV#)z\bWallpapers\b�
Wallcoverings)�flagsz
\bWallpaper\b�Wallcovering)rFrL�I�rNs&r�
clean_wallrZEs@���Q�h�
��� �/�1�B�D�D�A�A�
����>�A�R�T�T�B�A��Hrc
��\P!RR\P!RRVP4P444#)z\.0$r�-�.)rFrLrHrBrYs&r�norm_skur^Ls/��
�6�6�'�"�b�f�f�T�#�q�w�w�y���/@�A�B�Brc	�,�RpV'dRpRVRVR2p.RNRNRNRNR	NR
NRNRNR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*Np\V4Uu.uFp\\WE44NK	up#uupi)+rz�AND NOT EXISTS (
          SELECT 1 FROM dw_sku_registry r WHERE r.dw_sku = n.new_dw_sku
        ) AND NOT EXISTS (
          SELECT 1 FROM kravet_catalog c WHERE c.dw_sku = n.new_dw_sku
        )a�
    WITH ranked AS (
      SELECT n.new_dw_sku, n.mfr_sku, n.pattern_name, n.color_name, n.brand,
             n.collection, n.country_of_origin, n.width, n.unit_of_measure,
             n.content, n.type1, n.type2, n.style1, n.style2,
             n.display_status, n.inventory_available,
             n.wholesale::text AS wholesale, n.map::text AS map,
             n.tariff_pct::text AS tariff_pct, n.cost::text AS cost,
             p.url AS image_url,
             pr.url AS full_repeat_url,
             s.vert_repeat, s.horz_repeat, s.prop_65, s.ca_tb117, s.direction,
             s.clean_code, s.durability, s.lead_time_days, s.ship_from,
             s.ab_1817, s.memo_sample_available, s.weight, s.barcode,
             s.minimum_order_qty, s.order_increment_qty, s.notes,
             row_number() OVER (PARTITION BY n.brand ORDER BY n.map DESC) AS rn_brand
        FROM kravet_diff_new_2026_04_20 n
        JOIN v_kravet_sku_primary_image p
          ON p.mfr_sku_norm = regexp_replace(regexp_replace(upper(btrim(n.mfr_sku)),'-','.','g'),'\.0\$','')
         AND p.kind='colorway'
   LEFT JOIN v_kravet_sku_primary_image pr
          ON pr.mfr_sku_norm = p.mfr_sku_norm AND pr.kind='full_repeat'
   LEFT JOIN kravet_sheet_fields s
          ON s.mfr_sku_norm = p.mfr_sku_norm
       WHERE n.has_image AND n.has_width
         AND n.pattern_name <> '' AND n.color_name <> ''
         AND n.map IS NOT NULL
         AND upper(n.stock_status) IN ('IN STOCK','LIMITED STOCK')
         aM
    )
    SELECT new_dw_sku, mfr_sku, pattern_name, color_name, brand,
           collection, country_of_origin, width, unit_of_measure, content,
           type1, type2, style1, style2, display_status, inventory_available,
           wholesale, map, tariff_pct, cost, image_url, full_repeat_url,
           vert_repeat, horz_repeat, prop_65, ca_tb117, direction, clean_code,
           durability, lead_time_days, ship_from, ab_1817, memo_sample_available,
           weight, barcode, minimum_order_qty, order_increment_qty, notes
    FROM ranked WHERE rn_brand = 1 ORDER BY brand LIMIT z
    �dw_sku�mfr_sku�pattern_name�
color_name�brand�
collection�country_of_origin�width�unit_of_measure�content�type1�type2�style1�style2�display_status�inventory_available�	wholesale�map�
tariff_pct�cost�	image_url�full_repeat_url�vert_repeat�horz_repeat�prop_65�ca_tb117�	direction�
clean_code�
durability�lead_time_days�	ship_from�ab_1817�memo_sample_available�weight�barcode�minimum_order_qty�order_increment_qty�notes)r�dict�zip)�limit�
skip_existing�condr8�colsrs&&    r�fetch_batchr�Qs���
�D��
��

�6��	9�:?��@�I%	�A�LR�H�R�Y�R�~�R�l�R�7�R��R�,�R�-4�R�5F�R�GP�R��R��R�$�R�%-�R�.>�R�?T�R�
�R��R�+�R�,2�R�3>�R�?P�R�
�	R�(�	R�)2�	R�3=�	R�>I�	R�JV�	R�

�R�
*�R�
+6�R�
7@�R�
AX�R�
�
R��
R� 3�
R�4I�
R�JQ�
R�D�)+�1��.��1�D��T����.�.��.s�1Bc���\VR,4p\VR,4p\VR,;'gR4pRPRW344pV'dVRV2MTp\V4R,#)rbrcrd�Kravet� c3�8"�TFq'gKVx�K	R#5i�N�)�.0�xs& r�	<genexpr>�build_title.<locals>.<genexpr>�s���,�J�q�!���J�s�	�
� | :N��N)rSrMrZ)�it�pat�col�brn�ts&    r�build_titler��sn��
�R��'�
(�C�
�R��%�
&�C�
�R��[�,�,�H�
-�C����,�S�J�,�,�A��1�#�S�����A��a�=���rc
��R\VR,;'gR4R\VR,;'gR4RVR,'dR\VR,42MR.pVUu.uFq"'gKVNK	up#uupi)r�rdrWrjrzNew ArrivalrfzOrigin: �rS)r��tagsr�s&  r�
build_tagsr��s|����2�g�;�*�*�(�+���2�g�;�$�$�"�%��<>�?R�<S�<S�(�:�b�!4�5�6�7�8�Y[�
�D��!�t�!�q�A�A�t�!�!��!s�%	A<�3A<c���\VR,4p\VR,4p\VR,4p\VR,4p\VR,4;'gRP4p\VR,;'gR4p\VR,;'gVR	,;'gR4pR
VR2pV'dVRVR2,
pVR
V2,
pV'dVRVR2,
pVR,
pRVR2p	V'dV	RVP4R2,
p	V'd
V	RV2,
p	V	R,
p	Rp
\W�,V
,4#)rbrcrdrerjrWrfrrlrmz<p><strong>z	</strong>z in <strong>� by z, from the z collectionz.</p>z<p>A z
 wallcoveringz with a z sensibilityz
, crafted in za. Designed for interiors that benefit from considered materials and a distinct point of view.</p>z�<p>Order a complimentary sample to see the colour and scale in your own light, or message our trade team for coordinating colourways and specification guidance.</p>)rSrIrZ)r�r�r�r��coll�t1�origin�style�openingr:�closes&          r�build_descriptionr��sI���b��(�)�C��b��&�'�C��b��k�"�C��b��&�'�D��r�'�{�#�5�5�~�<�<�>�B�
��.�/�5�5�2�
6�F��r�(�|�9�9�r�(�|�9�9�r�:�E��C�5�	�*�G�
�G��c�U�)�4�4�G���c�U�|��G��W�+�d�V�;�7�
7�W��w��G�
�2�$�m�$�D��d�������|�<�<�d�
�t��v�h�/�/�t��o�o�D�e�E��g�n�u�,�-�-rc	���\VR,4p\VR,4p\VR,;'gR4p\VRVRVR24R,p\RVRVR	VR
24R,pWE3#)rbrcrdr�r�u — Free Samples:N�FNzOrder free samples of z in r�zP. Free shipping, trade pricing, and expert guidance from Designer Wallcoverings.:N�N)rSrZ)r�r�r�r��seo_t�seo_ds&     r�	build_seor��s���
�R��'�
(�C�
�R��%�
&�C�
�R��[�,�,�H�
-�C��#��a��u�A�c�U�*;�<�=�c�B�E��
 ���T�#��d�3�%�8Y�	Z�
��
�E��<�rc�Faa�.oR=VV3RllpV!RRVR,4V!RRVR,4T!RR\VR,;'gR44T!RR	\VR,;'gR44T!RR\VR,;'gR44T!RR
\VR
,;'gR44T!RR\VR,;'gR44T!RR\VR,;'gR44T!R
R\VR,;'gR44T!R
R\VR,;'gR44T!R
R\VR,;'gR44V!R
RVR,4V!R
RVR,4T!R
R\VR,;'gR44V!R
RVR,4T!R
R\VR,;'gR44V!R
RVR,4V!R
RVR,4V!R
RVR,4V!R
R VR!,4V!R
R"VR#,4V!R
R$VR%,4V!RR&VR&,4V!R
R'VR(,4V!R
R)VR*,4V!R
R+VR,,4V!R
R-VR.,4V!R
R/VR0,4V!R
R1VR2,4V!R
R3VR4,4V!R
R5VR6,4V!R
R7VR8,4V!R
R9VR:,4V!RR;VR<,4S#)>�single_line_text_fieldc�<�VeVR9dR#SPRSRVRVR\V4P4RV/4R#)N�ownerId�	namespace�key�value�type)r�NULL)rJ�strrH)�ns�kr9r�rP�pids&&&&��r�add�build_metafields.<locals>.add�s>����9��[�(�&��
�
�I�s�K��U�A�w��A�����X^�`a�b�cr�custom�manufacturer_skura�dwc�colorrcr�real_color_namerbrd�real_vendor�globalz	Color-Way�Brand�
CollectionrergrhzCountry-of-Originrf�Contentri�Type1rjzVert-RptrvzHorz-Rptrw�Weightr��	DirectionrzzProp-65rxzCA-TB117ryrz
Clean-Coder{�
Durabilityr|zLead-Time-in-Daysr}z	Ship-Fromr~zMemo-Sample-Availabler��v_prods_quantity_order_minr��v_prods_quantity_order_unitsr�z
WHLS-PricerpzDisplay-StatusrnzInventory-Availablero�vendor_notesr�)r�r�)r�r�r�rPs&f @r�build_metafieldsr��s����
�C�d�d���#�R�	�]�3��� �b��m�4����j��L�1A�1G�1G�R�&H�I���"�j��L�1A�1G�1G�R�&H�I���g�j��L�1A�1G�1G�R�&H�I���n�j��N�1C�1I�1I�r�&J�K���g�j��G��1B�1B��&C�D���m�j��G��1B�1B��&C�D����j��L�1A�1G�1G�R�&H�I����j��G��1B�1B��&C�D����j��L�1A�1G�1G�R�&H�I����b��k�2���"�b�):�&;�<���$�j��4G�1H�1N�1N�B�&O�P����b��m�4����j��G��1B�1B��&C�D����b��&7�8����b��&7�8����b��l�3����b��o�6����b��m�4����b��n�5����b��m�4����b��&6�7����b��&6�7���$�b�)9�&:�;����b��o�6���(�"�-D�*E�F���-��4G�1H�I���/��4I�1J�K����b��o�6���!�b�)9�&:�;���&��+@�(A�B����b��k�2��Jrz�mutation($p: ProductCreateInput!){ productCreate(product:$p){ product{ id handle variants(first:5){nodes{id}} } userErrors{field message} } }z�mutation($pid:ID!,$vs:[ProductVariantsBulkInput!]!){ productVariantsBulkUpdate(productId:$pid,variants:$vs){ userErrors{field message} } }z�mutation($pid:ID!,$vs:[ProductVariantsBulkInput!]!){ productVariantsBulkCreate(productId:$pid,variants:$vs){ productVariants{id sku} userErrors{field message} } }z�mutation($pid:ID!,$vs:[ProductVariantsBulkInput!]!,$st:ProductVariantsBulkCreateStrategy){ productVariantsBulkCreate(productId:$pid,variants:$vs,strategy:$st){ productVariants{id sku} userErrors{field message} } }z�mutation($pid:ID!,$m:[CreateMediaInput!]!){ productCreateMedia(productId:$pid,media:$m){ media{... on MediaImage{id status}} mediaUserErrors{field message} } }z`mutation($m:[MetafieldsSetInput!]!){ metafieldsSet(metafields:$m){ userErrors{field message} } }zmmutation($id:ID!,$pids:[ID!]!){ collectionAddProducts(id:$id,productIds:$pids){ userErrors{field message} } }zmmutation($p:ProductUpdateInput!){ productUpdate(product:$p){ product{id status} userErrors{field message} } }c��
�VR,pVR,p\RVRVRVR,RVR,RVR,R24VR,;'gR	PR
R4pVPR
R4p\RVR
VRVR24\V4p\	V4p\V4p\
V4wr�RTR\VR,;'gR4RRRRRVRVRRVRV	//p
\\RV
/4pVR,R,pV'd\RV24hVR,R,p
V
R ,pV
R!,R",^,R ,p\R#VR$V
R%,R&24\VR',4pVR(,'d\VR(,4MR)pR VR+VR,
R-R.VR/R0//pVeVR,
VR-,R(&VPR14'd$\VR1,4P!4VR1&\\"R2VR3V./4R+R4R-R.VR52R/R6/R7R8R9R:R;/./p\VPR<R=44P!4pV'dR>VR?2MR@p\\"R2VR3R VR7R8R9R:V/././4\\$R2VR3V.RARB/4\\&R2VRCRDVRE,RFRGRHV/./4VPRI4'd7\\&R2VRCRDVRI,PRJRK4RFRGRHVRL2/./4\RN4\+W4p\-^\/V4^4Fp\\0RCVVV^,/4K!	\RO\/V4RP24\RQVP3RR4Rc,RSV
R%,PR
R4RTVPR
R4RS\VR,;'gR4PR
R4RUTRSTRVTRSVPR
R4RWVR,
RXT;'gRYRXVR,
RZ24\\4R \6R[V./4\R]TRSVR,PR
R4RTVR,PR
R4RSTRTTRSTR^VR',RXVR(,;'gRYRXVR_,;'gRYR`VRE,PR
R4Ra24RVRVR2VRbVP3RR4Rc,R%V
R%,RV/# \\3d	R*R)ppELli;i \(dp\RMT24R)p?EL/R)p?ii;i \(dp\R\T24R)p?EL%R)p?ii;i)dr`raz
== r�rdrbz / rcz ==�KRAVET�'z''z_INSERT INTO dw_sku_registry (dw_sku, vendor_prefix, vendor_name, mfr_sku, created_at) VALUES ('z
','DWKK','z','z)', now()) ON CONFLICT (dw_sku) DO NOTHING�title�vendorr��productTyperW�status�DRAFTr��descriptionHtml�seo�description�p�
productCreate�
userErrorszproductCreate: �product�id�variants�nodesz
  created z (�handle�)rqrsNg�pricez.2f�
inventoryItem�sku�trackedTr�r��vsz4.25z-SampleF�optionValues�
optionName�Title�name�SamplergrzSold Per Single Roll - zIn WidezSingle Roll�st�DEFAULTrC�originalSourcert�mediaContentType�IMAGE�altrur�z%20u — full pattern repeatz  full_repeat skipped: z  image attachedz
  metafields z setz�
      INSERT INTO shopify_products (shopify_id, handle, title, vendor, product_type,
        sku, variant_sku, status, dw_sku, mfr_sku, vendor_prefix,
        retail_price, cost_price, price, synced_at)
      VALUES ('�/z', 'z',
              'z"',
              'Wallcovering', 'z', 'draft',
              'z', 'DWKK',
              z, r�z7, now())
      ON CONFLICT (shopify_id) DO NOTHING
    �pidsz  collection add skipped: z�
      INSERT INTO kravet_catalog (mfr_sku, pattern_name, color_name, brand, dw_sku,
        shopify_product_id, on_shopify, price_retail, cost_price, tariff_pct,
        status, imported_at, image_url)
      VALUES ('z', true,
              rrz!,
              'draft', now(), 'z�')
      ON CONFLICT (mfr_sku) DO UPDATE SET
        dw_sku = EXCLUDED.dw_sku,
        shopify_product_id = EXCLUDED.shopify_product_id,
        on_shopify = true,
        image_url = EXCLUDED.image_url,
        imported_at = now()
    �pid_num�����)�print�replacerr�r�r�r�rSr=�PRODUCT_CREATEr7�float�	TypeError�
ValueError�getr�rH�VARIANT_UPDATE�VARIANT_CREATE_STRATEGY�MEDIA_CREATE�	Exceptionr��range�len�	METAS_SETrG�COLLECTION_ADD�NEW_ARRIVALS)r�r`�mfr�esc_b�esc_mr�r��descr�r��pir<�ue�prodr��dvid�	map_price�
cost_price�mv�svrR�main_opt�e�mfs�is&                        r�push_oner�s;��
��\�F�
�	�]�C�	�E�&���S�E��R��[�M��R��5G�4H��B�|�L\�K]�]`�
a�b���[�
$�
$�H�-�-�c�4�8�E��K�K��T�"�E����x�z�%���E�7�:c�
e�f�
��O�E��r�N�D��b�!�D��R�=�L�E����*�R��[�4�4�H�5��~��'����4�
���
�u�5�
�B�	�N�S�"�I�&�A�	
�?�	�L�	)�B�	����t�4�5�5��_��i�(�D���:�C��
��G�$�Q�'��-�D�	�J�s�e�2�d�8�n�-�Q�
/�0�*��"�U�)�$�	�*,�V�*�*�U�2�f�:�&�$�
�	
�d��I�c�?��%���D�9�
�B�
��)3�C�(8��?��F�#�	�v�v�i����B�y�M�*�0�0�2��9�
�����T�B�4�0�1�	���%�F�8�7�!3�Y��F��,����B�C�
�B�	�B�F�F�7�2���%�%�'�A�78�(���7�3�m�H�����T��d�N�l�G�V�X�%N�$O�-Q�,R�S�T���%��d�R�D�$�	�!J�K���u�c�3��"�[�/��G�
�u�*�)��	�

�v�v�� � �	1���u�c�3� �"�%6�"7�"?�"?��U�"K�"�G��%�� 8�9�2�1��
�
����2�
#�C�
�1�c�#�h��
#���I��S��1�R�4�[�)�*�$�	�M�#�c�(��4�
(�)����	�	�#��r�"�#�4��X��(>�(>�s�4�(H�'I�J��
�
�c�$�'�(��Z��7��8O�8O�x�-P�-X�-X�Y\�]a�-b�,c�d � &�x�t�F�8�4��x�t�C�K�K��D�1�2�3���o�R�
� 4� 4�f�5�R�	�#��G�

�
	�0��N�T�<��#��?�@�
���w�d�2�n�-�5�5�c�$�?�@�A��<� �(�(��T�2�3�4��w�?��x�t�C�5�!��%�y�k��B�v�J�0�0�&�1��B�|�4D�4N�4N��3O�P � "�;�� 7� 7��D� A�B�C�
�	�$	�&�)�S�%��i����3��PR�AS��$�x�.�'�5����m
�z�"�*� #�T�:�	�:�*��N�	1��+�A�3�/�0�0��	1��4�0�
�*�1�#�.�/�/��0�sB�25S;�5T�T>�;T�T�T;�"T6�6T;�>U"�	U�U"c	��\P!RV/4P4p\PPRVRR\RR/R7p\P!\PPV^xR7P44pVPR4R	J# \dp\R
T24R	p?R#R	p?ii;i)raz#http://45.61.58.125:9750/api/updater"�
Authorizationr#r$r%r)�errorNz
  FM err: F)
r,r-r.r/r0r1�
AGENT_AUTHr4r5r6rrr�)rr:r;rrs&    r�run_full_montyr }s���	��z�z�9�c�*�+�2�2�4���~�~�%�%�&K��&�(�*�n�FX�Y�&�[��
�J�J�v�~�~�-�-�c�3�-�?�D�D�F�G���u�u�W�~��%�%����
�
�1�#������s�B&B)�)C
�4C�C
c�2�\\RRVRR//4R#)r�r�r��ACTIVEN)r=�PRODUCT_UPDATE)r�s&r�activater$�s�����t�S�(�H�=�>�?rc�x�\P!4pVPR\^
R7VPRRRR7VP	4p\VP4p\R\V4R24.pVF p\V4pVPV4K"	\R\V4R
\V424\R4VFCp\RVR,R2RRR7\VR,4p\V'dRMR4KE	\R4VUu.uFqwR	,NK
	p	p\P!RR.V	,RR7VP 'd=\R4VF+p\!VR,4\RVR	,24K-	\R 4VF#p\R!VR	,R"
R#VR$,24K%	\#R%R&4;_uu_4p
VF/pV
P%\&P(!V4R',4K1	RRR4R# \d-p\RTPR	4R
T24Rp?EK�Rp?ii;iuupi \d%p\RTR	,R
T24Rp?EK Rp?ii;i +'giR#;i)(z--limit)r��defaultz
--activate�
store_truezflip to ACTIVE after push)�action�helpz[batch] z itemszFAIL r`z: Nz
[phase 1 created] r�z
[phase 2] Full Monty ...z  FM raz ...rT)�end�flushz okz FAILz
[phase 3] finalize ...�python3zkravet_finalize.pyF)rz
[phase 4] activate ...r�z	  ACTIVE z  activate fail z
=== URLs ===z  �15szF https://admin.shopify.com/store/designer-laboratory-sandbox/products/r�zbulk_push_results.jsonl�a�
)�argparse�ArgumentParser�add_argument�int�
parse_argsr�r�r�rrrJrrr rrr$�open�writer,r-)�ap�args�items�resultsr��resrr�ok�dw_skus�fs           r�mainr?�s\��	�	 �	 �	"�B��O�O�I�C��O�4��O�O�L��<W�O�X�
�=�=�?�D���
�
�#�E�	�H�S��Z�L��
'�(��G���	3��2�,�C��N�N�3���
� ��W���a��E�
�|�
<�=�
�
&�'�
��
��a�	�l�^�4�(�b��=�
�A�i�L�
)��
�r�e�w�'��
�
$�%�$+�,�G�q��{�{�G�G�,��N�N�I�3�4�w�>�e�L��}�}�}�
�(�)��A�
=���5��"��	�!�H�+��/�0��
�
��
��
��1�X�;�s�#�#i�jk�lu�jv�iw�x�y��
�'��	,�	,���A�
�G�G�D�J�J�q�M�D�(�)��
-�	,��=�	3��E�"�&�&��*�+�2�a�S�1�2�2��	3��-���
=��(��8��
�R��s�;�<�<��
=��
-�	,�	,�sB�H7�-I1�'I6�76J(�7I.� I)�)I.�6J%�J � J%�(J9	�__main__>r.�an�at�by�in�of�on�or�to�and�but�for�the�withr�)T)2�__doc__r0r,rFr�sys�time�urllib.requestr/�concurrent.futuresrr�os�environrr3�SHOPr2rr
�
__import__�	b64encode�decoderrKrrr=rSrZr^r�r�r�r�r�r�r�r�VARIANT_CREATErrrr	r#rr r$r?�__name__r�rr�<module>r[s(���&A�@�@�@�?�
�
�
���,�R�0��3��
�4�&�7�8��	�#�$��6��
�
�8�,�6�6�7M�N�U�U�W�
W�
�T��E�4��
 �
�C�
5/�r�	"�.�4
�'�Ve��b��z��v��w��w�	�E��E��~�D
�@�
-*�`�z���F�r