Git Product home page Git Product logo

udger-python's Introduction

Udger golang (format V3)

this package reads in memory all the database from udger and lets you lookup user agents's metadatas.

install

go get github.com/udger/udger

Documentation

For detailed documentation and basic usage examples, please see the package documentation at https://godoc.org/github.com/udger/udger

Automatic updates download

For autoupdate data use Udger data updater (https://udger.com/support/documentation/?doc=62)

old v2 format

If you still use the previous format of the db (v2), please see the branch old_format_v2

udger-python's People

Contributors

mallat avatar skybber avatar tuttle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

udger-python's Issues

cannot run success

after I install package... sudo pip3 install udger

and running code...

from pprint import pprint
from udger import Udger

udger = Udger()

result = udger.parse_ua("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")

I got following error...

Traceback (most recent call last):
File "test_ua.py", line 6, in
result = udger.parse_ua("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/udger/parser.py", line 14, in parse_ua
ua, class_id, client_id = self._client_detector(ua_string)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/udger/parser.py", line 87, in _client_detector
ua = self.db_get_first_row(Queries.crawler_sql, ua_string)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/udger/base.py", line 214, in db_get_first_row
self.db_cursor.execute(sql, params)
sqlite3.OperationalError: no such table: udger_crawler_list

I have no idea how to solve this....please guide me.

OperationalError: no such table: udger_crawler_list

Hello,

Thank you very much for your development!

However, when I try to call udger.parse_ua, I run into this error:

OperationalError: no such table: udger_crawler_list

What does this imply and how can I fix it?

sqlite3.OperationalError: no such table: udger_crawler_list

I just installed udger in virtual env and tried to test example code:

>>> from udger import Udger
>>> udger = Udger()
>>> udger.parse_ua("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67")

which resulted in
sqlite3.OperationalError: no such table: udger_crawler_list

Do I have to do anything extra apart from pip install udger?

Udger parser does not work perfectly

I tested on the parser using python with v3 database. Though it is test database, I test a UA that is inherited in samsung phone and the result is wrong.

{'device_brand_info_url': None, 'device_class_icon': u'phone.png', 'device_brand': None, 'ua_family_code': u'safari_mobile', 'device_class': u'Smartphone', 'device_brand_icon': None, 'device_class_code': u'smartphone', 'ua_family_icon': u'safari.png', 'ua_class_code': u'mobile_browser', 'ua_uptodate_current_version': u'', 'crawler_respect_robotstxt': None, 'device_marketname': None, 'os_code': u'android', 'device_brand_icon_big': None, 'os_icon': u'android.png', 'ua_version': '', 'ua_family_vendor': u'Apple Inc.', 'os_family': u'Android', 'ua_family_homepage': u'https://en.wikipedia.org/wiki/Safari_%28web_browser%29', 'crawler_category': None, 'device_class_info_url': u'https://udger.com/resources/ua-list/device-detail?device=Smartphone', 'crawler_last_seen': None, 'ua_family_vendor_code': u'apple_inc', 'ua_family_vendor_homepage': u'http://www.apple.com/', 'device_brand_homepage': None, 'ua_family': u'Safari mobile', 'crawler_category_code': None, 'os_info_url': u'https://udger.com/resources/ua-list/os-detail?os=Android', 'os_family_vendor': u'Google, Inc.', 'os_homepage': u'https://en.wikipedia.org/wiki/Android_%28operating_system%29', 'os_family_vendor_homepage': u'https://www.google.com/about/company/', 'os_icon_big': u'android_big.png', 'ua_version_major': '', 'os_family_vendor_code': u'google_inc', 'os_family_code': u'android', 'os': u'Android', 'device_class_icon_big': u'phone_big.png', 'device_brand_code': None, 'ua_engine': u'WebKit', 'ua_class': u'Mobile browser', 'ua_family_icon_big': u'safari_big.png', 'ua_string': 'Mozilla/5.0 (Linux; Android 8.0.0; SAMSUNG SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/9.2 Chrome/67.0.3396.87 Mobile Safari/537.36', 'ua_family_info_url': u'https://udger.com/resources/ua-list/browser-detail?browser=Safari%20mobile', 'ua': u'Safari mobile '}
It does not return the correct device model as well as ua_family_vendor. I wonder it is solved when using full dataset.

Database reload at runtime

It would be nice to be able to reload the database at runtime (without stopping the process).
I know it has been implemented in Java but it would be great to get this feature in Python too.
Thanks

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.