Skip to content

Commit 5804ea0

Browse files
committed
update python guide
1 parent bd303cb commit 5804ea0

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import asyncio
12
import requests
23
{{> snippets/import}}
34

4-
# Fetch sample dataset
5-
url = "https://dashboard.algolia.com/sample_datasets/movie.json"
6-
movies = requests.get(url).json()
5+
async def main():
6+
# Fetch sample dataset
7+
url = "https://dashboard.algolia.com/sample_datasets/movie.json"
8+
movies = requests.get(url).json()
79

8-
# Connect and authenticate with your Algolia app
9-
{{> snippets/init}}
10+
# Connect and authenticate with your Algolia app
11+
{{> snippets/init}}
1012

11-
# Save records in Algolia index
12-
{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
13+
# Save records in Algolia index
14+
{{#dynamicSnippet}}saveObjectsMovies{{/dynamicSnippet}}
15+
16+
asyncio.run(main())
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
_client = {{#lambda.pascalcase}}{{{client}}}Sync{{/lambda.pascalcase}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}})
1+
client = {{#lambda.pascalcase}}{{{client}}}Sync{{/lambda.pascalcase}}("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"{{#hasRegionalHost}}, "ALGOLIA_APPLICATION_REGION"{{/hasRegionalHost}})

0 commit comments

Comments
 (0)