Skip to main content

Merge and lookup acronyms from a directory tree of definitions.

Project description

FOAL

PyPI version

FOAL (From Organization Acronyms Lookup) is a tool to lookup acronyms from a set of YAML files.

Given multiple YAML files that define acronyms and abbreviations, merge the dictionaries in a contextually-sensitive order and lookup acronyms.

What

Define acronyms and abbreviations in context-aware files, then merge and lookup definitions with the ability to prioritize the context.

For example, given these files:

# technology.yaml

acronyms:
    cpu:
        shortform: CPU
        longform: Central Processing Unit

    eps:
        shortform: EPS
        longform: Encapsulated Postscript
# finance.yaml

acronyms:
    cogs:
        shortform: COGS
        longform: Cost of Goods Sold

    cpu:
        shortform: CPU
        longform: Cost per Unit

    eps:
        shortform: EPS
        longform: Earnings per Share

Get a dictionary that prefers the technology context:

$ foal -p technology.yaml
[WARNING] prefer context: ['technology.yaml']
---
acronyms:
    cogs:
        shortform: COGS
        longform: Cost of Goods Sold
        source: finance.yaml
    cpu:
        shortform: CPU
        longform: Central Processing Unit
        source: technology.yaml
    eps:
        shortform: EPS
        longform: Encapsulated Postscript
        source: technology.yaml

Get a dictionary that prefers the finance context:

$ foal -p finance.yaml
[WARNING] prefer context: ['finance.yaml']
---
acronyms:
    cogs:
        shortform: COGS
        longform: Cost of Goods Sold
        source: finance.yaml
    cpu:
        shortform: CPU
        longform: Cost per Unit
        source: finance.yaml
    eps:
        shortform: EPS
        longform: Earnings per Share
        source: finance.yaml

Lookup specific acronyms that prefer the technology context:

$ foal -p technology.yaml -a cpu
[WARNING] prefer context: ['technology.yaml']
---
acronyms:
    cpu:
        shortform: CPU
        longform: Cost per Unit
        source: technology.yaml

Why

It is sometimes necessary to lookup acronyms from a canonical list to use in documentation. The acronyms (or abbreviations) can then be used in automated documentation tools via something like pandoc-acronyms.

Acronyms form a vocabulary that people use within their own frame of reference. The general acceptance of acronyms dependends on multiple factors, such as political landscape, technical expertise, regional differences, context, and native tongue.

For example, most people around the world recognize the United States of America as the USA, the United Kingdom as the UK, and Germany as the BRD (Bundesrepublik Deutschland). English speakers are more likely to recognize BRD when it is used in the context of Olympic competition or an international news broadcast than when BRD appears randomly in a document.

Take another example, CPU.

  • People in Information Technology (IT) immediately think of Central Processing Unit.

  • People in finance are likely to think of Cost per Unit, especially when CPU is used in a financial context.

Taken out of context, abbreviations are difficult to interpret and can lead to misunderstanding in important documents.

About the data structure

  • global.yaml within a directory tree is authoritative.
    Acronyms and abbreviations within global.yaml override acronyms from other files. This is a global context reserved for acronyms that should have universal meaning across an organization. Names of products, BUs, and teams are all good choices for global.yaml.

  • This format does not dictate the hierarchy of acronyms from other files in the git repo. Only global.yaml has special priority. Tool developers and authors may choose to incorporate the other files in whatever priority makes sense in a given context.

  • The definition of "context" for files within a directory tree is left up to individual contributors (other than global.yaml). Be inclusive. TimTowtdi.

A formal Kwalify schema for the format is in schema/acronyms.yaml.

Installation

From PyPI

pip install --user foal

From source

pip install --user .

Development

Run:

sdlc/bootstrap
sdlc/build
sdlc/test

Please see CONTRIBUTING.md and TESTING.md.

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

foal-0.0.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

foal-0.0.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file foal-0.0.2.tar.gz.

File metadata

  • Download URL: foal-0.0.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for foal-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c1f98a8d7a03d064f7062b5ba478a4af0316fb756ee9a5d76714b8567c189662
MD5 f4cd9e3ae6c9e4258a7d4de904931c78
BLAKE2b-256 56ce82c379addb3dcb9747c2ba1660791f5167f169b8b3409b86df55da6481fc

See more details on using hashes here.

File details

Details for the file foal-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: foal-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for foal-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9c6b28507acaf4f1693d762642268e51fde4cb6c990f1f4958dc462500da50
MD5 8f59783deebfca8ad2af5ea431d00da2
BLAKE2b-256 3f65fe26aeff0ca280e1d5c8e3b983596cc68b73351cb6b49ca9a4dfaa69a82d

See more details on using hashes here.

Supported by

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