{"id":21825946,"url":"https://github.com/pior/pyramid_useragent","last_synced_at":"2025-04-14T05:23:55.250Z","repository":{"id":62582989,"uuid":"119053847","full_name":"pior/pyramid_useragent","owner":"pior","description":"Provides an HTTP User-Agent parser and classifier for the Pyramid web framework.","archived":false,"fork":false,"pushed_at":"2018-10-19T23:25:22.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T19:13:48.888Z","etag":null,"topics":["pyramid-framework"],"latest_commit_sha":null,"homepage":"https://pyramid-useragent.readthedocs.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pior.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-26T13:20:30.000Z","updated_at":"2024-05-20T11:10:10.000Z","dependencies_parsed_at":"2022-11-03T21:22:04.608Z","dependency_job_id":null,"html_url":"https://github.com/pior/pyramid_useragent","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pior%2Fpyramid_useragent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pior%2Fpyramid_useragent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pior%2Fpyramid_useragent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pior%2Fpyramid_useragent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pior","download_url":"https://codeload.github.com/pior/pyramid_useragent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824681,"owners_count":21167345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pyramid-framework"],"created_at":"2024-11-27T18:03:03.565Z","updated_at":"2025-04-14T05:23:55.244Z","avatar_url":"https://github.com/pior.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyramid_useragent\n=================\n\nProvides an HTTP User-Agent parser and classifier for the\n`Pyramid \u003chttp://docs.pylonsproject.org\u003e`_ web framework.\n\n|circleci| |pythonversion| |documentation|\n\nCode: https://github.com/pior/pyramid_useragent\n\n\n.. |circleci| image::\n   https://circleci.com/gh/pior/pyramid_useragent.svg?style=svg\n   :target: https://circleci.com/gh/pior/pyramid_useragent\n   :alt: Tests on CircleCI\n\n.. |pythonversion| image::\n   https://img.shields.io/pypi/pyversions/pyramid_useragent.svg\n   :target: https://pypi.python.org/pypi/pyramid_useragent\n   :alt: Python version on PyPI\n\n.. |documentation| image::\n   https://readthedocs.org/projects/pyramid-useragent/badge/?version=latest\u0026style=flat-square\n   :target: https://pyramid-useragent.readthedocs.org/\n   :alt: Documentation on ReadTheDocs\n\nSetup\n-----\n\nOnce `pyramid_useragent` is installed, you typically use the ``config.include``\nmechanism to include it into your Pyramid project's configuration. In your\nPyramid project's ``__init__.py``:\n\n.. code-block:: python\n\n   config = Configurator(.....)\n   config.include('pyramid_useragent')\n\nAlternately, instead of using the Configurator's ``include`` method, you can\nactivate Pyramid by changing your application's ``.ini`` file, use the\nfollowing line:\n\n.. code-block:: ini\n\n   pyramid.includes = pyramid_useragent\n\n\nUsage\n-----\n\n.. code-block:: python\n\n   def demo(request):\n\n       client = request.user_agent_classified\n\n       if client.is_mobile or client.is_tablet:\n           return \"Download our mobile app!\"\n\n       if client.is_bot:\n           return \"Are you human? I'am human.\"\n\n       ua = request.user_agent_parsed\n\n       if ua.maincomponent.name == 'Links':\n           return \"Did you REALLY use Links?\"\n\n       if 'AdobeAIR' in ua.components:\n           if ua.components['AdobeAIR'].version == '3.9.0.1210':\n               return \"Much unsecure, so flaws\"\n\n       if ua.maincomponent.name == \"Mozilla\":\n           return \"This is supposed to describe your platform: %s\" % (\n               '; '.join(ua.maincomponent.comments))\n\n       return [c.name for c in ua.components.values()]\n\n\nTests\n-----\n\nFor development, this project uses a tool called `DevBuddy \u003chttps://github.com/devbuddy/devbuddy\u003e`_.\n\nTo install DevBuddy, go to the `install page on Github \u003chttps://github.com/devbuddy/devbuddy#install\u003e`_\nOnce installed, you should be able to run ``bud up`` to setup your development\nenvironment.\n\nIf you don't want to use DevBuddy, take a look at the file `dev.yml` to know\nhow the project is setup, linted, tested, released.\n\n\n.. code-block:: python\n\n   $ bud test\n\n\nDocumentation\n-------------\n\n.. code-block:: python\n\n   pip install -e .[docs]\n   cd docs\n   make html\n\n\nRelease\n=======\n\nMake sure you run the tests just before:\n\n.. code-block:: shell\n\n   $ bud test\n\nCreate a new release:\n\n.. code-block:: shell\n\n   $ bud release 0.4.0\n\nPublish the release:\n\n.. code-block:: shell\n\n   $ bud publish\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpior%2Fpyramid_useragent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpior%2Fpyramid_useragent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpior%2Fpyramid_useragent/lists"}