Skip to main content

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

Reason this release was yanked:

Project name on pypi was updated to just 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.4.tar.gz (68.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.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: carbon_txt_validator-0.0.4.tar.gz
  • Upload date:
  • Size: 68.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.4.tar.gz
Algorithm Hash digest
SHA256 a14d2375ee20a4797cbfca4cc21ee31ef265c6ddc44d389c835821b4a50c8e27
MD5 06044e03caae0b7f6999a4c031397616
BLAKE2b-256 01054d7bfe4ea0bf162a0d54eae4166bd6a0c20fe5c2a199bc83e172fc54087f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for carbon_txt_validator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 249493854b2741883ca7f1536f1de363b983c35a5973456972f2ed6b619b6c32
MD5 2f74a1b5516201ab67b88c93988f10a9
BLAKE2b-256 69d9935337677b8e1db42d040803163533e81172d4ff4ce9a1473f98b7e495f3

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