Skip to content

Commit

Permalink
docs: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcostaaa01 committed Aug 31, 2024
1 parent 3012800 commit ab556f0
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_<object>` method on the `MigrationClient` instance with the object to migrate.

### Usage Example

#### JSON Data

```python
from hubmigrate.client import MigrationClient
import json
Expand All @@ -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()
```
Expand All @@ -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.

Expand Down

0 comments on commit ab556f0

Please sign in to comment.