Saravanan666/pypi-org huggingface dataset:
Package: markdown-frames
Markdown FramesHelper package for testing Apache Spark and Pandas DataFrames.
It makes your data-related unit tests more readable.HistoryWhile working atExacasterVaidas Armonascame up with the idea to make testing data more representable. And with the help of his team, he implemented the initial version of this package.Before that, we had to define our testing data as follows:schema=["user_id","even_type","item_id","event_time","country","dt"]input_df=spark.createDataFrame([(123456,'page_view',None,datetime(2017,12,31,23,50,50),"uk","2017-12-31"),(123456,'item_view',68471513,datetime(2017,12,31,23,50,55),"uk","2017-12-31")],schema)And with this library you can define same data like this:input_data="""|  user_id   |  even_type  | item_id  |    event_time       | country  |     dt      ||   bigint   |   string    |  bigint  |    timestamp        |  string  |   string    || ---------- | ----------- | -------- | ------------------- | -------- | ----------- ||   123456   |  page_view  |   None   | 2017-12-31 23:50:50 |   uk     | 2017-12-31  ||   123456   |  item_view  | 68471513 | 2017-12-31 23:50:55 |   uk     | 2017-12-31  |"""input_df=spark_df(input_data,spark)InstallationTo install this package, run this command on your python environment:pipinstallmarkdown_frames[pyspark]UsageWhen you have this package installed, you can use it in your unit tests as follows (assuming you are usingpytest-sparkang have Spark Session available):frompyspark.sqlimportSparkSessionfrommarkdown_frames.spark_dataframeimportspark_dfdeftest_your_use_case(spark:SpakSession):->Noneexpected_data="""| column1 | column2 | column3 | column4 ||   int   |  string |  float  |  bigint || ------- | ------- | ------- | ------- ||   1     |   user1 |   3.14  |  111111 ||   2     |   None  |   1.618 |  222222 ||   3     |   ''    |   2.718 |  333333 |"""expected_df=spark_df(expected_data,spark)actaual_df=your_use_case(spark)assertexpected_df.collect())==actaual_df.collect())Supported data typesThis package supports all major datatypes, use these type names in your table definitions:intbigintfloatdoublestringbooleandatetimestampdecimal(precision,scale)(scale and precision must be integers)array<int>(int can be replaced by  any of mentioned types)map<string,int>(string and int can be replaced by any of mentioned types)Fornullvalues useNonekeyword.LicenseThis project isMITlicensed.
Package: markdown-full-yaml-metadata
YAML metadata extension forPython-MarkdownThis extension adds YAML meta data handling to markdown with all YAML features.As in the original, metadata is parsed but not used in processing.Metadata parsed as is by PyYaml and without additional transformations, so this plugin is not compatible with originalMeta-Data extension.Basic Usageimportmarkdowntext="""---title: What is Lorem Ipsum?categories:- Lorem Ipsum- Stupid content...Lorem Ipsum is simply dummy text."""md=markdown.Markdown(extensions=['full_yaml_metadata']})md.convert(text)=='<p>Lorem Ipsum is simply dummy text.</p>'md.Meta=={'title':'What is Lorem Ipsum?','categories':['Lorem Ipsum','Stupid content']}Specify a custom YAML loaderBy default the full YAML loader is used for parsing, which is insecure when
used with untrusted user data. In such cases, you may want to specify a
different loader such asyaml.SafeLoaderusing
theextension_configskeyword argument:importmarkdownimportyamlmd=markdown.Markdown(extensions=['full_yaml_metadata']},extension_configs={"full_yaml_metadata":{"yaml_loader":yaml.SafeLoader,},},)Development and contributionFirst of all you should installPoetry.install project dependenciesmakeinstallrun lintersmakelintrun testsmaketestfeel free to contribute!
Package: markdown-gettext
markdown-gettextA command line program to do i18n and l10n for individual Markdown files.CommonMark compliant. All core Markdown elements are supported, as well as
YAML front matter, table, and definition list.Installpipinstallmarkdown-gettextUsageYou can use eithermd-gettextormarkdown-gettextcommandExtractionmd-gettext extract [-p PACKAGE] [-r REPORT_ADDR] [-t TEAM_ADDR] md pot

positional arguments:
  md                    path of the Markdown file to extract messages from
  pot                   path of the POT file to create

optional arguments:
  -p PACKAGE, --package PACKAGE
                        the package name in POT metadata
  -r REPORT_ADDR, --report-addr REPORT_ADDR
                        the report address in POT metadata
  -t TEAM_ADDR, --team-addr TEAM_ADDR
                        the team address in POT metadataGenerationmd-gettext generate [-l LANG] in-md po out-md

