diff --git a/README.md b/README.md index 2aeaede..5c30388 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,13 @@ pip install hubmigrate 1. Import the `MigrationClient` class from the `hubmigrate.client` module. 2. Create an instance of the `MigrationClient` class with the name of the config file and the name of the HubSpot portal. -3. Import the JSON data file to migrate. +3. Import the data file (JSON, Excel, or CSV) to migrate. 4. Call the `migrate_` method on the `MigrationClient` instance with the object to migrate. ### Usage Example +#### JSON Data + ```python from hubmigrate.client import MigrationClient import json @@ -34,7 +36,43 @@ def post_company(): company = json.load(f) # Migrate the company to HubSpot - response = client.migrate_company({'properties': company}) + response = client.migrate_company({'properties': company}, data_type='json') + +post_company() +``` + +#### Excel Data + +``` +from hubmigrate.client import MigrationClient + +# Create an instance of the MigrationClient class +client = MigrationClient('config', 'hubspot') + +def post_company(): + # Path to the Excel file + excel_file_path = 'hubmigrate/classes/sample_company.xlsx' + + # Migrate the company to HubSpot + response = client.migrate_company(excel_file_path, data_type='excel') + +post_company() +``` + +#### CSV Data + +``` +from hubmigrate.client import MigrationClient + +# Create an instance of the MigrationClient class +client = MigrationClient('config', 'hubspot') + +def post_company(): + # Path to the CSV file + csv_file_path = 'hubmigrate/classes/sample_company.csv' + + # Migrate the company to HubSpot + response = client.migrate_company(csv_file_path, data_type='csv') post_company() ``` @@ -49,7 +87,7 @@ post_company() ### 🏭 Migrate Companies -- `migrate_company(data)`: Migrate a company to HubSpot. +- `migrate_company(data, data_type='json')`: Migrate a company to HubSpot. - `update_company(data, company_id)`: Update a company in HubSpot. - `delete_company(company_id)`: Delete a company in HubSpot.