googleurlbuilder


Namegoogleurlbuilder JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummarySimple pure Python Google URL generator based on google(.com) advanced search.
upload_time2023-09-24 20:12:34
maintainer
docs_urlNone
authoralexandrerbb
requires_python>=3.9
licenseMIT License Copyright (c) 2023 alexandrerbb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords google url generator generate link
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Google URL Builder.

Simple pure Python Google URL generator based on 
[Google advanced search](https://www.google.com/advanced_search).

### Why?

In some development cases, you may need to generate Google search URLs without the wish 
to request Google(.com).

<ins>In example :</ins>
-   for displaying/providing those URLs directly to the end user.
-   to have more control over what your code makes.


### Package principles.

-   Pure Python → No more depedencies needed.
-   Strong typing.

## Examples.

### Import package.


```python
from googleurlbuilder import (
    GoogleURL,
    SearchFilters,
    parameters as pr, # Aliases are optionnal.
    # Query parameters.
    operators as op,
    # Operators over query parameters.
    filters as ft,
    # Filters.
)
```

### Simple use case.


```python
url = GoogleURL((pr.Words(["search", "google"]) + pr.ExactPhrases(["google search"])))

print(url.compute_url())
```

    https://google.com/search?q=%28%28search+google%29+%22google+search%22%29
    

### Use filters.


```python
url = GoogleURL(
    query=pr.Words(["search", "google"]),
    filters=SearchFilters(language=ft.Languages.French),
    tld="fr",
)

print(url.compute_url())
```

    https://google.fr/search?lr=lang_fr&q=%28search+google%29
    

### Use operators over search parameters.


```python
query = op.Or(pr.Words(["search"]), pr.ExactPhrases(["google"]))
print(query)
query = pr.Words(["search"]) | pr.ExactPhrases(["google"])  # equivalent.
print(query)
```

    (search OR "google")
    (search OR "google")
    

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "googleurlbuilder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "google,url,generator,generate,link",
    "author": "alexandrerbb",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/2f/f6/23bae49090aaf090d47bcaf417b6a02bc4c59b72d3d77ec14415fc444a5c/googleurlbuilder-0.1.0.tar.gz",
    "platform": null,
    "description": "# Google URL Builder.\n\nSimple pure Python Google URL generator based on \n[Google advanced search](https://www.google.com/advanced_search).\n\n### Why?\n\nIn some development cases, you may need to generate Google search URLs without the wish \nto request Google(.com).\n\n<ins>In example :</ins>\n-   for displaying/providing those URLs directly to the end user.\n-   to have more control over what your code makes.\n\n\n### Package principles.\n\n-   Pure Python \u2192 No more depedencies needed.\n-   Strong typing.\n\n## Examples.\n\n### Import package.\n\n\n```python\nfrom googleurlbuilder import (\n    GoogleURL,\n    SearchFilters,\n    parameters as pr, # Aliases are optionnal.\n    # Query parameters.\n    operators as op,\n    # Operators over query parameters.\n    filters as ft,\n    # Filters.\n)\n```\n\n### Simple use case.\n\n\n```python\nurl = GoogleURL((pr.Words([\"search\", \"google\"]) + pr.ExactPhrases([\"google search\"])))\n\nprint(url.compute_url())\n```\n\n    https://google.com/search?q=%28%28search+google%29+%22google+search%22%29\n    \n\n### Use filters.\n\n\n```python\nurl = GoogleURL(\n    query=pr.Words([\"search\", \"google\"]),\n    filters=SearchFilters(language=ft.Languages.French),\n    tld=\"fr\",\n)\n\nprint(url.compute_url())\n```\n\n    https://google.fr/search?lr=lang_fr&q=%28search+google%29\n    \n\n### Use operators over search parameters.\n\n\n```python\nquery = op.Or(pr.Words([\"search\"]), pr.ExactPhrases([\"google\"]))\nprint(query)\nquery = pr.Words([\"search\"]) | pr.ExactPhrases([\"google\"])  # equivalent.\nprint(query)\n```\n\n    (search OR \"google\")\n    (search OR \"google\")\n    \n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 alexandrerbb  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Simple pure Python Google URL generator based on google(.com) advanced search.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://alexandrerbb.github.io/Google-URL-Builder/",
        "Source": "https://github.com/alexandrerbb/Google-URL-Builder"
    },
    "split_keywords": [
        "google",
        "url",
        "generator",
        "generate",
        "link"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6cc5fa810bb0d73a49015873a82b87cc40b04a4799711eb79dc01d96ac7d35a",
                "md5": "f4c323fa9a752503235f2689e3a6df1c",
                "sha256": "974aca8f2c2972a1fe444d4a0c56cc27ec0d795a3c8389c0e419ff039da1434c"
            },
            "downloads": -1,
            "filename": "googleurlbuilder-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f4c323fa9a752503235f2689e3a6df1c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11631,
            "upload_time": "2023-09-24T20:12:32",
            "upload_time_iso_8601": "2023-09-24T20:12:32.173581Z",
            "url": "https://files.pythonhosted.org/packages/d6/cc/5fa810bb0d73a49015873a82b87cc40b04a4799711eb79dc01d96ac7d35a/googleurlbuilder-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ff623bae49090aaf090d47bcaf417b6a02bc4c59b72d3d77ec14415fc444a5c",
                "md5": "4be51fa657e672694891df51d7b5f34d",
                "sha256": "17cde10dcc8157b97f5856cdccb4e9e84bb1323a1ee0d67925a249537b465e7f"
            },
            "downloads": -1,
            "filename": "googleurlbuilder-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4be51fa657e672694891df51d7b5f34d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 11223,
            "upload_time": "2023-09-24T20:12:34",
            "upload_time_iso_8601": "2023-09-24T20:12:34.160142Z",
            "url": "https://files.pythonhosted.org/packages/2f/f6/23bae49090aaf090d47bcaf417b6a02bc4c59b72d3d77ec14415fc444a5c/googleurlbuilder-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-24 20:12:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexandrerbb",
    "github_project": "Google-URL-Builder",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "googleurlbuilder"
}
        
Elapsed time: 1.54932s