positional arguments:
  in-md                 path of the source Markdown file
  po                    path of the PO file containing translations
  out-md                path of the Markdown file to create

optional arguments:
  -l LANG, --lang LANG  language of translationsNotesSome notes about how different elements are handled:Inlines: hard line breaks are replaced with<br />, newlines and
consecutive spaces are not kept;Content of each HTML block isn't parsed into finer tokens but processed
as a whole;Development environmentWith Condacondaenvcreate-fenvironment.yml
condaactivatemg
poetryinstall
Package: markdown-gfm-admonition
markdown-gfm-admonitionThis package is an extension ofPython Markdownthat enables
theadmonition syntax of GitHub Flavored Markdown.There are five types of admonitions:>[!NOTE]>Highlights information that users should take into account,>even when skimming.>[!TIP]>Optional information to help a user be more successful.>[!IMPORTANT]>Crucial information necessary for users to succeed.>[!WARNING]>Critical content demanding immediate user attention due to potential risks.>[!CAUTION]>Negative potential consequences of an action.It generates the same HTML asPython Markdown's built-in admonition
extension:<divclass="admonition note"><pclass="admonition-title">Note</p><p>Highlights information that users should take into account,
even when skimming.</p></div>
Package: markdown-grids
Markdown grid table extensionAPython-Markdownextension to render grid tables.Example:+-------------------+------------------+----------------+
| Header 1          | Header 2         | Header 3       |
+===================+==================+================+
| Cells can span multiple columns      | Cells can span |
+--------------------------------------+ multiple rows  |
| Text in cells *can be* **formatted** |                |
|                                      |                |
| > and can contain arbitrary          |                |
| > multi-line blocks                  |                |
+--------------------------------------+----------------+Installationpip install markdown-gridsUsageimportmarkdowntext=...# your Markdown sourcehtml=markdown.markdown(text,extensions='grids')To use withMkDocs, add the following tomkdocs.yml:markdown_extensions:-gridsBecause whitespace in a grid table is structural, it is not possible to indicate a newline in a
cell with two spaces at the end of the line.
Two possible solutions to this are:TheNew-Line-to-Break extensionTheMarkdown line block extensionLicencemarkdown-gridsis distributed under the terms of theMITlicence.
Package: markdown-headdown
Headdown: Downgrade HeadingsAutomatically demote those pesky headings!What?This is a plugin forPython-Markdownto automatically downgrade headings by a given number of levels. This is useful when, for example, using a static site generator, such asPelican.Why?I didn't want to have to write standalone markdown files whose structure was dictated by the constraints of my website; nor did I want to sacrifice the structure of my website because of my markdown files. A number of3rd party Python-Markdown extensionsalready exist to do this (hereandhere), but I was unable to get them to work with Python-Markdown 3.How?Just addmdx_headdownto yourmarkdownextensionsand feel the magic.You can optionally provide anoffsetparameter, which tellsheaddownby how many levels to downgrade all headings. The default is1.Note
: This value will be converted to an integer and absolutised. Failure to provide a numeric option may lead to unexpected results.For example, if using withPelican, yourconfigurationmight look something like this:...MARKDOWN={'extensions':['mdx_headdown',],'extension_configs':{'mdx_headdown':{'offset':2,},},}...CreditThanks are owed to the author ofmdx_downheader, whose code I examined for inspiration; and the contributers to thedefault python-markdown extensions, whose code I examined to get a better idea of what themanualwas talking about.This project is copyright 2018 by Sascha Cowley under theMIT License.
Package: markdown-helper
python-markdown-helperA bunch of helper classes that make generating markdown files easier.Originally written to make my own life easier. I got tired of writing repetitive code to generate markdown files for my projects.Table of ContentsInstallationUsageUpcoming FeaturesContributingLicenseInstallationpipinstallmarkdown-helperUsageSample code that generated theEXAMPLE.mdfileimportmarkdown_helperasmdh# Create a new markdown Document that includes a table of contentsdoc=mdh.Document("Title","EXAMPLE.md",overwrite=True,table_of_contents=True)# Add a new section to the documentfirst_section=doc.add_section("Section 1")# Add some text to the sectionfirst_section.add("Regular text in the first section")# Add a list to the sectionlist_of_fruits=mdh.List(["Apple","Banana","Orange"],ordered=True,title="Fruit List")first_section.add(list_of_fruits)# Make a new Table with custom value mappingtable=mdh.Table(["Fruit","Color"],sort_key="Fruit",title="Fruit Table",custom_map={"Fruit":{"Apple":"🍎","Banana":"🍌"}})# Add some rows to the tabletable.add_row({"Fruit":"Apple","Color":"Red"})table.add_row({"Fruit":"Banana","Color":"Yellow"})# Add the table to the documentfirst_section.add(table)# Add a new section to the document with Smaller titlesecond_section=mdh.Section(mdh.Header("Section 2",2))doc.add_section(second_section)second_section.add("Regular text in the second section")# Add a link and an image to the sectionlink=mdh.Link("https://google.com","Google")second_section.add(link)image=mdh.Image("https://picsum.photos/200",alt="A random image")second_section.add(image)# Output the document to as a stringprint(doc)# Save the document to a filedoc.save()Upcoming FeaturesAdd support for code blocks???ContributingFeel free to open a pull request or an issue if you have any suggestions or find any bugsLicenseThis project is licensed under the MIT License - see theLICENSEfile for details
Package: markdown-html-finder
markdown-html-finderA Python library to locate HTML spans in markdown text. This library is written in Rust with bindings for Python.why?For aseparate projectI needed to locate HTML comments in markdown documents. Sadly the markdown parsers I found for Python didn't provide span information for nodes.While it wouldn't be too hard to add some features to existing Python markdown parsers, I thought it would be interesting to see how Rust can be used from Python. The excellentpulldown-cmarkcrate provides span information for HTML elements, so that's what we use here.pyo3andmaturindo the hard work of providing bindings to Python and building wheels to distribute on PyPi.install# poetrypoetryaddmarkdown-html-finder# pippipinstallmarkdown-html-finderusagefrommarkdown_html_finderimportfind_html_positionsDOCUMENT="""\# example markdown documentAmet nobis et numquam qui. Animi perferendis quia qui ut aut expedita. Ut eveniet quia quaerat.<!-- hello world -->Quisquam et et velit soluta quia."""# NOTE: find_html_positions raises a ValueError if passed carriage returns `\r`stripped_document=DOCUMENT.replace('\r','')html_positions=find_html_positions(stripped_document)asserthtml_positions==[(125,145)]dev# install build dependenciespoetryinstall# build for python developmentpoetryrunmaturindevelopmentbuilding wheelsWe need a wheel per version and platform. To support Python 3.7, 3.8, 3.9 we need to have 3.7, 3.8, 3.9 installed on macOS and Linux. For macOS we can use pyenv. For Linux we can use a Docker container.macosinstall pyenvinstall each python version we want to support viapyenv install. Usepyenv install --listto see the available options.add your new Python installs globally viapyenv global 3.8.7 3.9.0configure your $PATH with the .pyenv python versions. usepyenv shimsto find the binary paths and add them, likePATH=/Users/chris/.pyenv/shims/:$PATHverify your Python versions are accessible viapython3.9and verify maturin can find your python versions via./.venv/bin/maturin list-pythonbuild the macOS wheels via./.venv/bin/maturin buildupload wheels to pypi via./.venv/bin/twine upload --skip-existing target/wheels/*linuxuse the docker container to build all the Linux Python wheels viadocker run --rm -v $(pwd):/io cdignam/markdown-html-finder-builder:0.3.0 build --releaseupload wheels to pypi via./.venv/bin/twine upload --skip-existing target/wheels/*markdown-html-finder-builderThis container extends thequay.io/pypa/manylinux2014_x86_64docker image and is based on thekonstin2/maturinimage, with Python2 support removed.This image is built and uploaded manually to Docker Hub when necessary.# build and publish a new versionVERSION='0.2.0'dockerbuild-fbuild.Dockerfile.--tagcdignam/markdown-html-finder-builder:$VERSIONdockerpushcdignam/markdown-html-finder-builder:$VERSION
Package: markdown-iconfonts
markdown-icons (iconfonts.py)Easily display icon fonts in python markdown. Just add the CSS necessary for your font and add this extension.This is a 3rd party extension forPython Markdown. You can see afull list of 3rd party extensions here.Although this works with any icon font, users can use amodsyntax to add more prefixed classes to supportFont Awesomeand its special classes such as2x, 3x, muted, spin, etcFurthermore, users can add their ownuser_modsyntax to add additional, non-prefixed, pre-defined classes for greater control over their icons while allowing you to control exactly what styles are allowed.You can create your own Icon Fonts using the IcoMoon app:http://icomoon.io/app/A great pre-made Icon Font isFont Awesome (GitHub Project)See thepython markdown documentationfor more information.Use it in any personal or commercial project you want.Syntax:Accepts a-z, A-Z, 0-9, _(underscore), and - (hypen)UsesHTML Entitylike syntax:&entity_name;&icon-html5;
&icon-css3;
&icon-my-icon;Mod syntax:&icon-html5:2x;
&icon-quote:3x,muted;
&icon-spinner:large,spin;User mod syntax:&icon-html5::red;
&icon-quote:2x:bold;Example Markdown:I love &icon-html5; and &icon-css3;
&icon-spinner:large,spin; Sorry we have to load...Output:I love <i aria-hidden="true" class="icon-html5"></i> and <i aria-hidden="true" class="icon-css3"></i>
<i aria-hidden="true" class="icon-spinner icon-large icon-spin"></i> Sorry we have to load...Installation:pipinstallmarkdown-iconfontsUsage / Setup:Default Prefix is "icon-":importmarkdownmd=markdown.Markdown(extensions=['iconfonts'])orimportmarkdownfromiconfontsimportIconFontsExtensionmd=markdown.Markdown(extensions=[IconFontsExtension()])Thebaseoption allows for use of Bootstrap 3 and FontAwesome 4 iconsmd=markdown.Markdown(extensions=['iconfonts'],extension_configs={"base":"icon"})converted_text=md.convert(text)Input:&icon-html5;Output:<i aria-hidden="true" class="icon icon-html5"></i>prefix_base_pairsoptionTheprefix_base_pairsoption allows for multiple prefix-base pairs to be specified, to allow you to support both Bootstrap 3/Glyphicon and FontAwesome iconsmd = markdown.Markdown(extensions=['iconfonts'],
                       extension_configs={
                           'iconfonts': {
                               'prefix_base_pairs': {
                                   'fa-': 'fa',
                                   'glyphicon-': 'glyphicon',
                               }
                           }
                       })
