Skip to main content

Online Web Directory for Python sites

Star this repo on GitHub

⭐ Star this repo on GitHub

One click. It is how other people with the same problem find this.

Online Web Directory: see whether AI agents can get into your site

Website · Check your site, free · Confirm your listing, free · Pricing · Blog · Moltbook · m/agentweb · The Colony

npm gem PyPI Packagist Licence: MIT

See whether AI agents can get into your site, confirm your free directory listing, and count the AI agents that request your pages.

Online Web Directory is where AI agents look a website up before they fetch it. This package connects a site built on Django, Flask, FastAPI or any other WSGI or ASGI framework to the directory.

It uses the Python standard library only. Python 3.9 or newer.

Free

  • Pass or fail: can an AI agent with a plain web client get into your site? Plus a readiness score out of 100 and the date it was checked.
  • Confirm your free listing from the command line, with no email round trip. Tell agents what your site is, in your own words.
  • A count of requests from AI agents and crawlers (GPTBot, ClaudeBot, PerplexityBot and others), counted on your own server.
  • A directory badge you can place in a template. It is never shown unless you place it.

Paid, bought from the command line

  • Monitor: which agents came, which pages they asked for and the count for each day. A daily check, and an email when the result changes. You can ask for a fresh look after you change your site with recheck.
  • Fix report: every point behind your score, what was found, why it matters and how to fix it. Where this package can help with the fix (robots.txt lines for AI bots, an llms.txt made from your pages) the report says so.

Prices come from the service and are shown by status before you pay. Payment is by card on a secure payment page.

Install

pip install onlinewebdirectory_site

Connect your site

Run these where your site's code lives. Replace YOUR-DOMAIN with your site's address.

python -m onlinewebdirectory_site connect YOUR-DOMAIN

This saves a proof and its secret in .owd-site.json and prints one line, OWD_SITE_PROOF=.... If your site runs somewhere else, set that line in its environment and deploy. The middleware then answers /.well-known/owd-site.txt with the proof. The proof works for one hour.

python -m onlinewebdirectory_site verify

The service reads the proof file once and gives you a key. verify prints OWD_SITE_KEY=... one time: set it in the environment where your site runs. It also saves the key in .owd-site.json and removes the proof and secret from it. You can then remove OWD_SITE_PROOF. Do not run verify in a loop: the service rations it.

The proof file has to open at the top of your domain. A site that lives in a sub-folder cannot connect yet.

Keep .owd-site.json private

The file is made with mode 0600. It holds your key. Add it to .gitignore and never put it in version control. Set OWD_SITE_FILE to keep it somewhere else.

Settings

Environment What it is
OWD_SITE_KEY Your site key. When it is not set, the key is read from .owd-site.json.
OWD_SITE_PROOF The proof to serve while you connect. When it is not set, the proof is read from .owd-site.json.
OWD_SITE_FILE Where .owd-site.json is kept. Default: the folder the process starts in.
OWD_API The service address. Default: https://onlinewebdirectory.net.

Add the middleware

Django

In wsgi.py:

from django.core.wsgi import get_wsgi_application
from onlinewebdirectory_site import WSGIMiddleware

application = WSGIMiddleware(get_wsgi_application(), skip=("/static/", "/admin/"))

If you serve Django with ASGI, do the same in asgi.py with ASGIMiddleware(get_asgi_application()).

Flask

from flask import Flask
from onlinewebdirectory_site import WSGIMiddleware

app = Flask(__name__)
app.wsgi_app = WSGIMiddleware(app.wsgi_app)

FastAPI

from fastapi import FastAPI
from onlinewebdirectory_site import ASGIMiddleware

app = FastAPI()
app.add_middleware(ASGIMiddleware)

What the middleware does

  • Answers /.well-known/owd-site.txt with the proof as text/plain, only while a proof is set.
  • Counts a request when its user agent contains one of the agent words the service lists. It keeps the agent's name, the page path without the query string, and the day (UTC). Nothing else.
  • Holds the counts in memory, one table per process, at most 500 rows. Past that, new pages are counted together as (other pages).
  • Hands the counts to the service about once an hour, from a background thread, in calls of at most 200 rows. A call that fails is sent again later under the same batch id, so it is never counted twice. It also hands them over when the process stops.
  • Counts nothing when no key is set.
  • Never blocks or breaks a request. Every failure in counting is swallowed.

Options, all optional: skip (path beginnings that are never counted), every (seconds between hand-overs, default 3600), flush_on_exit (default True), and the llms.txt options below.

The badge

The badge is a small picture that links to your site's page in the directory. It is never shown automatically. Place it where you choose:

from onlinewebdirectory_site import default_site

badge = default_site().badge_html()   # "" until your listing is live

The HTML is cut down to exactly one link holding one image, https only. Mark it as safe in your template ({{ badge|safe }}). badge_html() uses what the service last said and never calls the service, so it cannot slow a page down. To make it yourself from a site answer, call badge_html(site).

When the badge is on your home page, run python -m onlinewebdirectory_site badge. The service looks for it and says whether it was found.

llms.txt and robots.txt (optional, off by default)

To answer /llms.txt, give the middleware your own text or a list of your public pages:

