Giter VIP home page Giter VIP logo

mysql-ip2address's Introduction

mysql-ip2address

mysql - ip2address

在对数据库进行分析的时候,经常会遇到一些只有ip地址但没有归属地的情况,考虑到很多人都遇到过这种情况,于是把这几行代码发出来供大家使用

python startup.py -d 库名 -t 表名 -m 1 -u 用户id字段 -i 表里的ip字段 -m 1

-m 1 mode为1的时候,默认将ipv4的地址查归属地

-m 2 mode为2的时候,会将ip戳转换成ipv4再查归属地

大家分清楚使用场景

利用的是纯真ip库,通过本地解析了纯真ip库之后,在ip字段之后插入一列数据,例如字段是ip,则会在字段之后插入ip_address字段,对每个ip查询归属地之后循环插入。

自测没有问题,考虑到大家的数据安全,建议是将要进行查询归属地的表提取出userid和ip生成新表,使用新表来使用该脚本。

需要安装的库为:qqwry,pymysql

写着玩不用当真

mysql-ip2address's People

Contributors

0chencc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.