converted_text = md.convert(text)Input:&glyphicon-remove; &fa-html5;Output:<i aria-hidden="true" class="glyphicon glyphicon-remove"></i><i aria-hidden="true" class="fa fa-html5"></i>How to run the unit testsInstallMarkdown:pip install markdownInstall markdown icons. Copy theiconfonts.pyfile intosite-packages/markdown/extensions/Navigate to the test directory in CMD/terminal and runpython unit-tests.py -v
Package: markdownify-notion
markdownify-notionA small package to markdownify notion blocks.InstallationInstall this library usingpip:$ pip install markdownify-notionUsageUsage instructions go here.DevelopmentTo contribute to this library, first checkout the code. Then create a new virtual environment:cd markdownify-notion
python -m venv venv
source venv/bin/activateOr if you are usingpipenv:pipenv shellNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: markdown-image-caption
Markdown Image caption.Inspired by the probably un-maintained packagemdx_figcapUsage:Make sure you havemarkdowninstalled.Define an image with caption in your markdown.![alttext](http://example.com/image.png "caption")This will be converted to:<spanclass="img_container center"style="display: inline-block;"><imgalt="test"src="http://example.com/image.png"style="display:block; margin-left: auto; margin-right: auto;"title="caption"/><spanclass="img_caption"style="display: block; text-align: center;">caption</span></span>Why no figure tag implementation ?The figure tag is a block level element. The image element is an inline element. This difference breaks the attribute extension.
So![alttext](http://example.com/image.png "caption"){: .center}would not work if a figure was used.Installationpipinstallmarkdown-image-captionadd the plugin to your markdownimportmarkdownparser=markdown.Markdown(extensions=["markdown_image_caption.plugin"])
Package: markdown-image-replacer
python-mmarkdown_image_replacer\$HOME/blog/content/posts/my-first-post.md\--src_img_root$HOME/blog/static\--dst_md_file$HOME/blog/content/posts/my-first-post2.md\--dst_img_root$HOME/blog/static\--dst_img_rel_dirimages/my-first-post
Package: markdown-inline-graphviz
A Python Markdown extension that replaces inline Graphviz definitions with
inline SVGs or PNGs!Why render the graphs inline? No configuration! Works with any
Python-Markdown-based static site generator, such asMkDocs,Pelican, andNikolaout of the box without configuring an output
directory.Installation$ pip install markdown-inline-graphvizUsageActivate theinline_graphvizextension. For example, with Mkdocs, you add a
stanza to mkdocs.yml:markdown_extensions:
    - inline_graphvizTo use it in your Markdown doc:{% dot attack_plan.svg
    digraph G {
        rankdir=LR
        Earth [peripheries=2]
        Mars
        Earth -> Mars
    }
%}Supported graphviz commands: dot, neato, fdp, sfdp, twopi, circo.CreditsInspired byjawher/markdown-dot,
which renders the dot graph to a file instead of inline.LicenseMIT License
Package: markdownio
MarkdownIOPython tool to write Markdown as code easily.Installation$pipinstallmarkdownioUsagefrommarkdownioimportMarkdownIO,spanfrommarkdownio.blockimportTableHeadermarkdown=MarkdownIO()markdown.h1("My test document")markdown.p(text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. ""Vivamus rutrum consequat "+span.bold("odio")+" et mollis.")markdown.p(span.image(path="path/img.jpg",alt="img",title="img"))markdown.table(columns=3,headers=['Col1','Col2',TableHeader.center('Col3')],rows=[['foo','bar','foobar'],['oof','rab',2000],])markdown.p(text="This is an interesting article: "+span.link(path='http://test.io'))markdown.h2("Code example")markdown.code(text='<p>Test</p>',language='html')print(markdown.output())output:# My test documentLorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus rutrum consequat**odio**et mollis. p
![img](path/img.jpg "img")

| Col1 | Col2 | Col3   |
| ---- | ---- | :----: |
| foo  | bar  | foobar |
| oof  | rab  | 2000   |

This is an interesting article: <http://test.io>## Code example```html<p>Test</p>```Merge two documentsfrommarkdownioimportMarkdownIOdocument1=MarkdownIO()document1.p("Part 1.")document2=MarkdownIO()document2.p("Part 2.")full_document=document1+document2print(full_document.output())output:Part 1.

Part 2.DocumentationBlock elementsSpan elements
Package: markdown-it-py
markdown-it-pyMarkdown parser done right.Follows theCommonMark specfor baseline parsingConfigurable syntax: you can add new rules and even replace existing ones.Pluggable: Adds syntax extensions to extend the parser (see theplugin list).High speed (see ourbenchmarking tests)Safe by defaultMember ofGoogle's Assured Open Source SoftwareThis is a Python port ofmarkdown-it, and some of its associated plugins.
For more details see:https://markdown-it-py.readthedocs.io.For details onmarkdown-ititself, see:TheLive demoThe markdown-it READMEInstallationcondainstall-cconda-forgemarkdown-it-pyorpipinstallmarkdown-it-py[plugins]or with extrascondainstall-cconda-forgemarkdown-it-pylinkify-it-pymdit-py-plugins
pipinstallmarkdown-it-py[linkify,plugins]UsagePython API UsageRender markdown to HTML with markdown-it-py and a custom configuration
with and without plugins and features:frommarkdown_itimportMarkdownItfrommdit_py_plugins.front_matterimportfront_matter_pluginfrommdit_py_plugins.footnoteimportfootnote_pluginmd=(MarkdownIt('commonmark',{'breaks':True,'html':True}).use(front_matter_plugin).use(footnote_plugin).enable('table'))text=("""---a: 1---a | b- | -1 | 2A footnote [^1][^1]: some details""")tokens=md.parse(text)html_text=md.render(text)## To export the html to a file, uncomment the lines below:# from pathlib import Path# Path("output.html").write_text(html_text)Command-line UsageRender markdown to HTML with markdown-it-py from the
command-line:usage: markdown-it [-h] [-v] [filenames [filenames ...]]Parse one or more markdown files, convert each to HTML, and print to stdoutpositional arguments:filenames      specify an optional list of files to convertoptional arguments:-h, --help     show this help message and exit-v, --version  show program's version number and exitInteractive:$markdown-itmarkdown-it-py [version 0.0.0] (interactive)Type Ctrl-D to complete input, or Ctrl-C to exit.>>> # Example... > markdown *input*...<h1>Example</h1><blockquote><p>markdown <em>input</em></p></blockquote>Batch:$markdown-itREADME.mdREADME.footer.md>index.htmlReferences / ThanksBig thanks to the authors ofmarkdown-it:Alex Kocharingithub/rlidwkaVitaly Puzringithub/puzrinAlsoJohn MacFarlanefor his work on the CommonMark spec and reference implementations.
Package: markdownizer
MarkdownizerGenerate docs with ease.Documentation:https://phil65.github.io/markdownizer/Source Code:https://github.com/phil65/markdownizerDevelopmentSetup environmentWe useHatchto manage the development environment and production build. Ensure it's installed on your system.Run unit testsYou can run all the tests with:hatchruntestFormat the codeExecute the following command to apply linting and check typing:hatchrunlintPublish a new versionYou can bump the version, create a commit and associated tag with one command:hatchversionpatchhatchversionminorhatchversionmajorYour default Git text editor will open so you can add information about the release.When you push the tag on GitHub, the workflow will automatically publish it on PyPi and a GitHub release will be created as draft.Serve the documentationYou can serve the Mkdocs documentation with:hatchrundocs-serveIt'll automatically watch for changes in your code.LicenseThis project is licensed under the terms of the MIT license.