Skip to content

Commit dde1005

Browse files
committed
git hub action added
1 parent 730d10a commit dde1005

File tree

6 files changed

+142
-59
lines changed

6 files changed

+142
-59
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
1+
name: CI
12

2-
3-
name: Lint Commit Messages
4-
on: [pull_request, push]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
511

612
jobs:
7-
commitlint:
13+
test:
814
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
920
steps:
10-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
1125
with:
12-
fetch-depth: 0
13-
- uses: Purushot14/user-agent-parser@v5
26+
python-version: ${{ matrix.python-version }}
27+
cache: "pip"
28+
29+
- name: Install Poetry
30+
run: |
31+
pip install poetry
32+
33+
- name: Install project
34+
run: |
35+
poetry install --no-interaction --no-ansi
36+
37+
- name: Run tests with coverage
38+
run: |
39+
poetry run pytest --cov=user_agent_parser --cov-report=xml

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [0.1.5] - 2025-05-19
6+
### Added
7+
- SEO refresh: README now includes project badges and a star prompt.
8+
- Rich project metadata (description & keywords) added to pyproject for better PyPI search ranking.
9+
10+
### Changed
11+
- Version bumped to 0.1.5.
12+
13+
## [0.1.1]
14+
### Added
15+
- Docs added.
16+
17+
## [0.1.0]
18+
### Added
19+
- Initial release.

