@@ -122,23 +122,23 @@ const client = new WebServiceClient(accountId, licenseKey, {
122122```
123123
124124``` php
125- <?php require_once 'vendor/autoload.php'
125+ <?php
126+ require_once 'vendor/autoload.php';
126127use GeoIp2\WebService\Client;
127128
128- $account_id = 10;
129- $license_key = 'LICENSEKEY';
129+ $accountId = 10;
130+ $licenseKey = 'LICENSEKEY';
130131
131- $client = new Client($account_id , $license_key );
132+ $client = new Client($accountId , $licenseKey );
132133
133134// To query the GeoLite web service, you must set the optional `host` argument.
134135// The third argument specifies the language preferences when using the `->name`
135136// method on the model classes that this client creates.
136- $client = new Client($account_id , $license_key , ['en'], ['host' => 'geolite.info']);
137+ $client = new Client($accountId , $licenseKey , ['en'], ['host' => 'geolite.info']);
137138```
138139
139140``` python
140- import asyncio # for async requests with AsyncClient
141- import geoip2.webservice
141+ from geoip2.webservice import Client, AsyncClient
142142
143143account_id = 10
144144license_key = ' LICENSEKEY'
@@ -150,7 +150,7 @@ client = Client(account_id, license_key)
150150# to "geolite.info"
151151client = Client(account_id, license_key, host = ' geolite.info' )
152152
153- # Or if you want to use asynchronous requests
153+ # Or if you want to use asynchronous requests (requires `import asyncio`)
154154async_client = AsyncClient(account_id, license_key)
155155
156156# To query the GeoLite web service, you must set the "host" keyword argument
@@ -247,13 +247,14 @@ client.country('142.1.1.1').then((response) => {
247247```
248248
249249``` php
250- <?php require_once 'vendor/autoload.php'
250+ <?php
251+ require_once 'vendor/autoload.php';
251252use GeoIp2\WebService\Client;
252253
253- $account_id = 10;
254- $license_key = 'LICENSEKEY';
254+ $accountId = 10;
255+ $licenseKey = 'LICENSEKEY';
255256
256- $client = new Client($account_id , $license_key );
257+ $client = new Client($accountId , $licenseKey );
257258
258259// You can also use `$client->city` or `$client->insights`
259260// `$client->insights` is not available to GeoLite users
@@ -264,27 +265,27 @@ print($record->country->isoCode . "\n");
264265
265266``` python
266267# Sync
267- import geoip2.webservice
268+ from geoip2.webservice import Client
268269
269270account_id = 10
270271license_key = ' LICENSEKEY'
271272
272- with geoip2.webservice. Client(account_id, license_key) as client:
273+ with Client(account_id, license_key) as client:
273274 # You can also use `client.city` or `client.insights`
274275 # `client.insights` is not available to GeoLite users
275- response = client.country(' 128.101.101.101)
276+ response = client.country(' 128.101.101.101' )
276277
277278 print (response.country.iso_code)
278279
279280# Async
280281import asyncio
281- import geoip2.webservice
282+ from geoip2.webservice import AsyncClient
282283
283284async def main ():
284- async with geoip2.webservice. AsyncClient(account_id, license_key) as client:
285+ async with AsyncClient(account_id, license_key) as client:
285286 # You can also use `client.city` or `client.insights`
286287 # `client.insights` is not available to GeoLite users
287- response = await client.country(' 128.101.101.101)
288+ response = await client.country(' 128.101.101.101' )
288289
289290 print (response.country.iso_code)
290291
0 commit comments