Skip to main content

A python wrapper for the Vale CLI tool.

Project description

Vale CLI Python Wrapper

Vale is an open-source, command-line tool for validating content based on editorial style rules. This package acts as a basic wrapper to pass text to Vale and return styles rules that you can use in your Python projects.

Installation

NOTE: This package only acts as a wrapper for using Vale and does not install Vale. Make sure you install and configure Vale before using this package.

Add vale-cli package as a dependency in your requirements.txt file:

vale-cli

Usage

Example usage:

import vale_cli.vale_config as vale_config

release_note = "An error with the WhizBang API caused incorrect processing of data, which stopped you from using certain routes in the API. This fix corrects the logic around data processing. You can now process data without errors."
vale = vale_config.ValeConfig("/path/to/.vale.ini")
output = vale.check_text(release_note, ext='.adoc')
print(output)

Output:

[{'Action': {'Name': '', 'Params': None}, 'Span': [19, 26], 'Check': 'RedHat.PascalCamelCase', 'Description': '', 'Link': 'https://redhat-documentation.github.io/asciidoc-markup-conventions', 'Message': "Consider wrapping this Pascal or Camel case term ('WhizBang') in backticks.", 'Severity': 'suggestion', 'Match': 'WhizBang', 'Line': 1}, {'Action': {'Name': 'replace', 'Params': ['wrong']}, 'Span': [39, 47], 'Check': 'RedHat.SimpleWords', 'Description': '', 'Link': 'https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/simplewords/', 'Message': "Use simple language. Consider using 'wrong' rather than 'incorrect'.", 'Severity': 'suggestion', 'Match': 'incorrect', 'Line': 1}]

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

vale_cli-0.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

vale_cli-0.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file vale_cli-0.2.tar.gz.

File metadata

  • Download URL: vale_cli-0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.12.4

File hashes

Hashes for vale_cli-0.2.tar.gz
Algorithm Hash digest
SHA256 b39cf5b8a96e78762b7601b3a5eb88b57e0e3bf0a13bb984633fa75d4d31d488
MD5 ae603f2ca22ec6611f8358e09027a0ee
BLAKE2b-256 bab4f49039b3c3ff2872c85a1688f3d18876e6277ed68edd51abce90f12f0ac5

See more details on using hashes here.

File details

Details for the file vale_cli-0.2-py3-none-any.whl.

File metadata

  • Download URL: vale_cli-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.12.4

File hashes

Hashes for vale_cli-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d68088b2cbb7d76274003dbbc82a87ecfe58f13f5f7118f863cebf98afe52c
MD5 243e2c1cd8b6e3544fe233a88a4a56f9
BLAKE2b-256 7092e960974de5b2433626917e2ec3fee2fbb10863e317868cc396a7f701df3d

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