Metadata-Version: 2.4
Name: index-now-for-python
Version: 0.1.2
Summary: Lightweight Python package that makes it easy to submit URLs to the IndexNow API of various search engines
Home-page: https://jakob-bagterp.github.io/index-now-for-python/
Download-URL: https://pypi.org/project/index-now-for-python/
Author: Jakob Bagterp
Author-email: jakob_bagterp@hotmail.com
Maintainer: Jakob Bagterp
Maintainer-email: jakob_bagterp@hotmail.com
License: MIT License
Project-URL: Bug Tracker, https://github.com/jakob-bagterp/index-now-for-python/issues
Project-URL: Documentation, https://jakob-bagterp.github.io/index-now-for-python/
Project-URL: API Reference, https://jakob-bagterp.github.io/index-now-for-python/reference/
Project-URL: Source Code, https://github.com/jakob-bagterp/index-now-for-python
Project-URL: Release Notes, https://github.com/jakob-bagterp/index-now-for-python/releases
Keywords: python,timer
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: colorist==1.8.3
Requires-Dist: lxml==5.4.0
Requires-Dist: requests==2.32.3
Provides-Extra: testing
Requires-Dist: coverage==7.8.0; extra == "testing"
Requires-Dist: flake8==7.2.0; extra == "testing"
Requires-Dist: mypy==1.15.0; extra == "testing"
Requires-Dist: pytest==8.3.5; extra == "testing"
Requires-Dist: pytest-cov==6.1.1; extra == "testing"
Requires-Dist: tox==4.25.0; extra == "testing"
Dynamic: download-url
Dynamic: license-file

[![Latest version](https://img.shields.io/static/v1?label=version&message=0.1.2&color=yellowgreen)](https://github.com/jakob-bagterp/index-now-for-python/releases/latest)
[![Python 3.10 | 3.11 | 3.12 | 3.13+](https://img.shields.io/static/v1?label=python&message=3.10%20|%203.11%20|%203.12%20|%203.13%2B&color=blueviolet)](https://www.python.org)
[![MIT license](https://img.shields.io/static/v1?label=license&message=MIT&color=blue)](https://github.com/jakob-bagterp/index-now-for-python/blob/master/LICENSE.md)
[![Codecov](https://codecov.io/gh/jakob-bagterp/index-now-for-python/branch/master/graph/badge.svg?token=SGVMPJ1JWI)](https://codecov.io/gh/jakob-bagterp/index-now-for-python)
[![CodeQL](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/codeql.yml/badge.svg)](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/codeql.yml)
[![Test](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/test.yml/badge.svg)](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/test.yml)
[![Downloads](https://static.pepy.tech/badge/index-now-for-python)](https://pepy.tech/project/index-now-for-python)

# 🔍 Submit URLs to the IndexNow API of Various Search Enginges 🔎
Are you concerned about search engine optimization (SEO)? Do you want to make sure your website is indexed frequently by [Bing](https://www.bing.com/indexnow), [Yandex](https://yandex.com/indexnow), and other search engines?

IndexNow for Python is a lightweight Python package that makes it easy to submit URLs or entire sitemaps to the IndexNow API of various search engines, so your pages can be indexed faster.

Ready to try? Learn [how to install](https://jakob-bagterp.github.io/index-now-for-python/getting-started/installation/) and find tutorials in the [user guide](https://jakob-bagterp.github.io/index-now-for-python/user-guide/).

## Getting Started
### Basic Usage and Submit Individual URLs
Firstly, ensure that you have an [API key for IndexNow](https://www.indexnow.org/api-key). Hereafter, add your authentication credentials to the `IndexNowAuthentication` class, which will be used throughout the examples:

```python
from index_now import submit_url_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(
    host="example.com",
    api_key="a1b2c3d4",
    api_key_location="https://example.com/a1b2c3d4.txt",
)
```

Instances of `authentication = IndexNowAuthentication(...)` below refer to the section above.

You can now submit individual URLs to the IndexNow API:

```python
submit_url_to_index_now(authentication, "https://example.com/page1")
```

### Submit Multiple URLs in Bulk
How to submit multiple URLs in bulk to the IndexNow API:

```python
from index_now import submit_urls_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(...)

urls = ["https://example.com/page1", "https://example.com/page2", "https://example.com/page3"]

submit_urls_to_index_now(authentication, urls)
```

### Submit Entire Sitemap
How to submit an entire sitemap to the IndexNow API:

```python
from index_now import submit_sitemap_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(...)

sitemap_url = "https://example.com/sitemap.xml"

submit_sitemap_to_index_now(authentication, sitemap_url)
```

### Submit to Specific Search Engines
How to use the default `SearchEngineEndpoint` options or a custom endpoint:

```python
from index_now import submit_url_to_index_now, IndexNowAuthentication, SearchEngineEndpoint

authentication = IndexNowAuthentication(...)

endpoint_bing = SearchEngineEndpoint.MICROSOFT_BING
endpoint_custom = "https://example.com/indexnow"

for endpoint in [endpoint_bing, endpoint_custom]:
    submit_url_to_index_now(authentication, "https://example.com/page1", endpoint)
```

## Become a Sponsor 🏅
If you find this project helpful, please consider supporting its development. Your donations will help keep it alive and growing. Every contribution, no matter the size, makes a difference.

[Donate on GitHub Sponsors](https://github.com/sponsors/jakob-bagterp)

Thank you for your support! 🙌

## Contribute
If you have suggestions or changes to the module, feel free to add to the code and create a [pull request](https://github.com/jakob-bagterp/index-now-for-python/pulls).

## Report Bugs
Report bugs and issues [here](https://github.com/jakob-bagterp/index-now-for-python/issues).

# MIT License

Copyright (c) 2025 – present, Jakob Bagterp

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.
