Skip to main content

Markdown Site Utils

Some utilities for managing Markdown files with metadata.

The notion is that a content-oriented website may be written as a hierarchical series of Markdown files (with an ".md" extension) underneath some data directory, e.g.:

DATA_DIR/
  index.md
  foo.md
  bar.md
  subdir/
    index.md
    foo.md
    bar.md

Each file may contain metadata, written in TOML in a section at the top, bounded by '+++' lines:

+++
title = "My Page Title"
+++

# Some Markdown

YAML and JSON may also be used. YAML blocks should start and end with lines consisting of three dashes; JSON blocks should consist of a single JSON object with opening and closing braces on lines by themselves. The data block is optional but if present must begin on the first line of the file.

To use the library, you get create an mdsite.DB object with the path to your data directory:

mydb = mdsite.DB("/path/to/data/dir")

Then call get_data(path) for the path into the directory you want, leaving out the .md filename suffix, and, if you are looking for an index file, leaving out index.md:

data = mydb.get_data("/node/leaf")

The above gets data for $DATA_DIR/node/leaf.md, or for $DATA_DIR/node/leaf/index.md, if that file exists instead.

The library also supports hierarchical configuration, also written in TOML, YAML, or JSON, stored in files called config.{toml,yaml,json} depending on the config language employed.

Metadata

Release files for markdown-site-utils 0.2.2

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

Source distribution (sdist)

Source distribution for markdown-site-utils 0.2.2
File Size Uploaded Provenance
markdown_site_utils-0.2.2.tar.gz 6.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-site-utils 0.2.2
File Interpreter ABI Platform
markdown_site_utils-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / markdown_site_utils-0.2.2.tar.gz

Download URL markdown_site_utils-0.2.2.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3ed4f5e337432e91b28b072697424966be60aaca161fc8a3bf345543529c5664
BLAKE2b-256 checksum
How to use checksums
f9ad4bec952e4d52f491310adf449719d43a817853b513d659bd6f072c228b1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Darwin/21.6.0

Release files / markdown_site_utils-0.2.2-py3-none-any.whl

Download URL markdown_site_utils-0.2.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd810471405410c94515e1b93fd54e8b96cb9c3e064f47f91d681810f6db9b4b
BLAKE2b-256 checksum
How to use checksums
4fcb6796f9b135e8872a7775ae7a4b5ecd6da4105a3b5be68a7ae2dced27ef89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.1 Darwin/21.6.0

Security for markdown-site-utils 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files No provenance

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