You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-9Lines changed: 64 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -240,20 +240,75 @@ You can add custom headers or modify default headers by setting the `headers` ke
240
240
241
241
### Internationalization
242
242
243
-
When looking up an IP address, the response object includes `details.country_name`, `details.isEU`, `details.country_flag`, `details.country_flag_url` and `details.country_currency` attributes which includes the country based on American English. It is possible to return the country name in other languages by setting the `countries_file`, remove or add EU countries by setting the keyword argument `eu_countries_file`, change the country flag emoji or unicode by setting the keyword argument `countries_flags_file` or change country's currency code or currency symbol by setting the `countries_currencies` when creating the `IPinfo` object. Moreover, the response object includes a `details.continent` which includes continent code and name of IP. The default file can be changed by setting the `continent_file` while creating the `IPinfo` object.
243
+
When looking up an IP address, the response object includes `details.country_name`, `details.isEU`, `details.country_flag`, `details.country_flag_url` and `details.country_currency` attributes which includes the country based on American English. It is possible to return the country name in other languages by setting the `countries`, remove or add EU countries by setting the keyword argument `eu_countries`, change the country flag emoji or unicode by setting the keyword argument `countries_flags` or change country's currency code or currency symbol by setting the `countries_currencies` when creating the `IPinfo` object. Moreover, the response object includes a `details.continent` which includes continent code and name of IP. The default file can be changed by setting the `continent` while creating the `IPinfo` object.
244
244
245
-
The file must be a `.json` file with the following structure:
245
+
```python
246
+
>>>import ipinfo
247
+
```
246
248
247
-
```json
248
-
{
249
-
"BD": {"name":"Bangladesh", "isEU":false},
250
-
"BE": {"name":"Belgium", "isEU":true},
251
-
"BF": {"name":"Burkina Faso", "isEU":false},
252
-
"BG": {"name":"Bulgaria", "isEU":true},
253
-
...
249
+
#### Country Names (`countries`):
250
+
Set the countries keyword argument or provide an in-memory map to customize country names.
251
+
```python
252
+
>>> countries = {
253
+
"BD": "Bangladesh",
254
+
"BE": "Belgium",
255
+
"BF": "Burkina Faso",
256
+
...
254
257
}
255
258
```
259
+
#### EU Countries (`eu_countries`):
260
+
Set the eu_countries keyword argument or provide an in-memory list to customize EU countries.
256
261
262
+
```python
263
+
>>> eu_countries = [
264
+
"IE",
265
+
"AT",
266
+
"LT",
267
+
...
268
+
]
269
+
```
270
+
#### Country Flags (`countries_flags`):
271
+
Set the countries_flags keyword argument or provide an in-memory map to customize country flags.
0 commit comments