mdprint
Python tools to print strings to markdown file with styles. Also allows printing dicts and lists to table
Installation
pip install mdprint
Quick Start
Basics
mdprint('Markdown styles', heading=3)
mdprint('It is convenient to use mdprint just like print.\n')
mdprint('You can make text ', end='')
mdprint('bold', bold=True, end=', ')
mdprint('italics', italics=True, end=', ')
mdprint('or even ', end='')
mdprint('strikethrough', strikethrough=True)
mdprint('\nYou can also write ', end='')
mdprint('code', code=True)
mdprint('from mdprint import mdprint', code_block=True)
Markdown styles
It is convenient to use mdprint just like print.
You can make text bold, italics, or even strikethrough
You can also write code
from mdprint import mdprint
Writing to file
mdprint takes file argument similar to print
with open('README.md', 'w') as f:
mdprint('Hello', heading=2, file=f)
Dict
from mdprint import mdprint_dict
mydict = {'dogs': ['goldie', 'labrador', 'bulldog'], 'cats': ['polydactyl', 'snowshoe', 'calico'], 'fish': ['cod', 'herring', 'mackerel']}
mdprint_dict(mydict)
| dogs | cats | fish |
|---|---|---|
| goldie | polydactyl | cod |
| labrador | snowshoe | herring |
| bulldog | calico | mackerel |
List
from mdprint import mdprint_list
mylist = [['goldie', 'labrador', 'bulldog'], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
mdprint_list(mylist)
| goldie | labrador | bulldog |
|---|---|---|
| 4 | 5 | 6 |
| 7 | 8 | 9 |
| 10 | 11 | 12 |
Advanced
You can sort, invert and combine commands
mdprint_list([['animal type', 'variety 1', 'variety 2', 'variety 3']], end='')
mdprint_dict(b, keys_as_headers=False, sort_keys=True, start='')
| animal type | variety 1 | variety 2 | variety 3 |
|---|---|---|---|
| cats | polydactyl | snowshoe | calico |
| dogs | goldie | labrador | bulldog |
| fish | cod | herring | mackerel |
Contributing
Pull requests are very welcome.
- Fork the repo
- Create new branch with feature name as branch name
- Check if things work with a jupyter notebook
- Raise a pull request
Licence
Please see attached Licence
Metadata
Release files for mdprint 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdprint-0.2.0.tar.gz | 4.0 kB | Without provenance | Details for mdprint-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mdprint-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for mdprint-0.2.0-py3-none-any.whl |
Total release size: 9.3 kB
Release files / mdprint-0.2.0.tar.gz
| Download URL | mdprint-0.2.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98b994203f64365ed8647d1d928e98bda266e526a2df42af3da3e47504997795
|
|
BLAKE2b-256 checksum How to use checksums |
09c258992b0bb33f7a3310dcd3bb91d02f0f144112d3d038e3ab74fe0d7befdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Release files / mdprint-0.2.0-py3-none-any.whl
| Download URL | mdprint-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff8b8954569ff9c217e4ee5fda8aac5fddf5248486f106758eda4596b67a89ae
|
|
BLAKE2b-256 checksum How to use checksums |
b3c305c423adbc7ad45622f5b16e2696c49bb0daec5a39672a237ee8356ccc1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for mdprint 0.2.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.