GithubHelp home page GithubHelp logo

isabella232 / uasparser2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mailgun/uasparser2

0.0 0.0 0.0 713 KB

Fast and reliable User Agent parser for python

License: Other

Python 100.00%

uasparser2's Introduction

Fast and reliable User Agent parser for python

Author: Jure Ham ([email protected])

Forked from:

A python version of http://user-agent-string.info/download/UASparser

By Hicro Kee (http://hicrokee.com) email: hicrokee AT gmail DOT com

Modified by Michal Molhanec http://molhanec.net

Install:

pip install uasparser2

Usage:

from uasparser2 import UASparser

uas_parser = UASparser('/path/to/your/cache/folder', mem_cache_size=1000)

result = uas_parser.parse('YOUR_USERAGENT_STRING')

# If input data is not avaible in cache folde, UASparser will download and prepare it on init.
# Force data update by calling:

uas_parser.updateData()

Speed comparison:

Parsing 100,000 user agents (10,000 unique) from our server logs:

original uasparser: 7264.2 sec

uasparser2 without cache: 171.7 sec

uasparser2 with cache(size 1000): 34.6 sec

Bitdeli Badge

uasparser2's People

Contributors

brcooley avatar hamaxx avatar horkhe 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.