How I load Markdown in Python

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • python-frontmatter

    Parse and manage posts with YAML (or other) frontmatter

  • ❯ inspect(frontmatter.load("pages/til/python-frontmatter.md")) ╭────────────────────────────────────────────────────────── ───────────────────────────────────────────────────────────╮ │ A post contains content and metadata from Front Matter. This is what gets │ │ returned by :py:func:`load ` and :py:func:`loads `. │ │ Passing this to :py:func:`dump ` or :py:func:`dumps ` │ │ will turn it back into text. │ │ │ │ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ │ │ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │ │ │ │ content = "I use a package\n[eyeseast/python-frontmatter](https://github.com/eyeseast/python-frontmatter)\nto load files with frontmatter in │ │ them. Its a handy package that allows you to\nload files with structured frontmatter (yaml, json, or toml).\n\n## Install\n\nIt's │ │ on pypi, so you can install it into your virtual environment with pip.\n\n``` {% endraw %} bash\npython -m pip install │ │ python-frontmatter\n {% raw %} ```\n\n## 🙋 What's Frontmatter\n\nFrontmatter is a handy way to add metadata to your plain text files. │ │ It's\nquite common to have yaml frontmatter in markdown. All of my blog posts have\nyaml frontmatter to give the post metadata such │ │ as post date, tags, title, and\ntemplate. dev.to is a popular developer blogging platform that also builds all\nof its posts with │ │ markdown and yaml frontmatter.\n\n## Let's see an example\n\nHere is the exact frontmatter for this post you are reading on my │ │ site.\n\n``` {% endraw %} markdown\n---\ndate: 2022-03-24 03:18:48.631729\ntemplateKey: til\ntitle: How I load Markdown in Python\ntags:\n - │ │ linux\n - python\n\n---\n\nThis is where the markdown content for the post goes.\n {% raw %} ```\n\n## So it's yaml\n\nyaml is the most │ │ commmon, but\n[eyeseast/python-frontmatter](https://github.com/eyeseast/python-frontmatter)\nalso │ │ supports\n[Handlers](https://python-frontmatter.readthedocs.io/en/latest/handlers.html?highlight=toml#module-frontmatter.default_ha… │ │ toml and json.\n\nIf you want a good set of examples of yaml\n[learnxinyminutes](https://learnxinyminutes.com/docs/yaml/) has a │ │ fantastic set\nof examples in one page.\n\n## How to load yaml frontmatter in python" │ │ handler = │ │ metadata = { │ │ 'date': datetime.datetime(2022, 3, 24, 3, 18, 48, 631729), │ │ 'templateKey': 'til', │ │ 'title': 'How I load Markdown in Python', │ │ 'tags': ['linux', 'python', 'python'] │ │ } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

  • rich

    Rich is a Python library for rich text and beautiful formatting in the terminal.

  • We can use rich to inspect the Post object to see what all it contains.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Rich is a Python library for rich text and beautiful formatting in the terminal

    1 project | news.ycombinator.com | 14 Mar 2024
  • Neat Parallel Output in Python

    3 projects | news.ycombinator.com | 25 Feb 2024
  • colors.crumb - first Crumb usable. Extending Crumb with basic terminal styling and RGB, HEX, ANSI conversion functions.

    3 projects | /r/lisp | 9 Sep 2023
  • Rails is the Best web framework I have ever worked with. Rails is ❤️❤️❤️.

    3 projects | /r/rails | 13 May 2023
  • Python's Missing Batteries: Essential Libraries You're Missing Out On

    1 project | news.ycombinator.com | 9 May 2023