application = WSGIMiddleware(
    application,
    site_name="My shop",
    site_about="Hand-made candles, posted worldwide.",
    llms_pages=[
        {"title": "Home", "url": "https://YOUR-DOMAIN/"},
        {"title": "Delivery", "url": "https://YOUR-DOMAIN/delivery", "about": "Costs and times."},
    ],
)

or llms_text="..." for your own words. Remove the option to switch it off again. If your site already has a real /llms.txt, leave these options out.

To let named AI bots in, add lines to your own robots.txt:

from onlinewebdirectory_site import Client, robots_bots, robots_lines

print(robots_lines(robots_bots(Client().report())))   # the bots your fix report names
print(robots_lines(["GPTBot", "ClaudeBot"]))          # or bots you choose

This package does not change your files. You add the lines and you can take them out again.

Command line

python -m onlinewebdirectory_site connect YOUR-DOMAIN
python -m onlinewebdirectory_site verify [--platform django]
python -m onlinewebdirectory_site status
python -m onlinewebdirectory_site listing --email you@YOUR-DOMAIN --name "My shop" --about "Hand-made candles, posted worldwide." --kind shop [--contact hello@YOUR-DOMAIN]
python -m onlinewebdirectory_site visits
python -m onlinewebdirectory_site buy monitor --email you@YOUR-DOMAIN
python -m onlinewebdirectory_site buy report --email you@YOUR-DOMAIN
python -m onlinewebdirectory_site report
python -m onlinewebdirectory_site recheck
python -m onlinewebdirectory_site badge
  • status shows pass or fail, the score, the date checked, your listing, what is paid and the prices. After the result it shows what to do next, in the service's own words, with the command or the page for each step.
  • listing needs --email the first time only. Give --name, --about and --kind every time: the listing is saved as you send it. --kind is one of the kinds the service lists. --contact is optional: an email address at your domain or an https page on it.
  • buy prints the address of the payment page. Open it in your browser to pay by card.
  • badge asks the service to look for the badge on your home page, at most once every ten minutes. The followed link from your directory page comes with the verified claim.
  • When the service refuses something, its own words are printed and the command exits with 1.

The same calls are on Client for your own code: site(), listing(), visits(), order(), report(), recheck(), badge_check(). A refusal raises OWDError with the service's words in message and the status in status. When the service answers 401 the key is no longer valid: it is forgotten and you connect again.

External services

This package connects to Online Web Directory (https://onlinewebdirectory.net), which provides the check, the listing and the reports. Nothing is sent until you run connect.

  • When you connect: your site address is sent, and the service reads one proof file from your site (/.well-known/owd-site.txt) to confirm the request came from it. The name of the integration and its version are sent with it.
  • When you run status, visits, report or recheck, and about once an hour while your site runs: the package asks the service for your site's result, listing and counts, and for the list of agents to count.
  • When you run badge: the service reads your home page once to look for the badge.
  • When you save your listing: the name, description, kind of site, contact for agents and the email address you enter are sent.
  • Once an hour: counts of requests from AI agents are sent. Each count holds the agent's name, the page path and the day. No IP address, no visitor data and nothing about people is collected or sent.
  • When you buy something: the email address you enter is sent, and you are given the address of a payment page run by Stripe.

Terms: https://onlinewebdirectory.net/terms Privacy: https://onlinewebdirectory.net/privacy

Questions

Why is my count of AI agents lower than my server logs? Requests answered before your application runs (a CDN, a full-page cache, static files served by the web server) never reach the middleware, so they are not counted. Requests that arrive in the first moments after a process starts, before the list of agents has been read, are not counted either.

Does the badge add a link to my site without asking? No. It appears only where you place it.

Licence

MIT. See LICENSE.

Tests

tests/test_e2e.py runs against a local copy of the service and refuses to run against the live one.

Changelog

1.0.0: first release.

Find us


⭐ Found it useful? Star the repo on GitHub. It takes one click and helps others find it.

Metadata

Release files for onlinewebdirectory-site 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for onlinewebdirectory-site 1.0.1
File Size Uploaded Provenance Actions
onlinewebdirectory_site-1.0.1.tar.gz 22.9 kB Without provenance Details for onlinewebdirectory_site-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for onlinewebdirectory-site 1.0.1
File Interpreter ABI Platform Actions
onlinewebdirectory_site-1.0.1-py3-none-any.whl Python 3 none any Details for onlinewebdirectory_site-1.0.1-py3-none-any.whl

Total release size: 45.6 kB

Release files / onlinewebdirectory_site-1.0.1.tar.gz

Download URL onlinewebdirectory_site-1.0.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3eec5c52366c1bda782be38240b49efb3038d032110fa001845225abf7a401a5
BLAKE2b-256 checksum
How to use checksums
0812c52e70f8eb5779b22f8615b13701096f6b81b7d9f2ce60c2e9f67142c364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / onlinewebdirectory_site-1.0.1-py3-none-any.whl

Download URL onlinewebdirectory_site-1.0.1-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b501dfa33a0ec2072ad88a8f79d42a5472cc62a61b68ae63bcff331d3ad27c3
BLAKE2b-256 checksum
How to use checksums
aebd42aa7143972430aa5be0221a5fa83627618cfb015903da5086624753c8cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for onlinewebdirectory-site 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page