gsc-bulk-indexer


Namegsc-bulk-indexer JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/konigle/google-bulk-indexer
SummaryUtilities for automatically submitting website pages for indexing in bulk to Google Search Console
upload_time2024-02-06 03:34:55
maintainerKonigle Developers
docs_urlNone
authorKonigle Developers
requires_python>=3.9,<4.0
licenseMIT
keywords google search console bulk indexing seo search engine optimization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Google Bulk Indexer

Python script for automatically submitting website pages for indexing in bulk to Google Search Console(GSC).
This is a Python version of the original work in [google-indexing-script](https://github.com/goenning/google-indexing-script)

## Functionality

This script submits the website URLs found on a site that you own to GSC for indexing. There is no guarantee that the page requested
for indexing will be indexed by Google.

## Requirements

1. Python >= 3.9
2. A Google Cloud account: You will have to create a service account under
   a Google cloud project and download the private key JSON file.
3. GSC account with a verified site (property).

## Before you run the tool

Follow the [guide by Google Cloud](https://developers.google.com/search/apis/indexing-api/v3/prereqs) to setup Google Cloud account and service account. You should have the following by the end:

- A google cloud account with a project that has both `Google Search Console API` and `Web Search Indexing API` enabled.
- A service account and a private key json file downloaded on your PC.
- The service account email added to your property (site) as Site owner.

## Running the tool

1. Install the package

```bash
pip install gsc-bulk-indexer
```

3. Copy the private key file that you downloaded from the Google cloud account in the same folder from which you are going to run the tool. Private key is needed for submitting URLs to Google Search Console for indexing.
4. Run the following command to start submitting URLs for indexing

   - If you have verified your site as a `Domain` property in GSC run the following command

   ```bash
   gsc_bulk_index -p <your-domain.xyz>
   ```

   OR

   ```bash
   python -m gsc_bulk_indexer.submit -p <your-domain.xyz>
   ```

   - If you have verified your site as a `URL Prefix` property, run the below command

   ```bash
   gsc_bulk_index -p https://<your-domain.xyz>
   ```

If you have the private key json file somewhere else on your PC, you can specify
the path while running the script

```bash
gsc_bulk_index -c <path to private key file> -p <site domain>
```

Run the script with `--help` to know about command line options.

## Use in your application

The indexer comes with caching mechanism to avoid submitting URLs
that have already been submitted. It creates pickle files under `.cache` directory in the current working directory. However, if you using the bulk indexer in your application backend, this might not be needed. Below is the recommended usage of the indexer in your application.

```python
from gsc_bulk_indexer import auth
from gsc_bulk_indexer import indexer

def index():
   credentials = {
      # service account json key dictionary
   }
   # submit the property URL
   gsc_property = "https://example.com"
   # OR submit a list of URLs
   # urls = ["https://example.com/page1", "https://example.com/page2"]
   access_token = auth.get_access_token(credentials=credentials)
   if access_token is None:
      return

   gsc_indexer = indexer.BulkIndexer(
      access_token,
      property=gsc_property,
      # urls=urls, # if you want to submit a list of URLs
      use_cache=False, # disable cache to prevent cache files from being created
   )
   num_urls_submitted = gsc_indexer.index()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/konigle/google-bulk-indexer",
    "name": "gsc-bulk-indexer",
    "maintainer": "Konigle Developers",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "developers@konigle.com",
    "keywords": "google search console,bulk indexing,seo,search engine optimization",
    "author": "Konigle Developers",
    "author_email": "developers@konigle.com",
    "download_url": "https://files.pythonhosted.org/packages/73/79/b900748d40abcc46ae32c8eeb11deb0129e59d2cc06259acd6e200b1a37d/gsc_bulk_indexer-0.1.1.tar.gz",
    "platform": null,
    "description": "# Google Bulk Indexer\n\nPython script for automatically submitting website pages for indexing in bulk to Google Search Console(GSC).\nThis is a Python version of the original work in [google-indexing-script](https://github.com/goenning/google-indexing-script)\n\n## Functionality\n\nThis script submits the website URLs found on a site that you own to GSC for indexing. There is no guarantee that the page requested\nfor indexing will be indexed by Google.\n\n## Requirements\n\n1. Python >= 3.9\n2. A Google Cloud account: You will have to create a service account under\n   a Google cloud project and download the private key JSON file.\n3. GSC account with a verified site (property).\n\n## Before you run the tool\n\nFollow the [guide by Google Cloud](https://developers.google.com/search/apis/indexing-api/v3/prereqs) to setup Google Cloud account and service account. You should have the following by the end:\n\n- A google cloud account with a project that has both `Google Search Console API` and `Web Search Indexing API` enabled.\n- A service account and a private key json file downloaded on your PC.\n- The service account email added to your property (site) as Site owner.\n\n## Running the tool\n\n1. Install the package\n\n```bash\npip install gsc-bulk-indexer\n```\n\n3. Copy the private key file that you downloaded from the Google cloud account in the same folder from which you are going to run the tool. Private key is needed for submitting URLs to Google Search Console for indexing.\n4. Run the following command to start submitting URLs for indexing\n\n   - If you have verified your site as a `Domain` property in GSC run the following command\n\n   ```bash\n   gsc_bulk_index -p <your-domain.xyz>\n   ```\n\n   OR\n\n   ```bash\n   python -m gsc_bulk_indexer.submit -p <your-domain.xyz>\n   ```\n\n   - If you have verified your site as a `URL Prefix` property, run the below command\n\n   ```bash\n   gsc_bulk_index -p https://<your-domain.xyz>\n   ```\n\nIf you have the private key json file somewhere else on your PC, you can specify\nthe path while running the script\n\n```bash\ngsc_bulk_index -c <path to private key file> -p <site domain>\n```\n\nRun the script with `--help` to know about command line options.\n\n## Use in your application\n\nThe indexer comes with caching mechanism to avoid submitting URLs\nthat have already been submitted. It creates pickle files under `.cache` directory in the current working directory. However, if you using the bulk indexer in your application backend, this might not be needed. Below is the recommended usage of the indexer in your application.\n\n```python\nfrom gsc_bulk_indexer import auth\nfrom gsc_bulk_indexer import indexer\n\ndef index():\n   credentials = {\n      # service account json key dictionary\n   }\n   # submit the property URL\n   gsc_property = \"https://example.com\"\n   # OR submit a list of URLs\n   # urls = [\"https://example.com/page1\", \"https://example.com/page2\"]\n   access_token = auth.get_access_token(credentials=credentials)\n   if access_token is None:\n      return\n\n   gsc_indexer = indexer.BulkIndexer(\n      access_token,\n      property=gsc_property,\n      # urls=urls, # if you want to submit a list of URLs\n      use_cache=False, # disable cache to prevent cache files from being created\n   )\n   num_urls_submitted = gsc_indexer.index()\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Utilities for automatically submitting website pages for indexing in bulk to Google Search Console",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/konigle/google-bulk-indexer",
        "Repository": "https://github.com/konigle/google-bulk-indexer"
    },
    "split_keywords": [
        "google search console",
        "bulk indexing",
        "seo",
        "search engine optimization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6941b518a09162d3c80bb0b0ba4f7fd7fbb97741bc9f6cfec8bc7968fa305083",
                "md5": "7c466e9e5b4a6446f9e12d0ad6065ad6",
                "sha256": "4f1fe376d25f850771ae315f76d689f10d3c9ae5417cae0dbf1c1321ff694db0"
            },
            "downloads": -1,
            "filename": "gsc_bulk_indexer-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c466e9e5b4a6446f9e12d0ad6065ad6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 11474,
            "upload_time": "2024-02-06T03:34:53",
            "upload_time_iso_8601": "2024-02-06T03:34:53.996116Z",
            "url": "https://files.pythonhosted.org/packages/69/41/b518a09162d3c80bb0b0ba4f7fd7fbb97741bc9f6cfec8bc7968fa305083/gsc_bulk_indexer-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7379b900748d40abcc46ae32c8eeb11deb0129e59d2cc06259acd6e200b1a37d",
                "md5": "8d9f383e4ca6ede6c30ea4d1419d9469",
                "sha256": "d7df46199da71dda318dfc87598bd54deea140e280f49439523b9e430a2f198e"
            },
            "downloads": -1,
            "filename": "gsc_bulk_indexer-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8d9f383e4ca6ede6c30ea4d1419d9469",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 10115,
            "upload_time": "2024-02-06T03:34:55",
            "upload_time_iso_8601": "2024-02-06T03:34:55.233379Z",
            "url": "https://files.pythonhosted.org/packages/73/79/b900748d40abcc46ae32c8eeb11deb0129e59d2cc06259acd6e200b1a37d/gsc_bulk_indexer-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-06 03:34:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "konigle",
    "github_project": "google-bulk-indexer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "gsc-bulk-indexer"
}
        
Elapsed time: 0.18068s