From 966e1b553e7f43a620782f73eb980d0a58208ee2 Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 14:02:22 +0300 Subject: [PATCH 1/6] make internal methods private --- src/ua_generator/data/generator.py | 12 +++++------ src/ua_generator/useragent.py | 34 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/ua_generator/data/generator.py b/src/ua_generator/data/generator.py index 0d91576..c604679 100644 --- a/src/ua_generator/data/generator.py +++ b/src/ua_generator/data/generator.py @@ -14,11 +14,11 @@ def __init__(self, device, platform, browser): self.platform = platform self.browser = browser - self.platform_version = self.generate_platform_version() - self.browser_version = self.generate_browser_version() - self.user_agent = self.generate_user_agent() + self.platform_version = self.__platform_version() + self.browser_version = self.__browser_version() + self.user_agent = self.__user_agent() - def generate_platform_version(self): + def __platform_version(self): if self.platform == 'windows': return windows.get_version() elif self.platform == 'macos': @@ -30,7 +30,7 @@ def generate_platform_version(self): elif self.platform == 'android': return android.get_version() - def generate_browser_version(self): + def __browser_version(self): if self.browser == 'chrome': return chrome.get_version() elif self.browser == 'safari': @@ -40,7 +40,7 @@ def generate_browser_version(self): elif self.browser == 'edge': return edge.get_version() - def generate_user_agent(self): + def __user_agent(self): if self.platform == 'windows': if self.browser == 'chrome': template = utils.choice(( diff --git a/src/ua_generator/useragent.py b/src/ua_generator/useragent.py index aee1b67..c26a019 100644 --- a/src/ua_generator/useragent.py +++ b/src/ua_generator/useragent.py @@ -22,10 +22,10 @@ def generate(self, device=None, platform=None, browser=None): self.device = device self.platform = platform self.browser = browser - self.complete() + self.__complete() return self - def find_device(self): + def __find_device(self): if self.device is not None: if not utils.contains_multiple(self.device, devices): raise exceptions.InvalidArgumentError('No device type found: {}'.format(self.device)) @@ -42,7 +42,7 @@ def find_device(self): return self.device - def find_platform(self): + def __find_platform(self): if self.platform is not None: if not utils.contains_multiple(self.platform, platforms): raise exceptions.InvalidArgumentError('No platform found: {}'.format(self.platform)) @@ -59,7 +59,7 @@ def find_platform(self): return self.platform - def find_browser(self): + def __find_browser(self): if self.browser is not None: if not utils.contains_multiple(self.browser, browsers): raise exceptions.InvalidArgumentError('No browser found: {}'.format(self.browser)) @@ -75,10 +75,10 @@ def find_browser(self): return self.browser - def complete(self): - self.device = self.find_device() - self.platform = self.find_platform() - self.browser = self.find_browser() + def __complete(self): + self.device = self.__find_device() + self.platform = self.__find_platform() + self.browser = self.__find_browser() ua = generator.Generator(device=self.device, platform=self.platform, browser=self.browser) self.platform_version = ua.platform_version @@ -94,16 +94,16 @@ def __str__(self): # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List class ClientHints: def __init__(self, _gen: generator.Generator): - self.mobile = serialization.ch_bool(self.ch_mobile(_gen.platform)) - self.platform = serialization.ch_string(self.ch_platform(_gen.platform)) - self.platform_version = serialization.ch_string(self.ch_platform_version(_gen.platform_version)) - self.brands = serialization.ch_brand_list(self.ch_brands(_gen)) - self.brands_full_version_list = serialization.ch_brand_list(self.ch_brands(_gen, full_version_list=True)) + self.mobile = serialization.ch_bool(self.__mobile(_gen.platform)) + self.platform = serialization.ch_string(self.__platform(_gen.platform)) + self.platform_version = serialization.ch_string(self.__platform_version(_gen.platform_version)) + self.brands = serialization.ch_brand_list(self.__brands(_gen)) + self.brands_full_version_list = serialization.ch_brand_list(self.__brands(_gen, full_version_list=True)) - def ch_mobile(self, platform: str): + def __mobile(self, platform: str): return utils.contains(platforms_mobile, platform) - def ch_platform(self, platform: str): + def __platform(self, platform: str): if platform == 'ios': platform = 'iOS' elif platform == 'macos': @@ -112,10 +112,10 @@ def ch_platform(self, platform: str): platform = platform.title() return platform - def ch_platform_version(self, platform_version): + def __platform_version(self, platform_version): return formats.version(platform_version) - def ch_brands(self, _gen: generator.Generator, full_version_list: bool = False): + def __brands(self, _gen: generator.Generator, full_version_list: bool = False): brand_list = [{'brand': 'Not A(Brand', 'version': '99'}] if full_version_list: From 77009f32d201f6e26c050879368c87996a1036c1 Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 15:42:48 +0300 Subject: [PATCH 2/6] separate the client hints --- src/ua_generator/__init__.py | 4 +- src/ua_generator/client_hints.py | 54 +++++++++++++++++++ .../{useragent.py => user_agent.py} | 49 +---------------- 3 files changed, 58 insertions(+), 49 deletions(-) create mode 100644 src/ua_generator/client_hints.py rename src/ua_generator/{useragent.py => user_agent.py} (61%) diff --git a/src/ua_generator/__init__.py b/src/ua_generator/__init__.py index 8d12fc1..1a71121 100644 --- a/src/ua_generator/__init__.py +++ b/src/ua_generator/__init__.py @@ -3,8 +3,8 @@ Copyright: 2022 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ -from . import useragent +from . import user_agent def generate(**kwargs): - return useragent.UserAgent().generate(**kwargs) + return user_agent.UserAgent().generate(**kwargs) diff --git a/src/ua_generator/client_hints.py b/src/ua_generator/client_hints.py new file mode 100644 index 0000000..ad3280f --- /dev/null +++ b/src/ua_generator/client_hints.py @@ -0,0 +1,54 @@ +""" +Random User-Agent +Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +License: Apache License 2.0 +""" +from . import utils, formats, serialization +from .data import platforms_mobile +from .data import generator + + +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List +class ClientHints: + def __init__(self, _gen: generator.Generator): + self.mobile = serialization.ch_bool(self.__mobile(_gen.platform)) + self.platform = serialization.ch_string(self.__platform(_gen.platform)) + self.platform_version = serialization.ch_string(self.__platform_version(_gen.platform_version)) + self.brands = serialization.ch_brand_list(self.__brands(_gen)) + self.brands_full_version_list = serialization.ch_brand_list(self.__brands(_gen, full_version_list=True)) + + def __mobile(self, platform: str): + return utils.contains(platforms_mobile, platform) + + def __platform(self, platform: str): + if platform == 'ios': + platform = 'iOS' + elif platform == 'macos': + platform = 'macOS' + else: + platform = platform.title() + return platform + + def __platform_version(self, platform_version): + return formats.version(platform_version) + + def __brands(self, _gen: generator.Generator, full_version_list: bool = False): + brand_list = [{'brand': 'Not A(Brand', 'version': '99'}] + + if full_version_list: + browser_version = formats.version(_gen.browser_version) + else: + browser_version = formats.major_version(_gen.browser_version) + + if _gen.browser == 'chrome': + brand_list.append({'brand': 'Chromium', 'version': browser_version}) + brand_list.append({'brand': 'Google Chrome', 'version': browser_version}) + elif _gen.browser == 'edge': + brand_list.append({'brand': 'Chromium', 'version': browser_version}) + brand_list.append({'brand': 'Microsoft Edge', 'version': browser_version}) + + return brand_list + + def __str__(self): + return self.brands diff --git a/src/ua_generator/useragent.py b/src/ua_generator/user_agent.py similarity index 61% rename from src/ua_generator/useragent.py rename to src/ua_generator/user_agent.py index c26a019..c370341 100644 --- a/src/ua_generator/useragent.py +++ b/src/ua_generator/user_agent.py @@ -3,9 +3,10 @@ Copyright: 2022 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ -from . import utils, formats, serialization, exceptions +from . import utils, exceptions from .data import devices, platforms, platforms_desktop, platforms_mobile, browsers from .data import generator +from .client_hints import ClientHints class UserAgent: @@ -88,49 +89,3 @@ def __complete(self): def __str__(self): return self.text - - -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA -# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List -class ClientHints: - def __init__(self, _gen: generator.Generator): - self.mobile = serialization.ch_bool(self.__mobile(_gen.platform)) - self.platform = serialization.ch_string(self.__platform(_gen.platform)) - self.platform_version = serialization.ch_string(self.__platform_version(_gen.platform_version)) - self.brands = serialization.ch_brand_list(self.__brands(_gen)) - self.brands_full_version_list = serialization.ch_brand_list(self.__brands(_gen, full_version_list=True)) - - def __mobile(self, platform: str): - return utils.contains(platforms_mobile, platform) - - def __platform(self, platform: str): - if platform == 'ios': - platform = 'iOS' - elif platform == 'macos': - platform = 'macOS' - else: - platform = platform.title() - return platform - - def __platform_version(self, platform_version): - return formats.version(platform_version) - - def __brands(self, _gen: generator.Generator, full_version_list: bool = False): - brand_list = [{'brand': 'Not A(Brand', 'version': '99'}] - - if full_version_list: - browser_version = formats.version(_gen.browser_version) - else: - browser_version = formats.major_version(_gen.browser_version) - - if _gen.browser == 'chrome': - brand_list.append({'brand': 'Chromium', 'version': browser_version}) - brand_list.append({'brand': 'Google Chrome', 'version': browser_version}) - elif _gen.browser == 'edge': - brand_list.append({'brand': 'Chromium', 'version': browser_version}) - brand_list.append({'brand': 'Microsoft Edge', 'version': browser_version}) - - return brand_list - - def __str__(self): - return self.brands From a1777352273844463d0f6af3f2e354009d227595 Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 17:18:43 +0300 Subject: [PATCH 3/6] improve the efficiency --- src/ua_generator/__init__.py | 2 +- src/ua_generator/client_hints.py | 58 ++++++++++++++++++++++---------- src/ua_generator/user_agent.py | 32 +++++++----------- tests/test_user_agent.py | 19 ++++------- 4 files changed, 61 insertions(+), 50 deletions(-) diff --git a/src/ua_generator/__init__.py b/src/ua_generator/__init__.py index 1a71121..6b1d76d 100644 --- a/src/ua_generator/__init__.py +++ b/src/ua_generator/__init__.py @@ -7,4 +7,4 @@ def generate(**kwargs): - return user_agent.UserAgent().generate(**kwargs) + return user_agent.UserAgent(**kwargs) diff --git a/src/ua_generator/client_hints.py b/src/ua_generator/client_hints.py index ad3280f..f078766 100644 --- a/src/ua_generator/client_hints.py +++ b/src/ua_generator/client_hints.py @@ -3,7 +3,7 @@ Copyright: 2022 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ -from . import utils, formats, serialization +from . import formats, serialization from .data import platforms_mobile from .data import generator @@ -11,44 +11,68 @@ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List class ClientHints: - def __init__(self, _gen: generator.Generator): - self.mobile = serialization.ch_bool(self.__mobile(_gen.platform)) - self.platform = serialization.ch_string(self.__platform(_gen.platform)) - self.platform_version = serialization.ch_string(self.__platform_version(_gen.platform_version)) - self.brands = serialization.ch_brand_list(self.__brands(_gen)) - self.brands_full_version_list = serialization.ch_brand_list(self.__brands(_gen, full_version_list=True)) + # Type hinting only + mobile: str + platform: str + platform_version: str + brands: str + brands_full_version_list: str - def __mobile(self, platform: str): - return utils.contains(platforms_mobile, platform) + def __init__(self, gen: generator.Generator): + self.__generator = gen + self.__cache = {} + + def __mobile(self): + return self.__generator.platform in platforms_mobile + + def __platform(self): + platform = self.__generator.platform - def __platform(self, platform: str): if platform == 'ios': platform = 'iOS' elif platform == 'macos': platform = 'macOS' else: platform = platform.title() + return platform - def __platform_version(self, platform_version): - return formats.version(platform_version) + def __platform_version(self): + return formats.version(self.__generator.platform_version) - def __brands(self, _gen: generator.Generator, full_version_list: bool = False): + def __brands(self, full_version_list: bool = False): brand_list = [{'brand': 'Not A(Brand', 'version': '99'}] if full_version_list: - browser_version = formats.version(_gen.browser_version) + browser_version = formats.version(self.__generator.browser_version) else: - browser_version = formats.major_version(_gen.browser_version) + browser_version = formats.major_version(self.__generator.browser_version) - if _gen.browser == 'chrome': + if self.__generator.browser == 'chrome': brand_list.append({'brand': 'Chromium', 'version': browser_version}) brand_list.append({'brand': 'Google Chrome', 'version': browser_version}) - elif _gen.browser == 'edge': + elif self.__generator.browser == 'edge': brand_list.append({'brand': 'Chromium', 'version': browser_version}) brand_list.append({'brand': 'Microsoft Edge', 'version': browser_version}) return brand_list + def __getattr__(self, name): + if name in self.__cache: + return self.__cache[name] + + if name == 'mobile': + self.__cache[name] = serialization.ch_bool(self.__mobile()) + elif name == 'platform': + self.__cache[name] = serialization.ch_string(self.__platform()) + elif name == 'platform_version': + self.__cache[name] = serialization.ch_bool(self.__platform_version()) + elif name == 'brands': + self.__cache[name] = serialization.ch_brand_list(self.__brands()) + elif name == 'brands_full_version_list': + self.__cache[name] = serialization.ch_brand_list(self.__brands(full_version_list=True)) + + return self.__cache[name] + def __str__(self): return self.brands diff --git a/src/ua_generator/user_agent.py b/src/ua_generator/user_agent.py index c370341..852100a 100644 --- a/src/ua_generator/user_agent.py +++ b/src/ua_generator/user_agent.py @@ -10,21 +10,17 @@ class UserAgent: - def __init__(self): - self.device = None - self.platform = None - self.platform_version = None - self.browser = None - self.browser_version = None - self.text = None - self.ch: ClientHints = None - - def generate(self, device=None, platform=None, browser=None): - self.device = device - self.platform = platform - self.browser = browser + def __init__(self, device=None, platform=None, browser=None): + self.device: str = device + self.platform: str = platform + self.browser: str = browser self.__complete() - return self + + # Type hinting only + self.text: str + self.platform_version: dict + self.browser_version: dict + self.ch: ClientHints def __find_device(self): if self.device is not None: @@ -51,9 +47,9 @@ def __find_platform(self): self.platform = utils.choice(self.platform) return self.platform - if self.device is not None and utils.contains(self.device, 'desktop'): + if self.device is not None and 'desktop' in self.device: self.platform = utils.choice(platforms_desktop) - elif self.device is not None and utils.contains(self.device, 'mobile'): + elif self.device is not None and 'mobile' in self.device: self.platform = utils.choice(platforms_mobile) elif self.platform is None: self.platform = utils.choice(platforms) @@ -70,7 +66,7 @@ def __find_browser(self): if self.browser is None: self.browser = utils.choice(browsers) - '''Safari only support for macOS and iOS''' + # Safari only support for macOS and iOS if self.platform != 'macos' and self.platform != 'ios' and self.browser == 'safari': self.browser = 'chrome' @@ -82,8 +78,6 @@ def __complete(self): self.browser = self.__find_browser() ua = generator.Generator(device=self.device, platform=self.platform, browser=self.browser) - self.platform_version = ua.platform_version - self.browser_version = ua.browser_version self.text = ua.user_agent self.ch = ClientHints(ua) diff --git a/tests/test_user_agent.py b/tests/test_user_agent.py index 082a8ca..505836a 100644 --- a/tests/test_user_agent.py +++ b/tests/test_user_agent.py @@ -3,7 +3,8 @@ Copyright: 2022 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ -import unittest, re +import re +import unittest import src.ua_generator as ua_generator @@ -12,42 +13,34 @@ class TestUserAgent(unittest.TestCase): def test_user_agent(self): for i in range(0, 100): ua = ua_generator.generate() - self.assertIsNotNone(ua.text) self.assertIsNotNone(ua.device) self.assertIsNotNone(ua.platform) - self.assertIsNotNone(ua.platform_version) self.assertIsNotNone(ua.browser) - self.assertIsNotNone(ua.browser_version) + self.assertIsNotNone(ua.text) def test_user_agent_2(self): for i in range(0, 100): ua = ua_generator.generate(platform=('ios', 'macos'), browser='safari') - self.assertIsNotNone(ua.text) self.assertIsNotNone(ua.device) self.assertIsNotNone(ua.platform) - self.assertIsNotNone(ua.platform_version) self.assertIsNotNone(ua.browser) - self.assertIsNotNone(ua.browser_version) + self.assertIsNotNone(ua.text) def test_user_agent_3(self): for i in range(0, 100): ua = ua_generator.generate(device='mobile', browser=('safari', 'chrome')) - self.assertIsNotNone(ua.text) self.assertIsNotNone(ua.device) self.assertIsNotNone(ua.platform) - self.assertIsNotNone(ua.platform_version) self.assertIsNotNone(ua.browser) - self.assertIsNotNone(ua.browser_version) + self.assertIsNotNone(ua.text) def test_user_agent_4(self): for i in range(0, 100): ua = ua_generator.generate(device='desktop', browser='firefox') - self.assertIsNotNone(ua.text) self.assertIsNotNone(ua.device) self.assertIsNotNone(ua.platform) - self.assertIsNotNone(ua.platform_version) self.assertIsNotNone(ua.browser) - self.assertIsNotNone(ua.browser_version) + self.assertIsNotNone(ua.text) def test_user_agent_not_contains_brackets(self): brackets = re.compile('{(d|s|v|build|chrome|firefox|safari|webkit|windows|android|ios|macos|linux)}') From cc5d77e889a0a6ad25f21aa9cabfa8a343def367 Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 17:20:06 +0300 Subject: [PATCH 4/6] remove redundant tests --- tests/test_not_none.py | 58 ------------------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 tests/test_not_none.py diff --git a/tests/test_not_none.py b/tests/test_not_none.py deleted file mode 100644 index 943dfbc..0000000 --- a/tests/test_not_none.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) -License: Apache License 2.0 -""" -import unittest - -import src.ua_generator as ua_generator - - -class TestNotNone(unittest.TestCase): - def test_text(self): - for i in range(0, 100): - ua = ua_generator.generate() - self.assertTrue(ua.text is not None) - - def test_device(self): - for i in range(0, 100): - ua = ua_generator.generate(device=('desktop', 'mobile')) - self.assertTrue(ua.device is not None) - - def test_device_2(self): - for i in range(0, 100): - ua = ua_generator.generate() - self.assertTrue(ua.device is not None) - - def test_platform(self): - for i in range(0, 100): - ua = ua_generator.generate(device='desktop', platform=('windows', 'macos')) - self.assertTrue(ua.platform is not None) - self.assertTrue(ua.platform_version is not None) - - def test_platform_2(self): - for i in range(0, 100): - ua = ua_generator.generate(browser=('chrome', 'firefox')) - self.assertTrue(ua.platform is not None) - self.assertTrue(ua.platform_version is not None) - - def test_browser(self): - for i in range(0, 100): - ua = ua_generator.generate(device='desktop', platform=('windows', 'macos')) - self.assertTrue(ua.browser is not None) - self.assertTrue(ua.browser_version is not None) - - def test_browser_2(self): - for i in range(0, 100): - ua = ua_generator.generate(device='mobile', platform=('windows', 'linux')) - self.assertTrue(ua.browser is not None) - self.assertTrue(ua.browser_version is not None) - - def test_platform_6(self): - for i in range(0, 100): - ua = ua_generator.generate(platform='android', browser='chrome') - self.assertTrue(ua.browser is not None) - self.assertTrue(ua.browser_version is not None) - -if __name__ == '__main__': - unittest.main() From 4a3e9d18e5515dc35793aa1b5b92bef3e915dcbb Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 17:21:56 +0300 Subject: [PATCH 5/6] update year --- src/ua_generator/__init__.py | 2 +- src/ua_generator/client_hints.py | 2 +- src/ua_generator/data/__init__.py | 2 +- src/ua_generator/data/browsers/chrome.py | 2 +- src/ua_generator/data/browsers/edge.py | 2 +- src/ua_generator/data/browsers/firefox.py | 2 +- src/ua_generator/data/browsers/safari.py | 2 +- src/ua_generator/data/generator.py | 2 +- src/ua_generator/data/platforms/android/__init__.py | 2 +- src/ua_generator/data/platforms/android/android_nexus.py | 2 +- src/ua_generator/data/platforms/android/android_pixel.py | 2 +- src/ua_generator/data/platforms/android/android_samsung.py | 2 +- src/ua_generator/data/platforms/ios.py | 2 +- src/ua_generator/data/platforms/linux.py | 2 +- src/ua_generator/data/platforms/macos.py | 2 +- src/ua_generator/data/platforms/windows.py | 2 +- src/ua_generator/exceptions.py | 2 +- src/ua_generator/formats.py | 2 +- src/ua_generator/serialization.py | 2 +- src/ua_generator/user_agent.py | 2 +- src/ua_generator/utils.py | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/ua_generator/__init__.py b/src/ua_generator/__init__.py index 6b1d76d..a4f8c1a 100644 --- a/src/ua_generator/__init__.py +++ b/src/ua_generator/__init__.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ from . import user_agent diff --git a/src/ua_generator/client_hints.py b/src/ua_generator/client_hints.py index f078766..6eef831 100644 --- a/src/ua_generator/client_hints.py +++ b/src/ua_generator/client_hints.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ from . import formats, serialization diff --git a/src/ua_generator/data/__init__.py b/src/ua_generator/data/__init__.py index 747af74..1576bac 100644 --- a/src/ua_generator/data/__init__.py +++ b/src/ua_generator/data/__init__.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ diff --git a/src/ua_generator/data/browsers/chrome.py b/src/ua_generator/data/browsers/chrome.py index 56f1db1..5da8a8e 100644 --- a/src/ua_generator/data/browsers/chrome.py +++ b/src/ua_generator/data/browsers/chrome.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/browsers/edge.py b/src/ua_generator/data/browsers/edge.py index b7052fb..0b25dd1 100644 --- a/src/ua_generator/data/browsers/edge.py +++ b/src/ua_generator/data/browsers/edge.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/browsers/firefox.py b/src/ua_generator/data/browsers/firefox.py index 5f7a675..3071315 100644 --- a/src/ua_generator/data/browsers/firefox.py +++ b/src/ua_generator/data/browsers/firefox.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/browsers/safari.py b/src/ua_generator/data/browsers/safari.py index 6ac2583..a154823 100644 --- a/src/ua_generator/data/browsers/safari.py +++ b/src/ua_generator/data/browsers/safari.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/generator.py b/src/ua_generator/data/generator.py index c604679..64327c7 100644 --- a/src/ua_generator/data/generator.py +++ b/src/ua_generator/data/generator.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ from .browsers import chrome, safari, firefox, edge diff --git a/src/ua_generator/data/platforms/android/__init__.py b/src/ua_generator/data/platforms/android/__init__.py index 03bdfe9..a84d292 100644 --- a/src/ua_generator/data/platforms/android/__init__.py +++ b/src/ua_generator/data/platforms/android/__init__.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/android/android_nexus.py b/src/ua_generator/data/platforms/android/android_nexus.py index d753340..8501bf5 100644 --- a/src/ua_generator/data/platforms/android/android_nexus.py +++ b/src/ua_generator/data/platforms/android/android_nexus.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/android/android_pixel.py b/src/ua_generator/data/platforms/android/android_pixel.py index 12352cd..b84cb8b 100644 --- a/src/ua_generator/data/platforms/android/android_pixel.py +++ b/src/ua_generator/data/platforms/android/android_pixel.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/android/android_samsung.py b/src/ua_generator/data/platforms/android/android_samsung.py index 43ef0f5..cfe193d 100644 --- a/src/ua_generator/data/platforms/android/android_samsung.py +++ b/src/ua_generator/data/platforms/android/android_samsung.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/ios.py b/src/ua_generator/data/platforms/ios.py index 39d2381..3f93700 100644 --- a/src/ua_generator/data/platforms/ios.py +++ b/src/ua_generator/data/platforms/ios.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/linux.py b/src/ua_generator/data/platforms/linux.py index 28512a9..990037f 100644 --- a/src/ua_generator/data/platforms/linux.py +++ b/src/ua_generator/data/platforms/linux.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/macos.py b/src/ua_generator/data/platforms/macos.py index 342cec1..c930d6a 100644 --- a/src/ua_generator/data/platforms/macos.py +++ b/src/ua_generator/data/platforms/macos.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/data/platforms/windows.py b/src/ua_generator/data/platforms/windows.py index 885ac55..e4b4cac 100644 --- a/src/ua_generator/data/platforms/windows.py +++ b/src/ua_generator/data/platforms/windows.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random diff --git a/src/ua_generator/exceptions.py b/src/ua_generator/exceptions.py index 987b76e..f07a12d 100644 --- a/src/ua_generator/exceptions.py +++ b/src/ua_generator/exceptions.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ diff --git a/src/ua_generator/formats.py b/src/ua_generator/formats.py index 979e346..af20443 100644 --- a/src/ua_generator/formats.py +++ b/src/ua_generator/formats.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ diff --git a/src/ua_generator/serialization.py b/src/ua_generator/serialization.py index 53a809e..24d4ac0 100644 --- a/src/ua_generator/serialization.py +++ b/src/ua_generator/serialization.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2024 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ diff --git a/src/ua_generator/user_agent.py b/src/ua_generator/user_agent.py index 852100a..344e8e4 100644 --- a/src/ua_generator/user_agent.py +++ b/src/ua_generator/user_agent.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ from . import utils, exceptions diff --git a/src/ua_generator/utils.py b/src/ua_generator/utils.py index c8ae264..df38acc 100644 --- a/src/ua_generator/utils.py +++ b/src/ua_generator/utils.py @@ -1,6 +1,6 @@ """ Random User-Agent -Copyright: 2022 Ekin Karadeniz (github.com/iamdual) +Copyright: 2022-2024 Ekin Karadeniz (github.com/iamdual) License: Apache License 2.0 """ import random From 394c176a28917223dd1d505b2c7918ab4220735b Mon Sep 17 00:00:00 2001 From: iamdual Date: Sat, 9 Mar 2024 19:44:59 +0300 Subject: [PATCH 6/6] bump version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index f8adbb1..d5356e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ua-generator -version = 0.1.11 +version = 0.2.0 author = Ekin Karadeniz author_email = iamdual@icloud.com description = A random user-agent generator