Skip to content

Commit f66117f

Browse files
Update README.md
1 parent 403b568 commit f66117f

1 file changed

Lines changed: 49 additions & 3 deletions

File tree

README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IP2Location Python CSV Converter
22

3-
This Python script converts IP2Location CSV data file, that contains the IP address in numeric notation, into dot-decimal notation (such as x.x.x.x) or CIDR notation (x.x.x.x/24). It supports both the IP2Location commercial edition, DB1 to DB24 database and also the free edition, IP2Location LITE database. In addition to this, this converter can also be used to convert any CSV file that contains the IP number (the numeric notation).
3+
This Python script converts IP2Location CSV data file, that contains the IP address in numeric notation, into dot-decimal notation (such as x.x.x.x) or CIDR notation (x.x.x.x/24). It supports both the IP2Location commercial edition, DB1 to DB26 database and also the free edition, IP2Location LITE database. In addition to this, this converter can also be used to convert any CSV file that contains the IP number (the numeric notation).
44

55
You can download the IP2Location CSV file at the below links:
66

@@ -19,11 +19,24 @@ For Windows user, please install this library *win_inet_pton* before using this
1919

2020
`pip install win-inet-pton`
2121

22+
## Installation
23+
24+
You can install the script by using pip command:
25+
26+
`pip install pip install ip2location-python-csv-converter`
27+
28+
You can also download the standalone script from the root of this repository to your local directory and run from your local directory.
29+
2230
## Usage
2331

2432
```
2533
python ip2location-csv-converter.py [-range | -cidr | -hex] [-replace | -append] INPUT_FILE OUTPUT_FILE
2634
```
35+
or
36+
37+
```
38+
ip2location-csv-converter [-range | -cidr | -hex] [-replace | -append] INPUT_FILE OUTPUT_FILE
39+
```
2740

2841
#### Parameters
2942

@@ -60,6 +73,12 @@ Command:
6073
python ip2location-csv-converter.py -range -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
6174
```
6275

76+
or
77+
78+
```
79+
ip2location-csv-converter -range -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
80+
```
81+
6382
Output:
6483

6584
```
@@ -82,6 +101,11 @@ Command:
82101
```
83102
python ip2location-csv-converter.py -cidr -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
84103
```
104+
or
105+
106+
```
107+
ip2location-csv-converter -cidr -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
108+
```
85109

86110
Output:
87111

@@ -106,6 +130,12 @@ Command:
106130
python ip2location-csv-converter.py -hex -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
107131
```
108132

133+
or
134+
135+
```
136+
ip2location-csv-converter -hex -replace IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
137+
```
138+
109139
Output:
110140

111141
```
@@ -129,6 +159,12 @@ Command:
129159
python ip2location-csv-converter.py -range -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
130160
```
131161

162+
or
163+
164+
```
165+
ip2location-csv-converter -range -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
166+
```
167+
132168
Output:
133169

134170
```
@@ -152,6 +188,12 @@ Command:
152188
python ip2location-csv-converter.py -cidr -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
153189
```
154190

191+
or
192+
193+
```
194+
ip2location-csv-converter -cidr -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
195+
```
196+
155197
Output:
156198

157199
```
@@ -180,6 +222,12 @@ Command:
180222
python ip2location-csv-converter.py -hex -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
181223
```
182224

225+
or
226+
227+
```
228+
ip2location-csv-converter -hex -append IP2LOCATION-DB1.CSV IP2LOCATION-DB1.NEW.CSV
229+
```
230+
183231
Output:
184232

185233
```
@@ -195,8 +243,6 @@ Output:
195243
"01100000","01103fff","17825792","17842175","KR","Korea, Republic of"
196244
```
197245

198-
##
199-
200246
## Custom Input File
201247

202248
You can use this converter for a custom input file provided the input is in CSV format, with the first and second field contain the **ip from** and **ip to** information in numeric format.

0 commit comments

Comments
 (0)