Python being such a beautiful, flexible and all around wonderful language, this is the first language I implemented it in ;) On the C3 server I get appr. 4300 lookups/second. On my P4 2GHz I get app. 11000 lookups/second.
The package contains the source for the test app. "ip2c.py" that does lookups on the command line, and the "ip2c_bench.py" benchmark application, a version of our binary database, a script, "makedb.py" that makes the binary database from the ip-to-country CSV file, or from MaxMind's GeoIP Free Country CSV.
We do recommend that you help make the ip-to-country database, since it's completely free ;)
The package also contains a script, "makewinexe.py", that makes a windows executable that does the CSV conversion.
ip2c-python-0.9.1.tar.bz2 - Python source bzip2'ed (390 KB)
ip2c-python-0.9.1.zip - Python source zipped (497 KB)
We made available a windows executable that can build the database from the CSVs (see above). Use this if you don't have and don't want Python installed on your computer (although we can't imagine why ;).
Download IP to Country Database builder| Etomite encountered the following error while attempting to parse the requested resource: | |||
| « PHP Parse Error » | |||
| PHP error debug | |||
| Error: | mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) | ||
| Error type/ Nr.: | Warning - 2 | ||
| File: | /www/weirdsilence/weirdsilence.net/www/index.php | ||
| Line: | 118 | ||
| Line 118 source: | if(@!$this->rs = mysql_connect($this->dbConfig['host'], $this->dbConfig['user'], $this->dbConfig['pass'])) { | ||
| Parser timing | |||
| MySQL: | 0.0000 s s | (0 Requests) | |
| PHP: | 0.0307 s s | ||
| Total: | 0.0307 s s | ||