CITATION.cff

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cff-version: 1.2.0
2+
message: "If you use this library, please cite it using the metadata below."
3+
title: "user-agent-parser"
4+
version: "0.1.5"
5+
doi: "10.5281/zenodo.XXXXXXX" # ⬅️ Replace with Zenodo DOI after you create one
6+
date-released: "2025-05-19"
7+
type: software
8+
license: MIT
9+
url: "https://pypi.org/project/user-agent-parser/"
10+
repository-code: "https://github.com/Purushot14/user-agent-parser"
11+
abstract: "Lightweight Python 3 library for fast, accurate parsing of User-Agent strings to detect browser, OS, and device details."
12+
keywords:
13+
- "user agent"
14+
- "user-agent parser"
15+
- "ua parser"
16+
- "browser detection"
17+
- "device detection"
18+
- "python"
19+
authors:
20+
- family-names: "Purushoth"
21+
given-names: "Prakash"
22+
email: "prakash.purushoth@gmail.com"
23+
orcid: "0000-0000-0000-0000" # ⬅️ Replace with your ORCID if available

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[![PyPI](https://img.shields.io/pypi/v/user-agent-parser.svg)](https://pypi.org/project/user-agent-parser/)
2+
[![Downloads](https://pepy.tech/badge/user-agent-parser/month)](https://pepy.tech/project/user-agent-parser)
3+
[![CI](https://github.com/Purushot14/user-agent-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/Purushot14/user-agent-parser/actions/workflows/ci.yml)
4+
5+
> **⭐ If you find this project useful, please star it on GitHub!**
6+
17
# Python User Agent Parser
28

39
`user_agent_parser` is a Python 3 library that provides an easy way to identify/detect devices from user agent string

pyproject.toml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,66 @@
11
[build-system]
2-
# Switch to poetry's build system
32
requires = ["poetry-core>=1.0.0"]
43
build-backend = "poetry.core.masonry.api"
54

65
[tool.poetry]
76
name = "user-agent-parser"
8-
version = "0.1.3"
9-
description = "Parser User agent string and get device details"
7+
version = "0.1.6" # bump so PyPI re-indexes
8+
description = "Python 3 library to parse User-Agent strings and detect browser, OS and device details"
109
authors = ["Purushot14 <prakash.purushoth@gmail.com>"]
1110
readme = "README.md"
1211
repository = "https://github.com/Purushot14/user-agent-parser"
13-
packages = [{include = "user_agent_parser"}]
12+
homepage = "https://github.com/Purushot14/user-agent-parser"
13+
14+
# ✍️ NEW — PyPI uses this list directly for search relevance
15+
keywords = [
16+
"user agent",
17+
"user-agent parser",
18+
"ua parser",
19+
"browser detection",
20+
"device detection",
21+
"python",
22+
"http",
23+
"analytics"
24+
]
25+
26+
packages = [{ include = "user_agent_parser" }]
1427
license = "MIT"
1528
classifiers = [
16-
"Programming Language :: Python :: 3",
17-
"License :: OSI Approved :: MIT License",
18-
"Operating System :: OS Independent",
19-
"Topic :: Internet :: WWW/HTTP",
20-
"Topic :: Software Development :: Libraries :: Python Modules",
21-
"Environment :: Web Environment",
22-
"Intended Audience :: Developers",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3 :: Only",
31+
"License :: OSI Approved :: MIT License",
32+
"Operating System :: OS Independent",
33+
"Topic :: Internet :: WWW/HTTP",
34+
"Topic :: Software Development :: Libraries :: Python Modules",
35+
"Environment :: Web Environment",
36+
"Intended Audience :: Developers",
2337
]
2438

2539
[tool.poetry.dependencies]
26-
python = ">=3.7"
40+
python = ">=3.8"
2741

2842
[tool.poetry.group.dev.dependencies]
2943
ruff = "^0.1.8"
3044
pytest = "^7.4.0"
3145

32-
# Ruff configuration for linting and formatting
46+
# --- unchanged lint / format config below ---
3347
[tool.ruff]
34-
target-version = "py37"
48+
target-version = "py38"
3549
line-length = 120
3650

37-
# Ruff linter settings
3851
[tool.ruff.lint]
39-
select = [
40-
"E", # pycodestyle errors
41-
"F", # pyflakes
42-
"I", # isort
43-
"UP", # pyupgrade
44-
"N", # pep8-naming
45-
"B", # flake8-bugbear
46-
"C4", # flake8-comprehensions
47-
"SIM", # flake8-simplify
48-
"TCH", # flake8-type-checking
49-
"ARG", # flake8-unused-arguments
50-
"ERA", # eradicate
51-
]
52+
select = ["E", "F", "I", "UP", "N", "B", "C4", "SIM", "TCH", "ARG", "ERA"]
5253
ignore = []
5354
unfixable = []
5455

55-
# Ignore unused imports in __init__.py files
5656
[tool.ruff.lint.per-file-ignores]
5757
"__init__.py" = ["F401"]
5858

59-
# Ruff import sorting
6059
[tool.ruff.lint.isort]
6160
known-first-party = ["user_agent_parser"]
6261
case-sensitive = true
6362

64-
# Ruff formatter settings
6563
[tool.ruff.format]
6664
quote-style = "double"
6765
indent-style = "space"
6866
line-ending = "auto"
69-

setup.py

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
"""
22
Created by prakash at 02/03/22
33
"""
4-
__author__ = 'Purushot14'
4+
__author__ = "Purushot14"
5+
from pathlib import Path
56

6-
import setuptools
7+
from setuptools import find_packages, setup
78

8-
with open("README.md") as fh:
9-
long_description = fh.read()
10-
11-
setuptools.setup(
12-
name="user-agent-parser", # This is the name of the package
13-
version="0.1.3",
14-
author="Purushot14", # Full name of the author
15-
author_email="prakash.purushoth@gmail.com",
16-
description="Parser User agent string and get device details",
17-
long_description=long_description, # Long description read from the the readme file
9+
this_dir = Path(__file__).parent
10+
setup(
11+
name="user-agent-parser",
12+
version="0.1.5",
13+
description="Python 3 library to parse User-Agent strings and detect browser, OS and device details",
14+
long_description=(this_dir / "README.md").read_text(encoding="utf-8"),
1815
long_description_content_type="text/markdown",
19-
packages=["user_agent_parser"], # List of all python modules to be installed
16+
author="Purushot14",
17+
author_email="prakash.purushoth@gmail.com",
2018
url="https://github.com/Purushot14/user-agent-parser",
19+
project_urls={
20+
"Documentation": "https://github.com/Purushot14/user-agent-parser#readme",
21+
"Bug Tracker": "https://github.com/Purushot14/user-agent-parser/issues",
22+
},
2123
license="MIT",
24+
packages=find_packages(include=["user_agent_parser", "user_agent_parser.*"]),
25+
python_requires=">=3.7",
2226
classifiers=[
2327
"Programming Language :: Python :: 3",
2428
"License :: OSI Approved :: MIT License",
2529
"Operating System :: OS Independent",
26-
'Topic :: Internet :: WWW/HTTP',
27-
'Topic :: Software Development :: Libraries :: Python Modules',
28-
'Environment :: Web Environment',
29-
'Intended Audience :: Developers'
30-
], # Information to filter the project on PyPi website
31-
python_requires='>=3.6', # Minimum version requirement of the package
32-
install_requires=[], # Install other dependencies if any
30+
"Topic :: Internet :: WWW/HTTP",
31+
"Topic :: Software Development :: Libraries :: Python Modules",
32+
"Environment :: Web Environment",
33+
"Intended Audience :: Developers",
34+
],
35+
keywords=[
36+
"user agent",
37+
"user-agent parser",
38+
"ua parser",
39+
"browser detection",
40+
"device detection",
41+
"python",
42+
"http",
43+
"analytics",
44+
],
3345
)

0 commit comments

Comments
 (0)