Skip to main content

atomd

Version 0.2.5

A markdown lexer and parser which gives the developer atomic control over markdown parsing to html.

Atomd first tokenizes the markdown with the lexer.

Using the tokenized markdown, parsers for various different markup languages (HTML, XML, etc) are easier to implement, since it more or less becomes a game of find and replace.

Install

python3 -m pip install atomd

Usage

Functions in atomd.py called md2<target_language>() combine the lexer and parser to provide an easier calling convention.

In the case of the HTML parser, this is md2html().

If you want to parse a markdown file, do the following:

from atomd import md2html

html = md2html(filename="path/to/myfile.md").decode('utf-8')

If you want to parse a string of markdown, do the following:

from atomd import md2html

html = md2html(md=b"# My markdown ByteString!").decode('utf-8')

Lexer

This portion of the program tokenizes the markdown based on the lexicon, which is a mapping of markdown syntax items to tokens that will represent the specific syntax.

Tokenization is done with a series of regular expressions.

If there are bugs in the program, it is likely they exist in the regular expressions and can be fixed without significant design changes to the program, which allows for quick turnaround on bugfixes.

Parsers

Currently, atomd supports the following:

  • HTML (html.py)

Release files for atomd 0.2.5

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

Source distribution (sdist)

Source distribution for atomd 0.2.5
File Size Uploaded
atomd-0.2.5.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atomd 0.2.5
File Interpreter ABI Platform
atomd-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 kB

Release files / atomd-0.2.5.tar.gz

Download URL atomd-0.2.5.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8ddbd1f6a9426ab85c263c2a958ba497b04f0fe96cad87231ae5cf31ea9a60c3
BLAKE2b-256 checksum
How to use checksums
fad6be6d519f6ba9491369fa7418e7200ffaae915836e0b129e454c6d5491702
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5

Release files / atomd-0.2.5-py3-none-any.whl

Download URL atomd-0.2.5-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf5e339b953cebb237369e96efa8861479306e8849b70cec10d88be0dbd596d3
BLAKE2b-256 checksum
How to use checksums
15575f7589dba8fdfe2b5fb48763961c71b6986d7d29d52dc76ba987341f5920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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