Skip to main content

A validator for carbon.txt files, by the Green Web Foundation

Reason this release was yanked:

this project is available at "carbon-txt"

Project description

Carbon.txt validator

This validator reads carbon.txt files, and validates them against a spec defined on http://carbontxt.org.

Usage

With the CLI

Run a validation against a given domain, or file, say if the file is valid TOML, and it confirms to the carbon.txt spec.

The following commands assume you are working in a virtual environment:

# parse the carbon.txt file on default paths on some-domain.com
carbon-txt validate domain some-domain.com

# parse a remote file available at https://somedomain.com/path-to-carbon.txt
carbon-txt validate file https://somedomain.com/path-to-carbon.txt

# parse a local file ./path-to-file.com
carbon-txt validate file ./path-to-file.com

# pipe the contents of a file into the file validation command as part of a pipeline
cat ./path-to-file.com | carbontxt validate file

Using UV

If you are not using virtual environments directly, you can use it with uv, which is the recommended way to run the project.

Add carbon-txt-validator to a project with uv add:

uv add carbon-txt-validator

You can now run the command line tool with uv run carbon-txt

Running outside a project

If you have uv installed, you can run the command line tool using the slightly longer carbon-txt-validator command instead (we need a cli command that shares the name of the project).

This will download the latest published version from pypi and run the cli:

uv tool run carbon-txt-validator validate ./path/to/file

With the HTTP API

You can also validate carbon.txt files sent over an HTTP API.

# run the carbon-txt validator as a server using the default django server. Not for production
carbon-txt serve

For production, Granian, a performant webserver is bundled. Pass the flag --server granian to use it.

# run the carbon-txt validator as a server using the production granian server
carbon-txt serve --server granian

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carbon_txt_validator-0.0.3.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carbon_txt_validator-0.0.3-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file carbon_txt_validator-0.0.3.tar.gz.

File metadata

  • Download URL: carbon_txt_validator-0.0.3.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0rc2

File hashes

Hashes for carbon_txt_validator-0.0.3.tar.gz
Algorithm Hash digest
SHA256 13acd9a215e207aff44288aef6668771af3ae5957ed6a05f785bc9e6862627dd
MD5 8cbf3049763955f7b7fc887268e49b94
BLAKE2b-256 f086350e683972bfe460643ce42a16bd5b19d04e48df3dd8378146a580ec3a98

See more details on using hashes here.

File details

Details for the file carbon_txt_validator-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for carbon_txt_validator-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0c018876880404379132accbc177ecd0e1393827e519312a0ddedd61ae0f5f6
MD5 1c3bc76dab39bebcfd6993123bdf7c39
BLAKE2b-256 4388efa9c94793ac4da30dc7c03437844f743cee720df57aa50a955a6ef443ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page