Skip to main content

# Welcome to Anchorman

Latest Version https://travis-ci.org/rebeling/anchorman.svg?branch=master

Turn your text into [hypertext](http://en.wikipedia.org/wiki/Hypertext) and enrich the content. Anchorman finds terms in text and replaces them with another representation.

The replacement is rule-based. Each term is checked against the rules and will be applied if valid.

# How many items will be marked at all in the text. replaces_at_all: 5

# Input term has to be exact match in text. case_sensitive: true

## Features

  • replacement rules

  • consider text units in the rules (e.g. paragraphs)

  • replace only n items of the same item

  • specify restricted_areas for linking by tag: a, img

  • sort elements by value before apply them

  • return applied elements

## Usage

>>> from anchorman import annotate
>>> text = 'The quick brown fox jumps over the lazy dog.'
>>> elements = [{'fox': {'value': '/wiki/fox', 'data-type': 'animal'}}]
>>> print annotate(text, elements)
'The quick brown <a href="/wiki/fox" data-type="animal">fox</a> jumps over the lazy dog.'

## Installation

To install Anchorman, simply:

pip install anchorman

## Credits and contributions

We published this at github and pypi to provide our solution to you. Pleased for feedback and contributions.

Thanks [@tarnacious](https://github.com/tarnacious) for inspiration and first steps.

## Todo

  • check if position exist in input and save extra processing

  • html.parser vs lxml in bs4 - benchmarks and drawbacks

<img src=”https://raw.githubusercontent.com/rebeling/anchorman/master/docs/anchorman.png” width=”200”>

Stay tuned.

Release files for anchorman 0.5.3

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

Source distribution (sdist)

Source distribution for anchorman 0.5.3
File Size Uploaded
anchorman-0.5.3.tar.gz 9.1 kB Details

Release files / anchorman-0.5.3.tar.gz

Download URL anchorman-0.5.3.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
09844b1c8614c6173026d541fb77113178ef87acde37a4edd3f5facb2c0e2dd0
BLAKE2b-256 checksum
How to use checksums
94dec8b5c361684bf827758ef325acf4a83f712a6d824a00660e02f0863f8b65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.5.3 This release

1 release file

0.5.2

1 release file

0.5.0

1 release file

0.4.10

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

0.1.1

1 release file

0.0.9

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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