RPyMD


NameRPyMD JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryLibrary for recording in a markdown file.
upload_time2024-07-17 18:44:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT License
keywords markdown markdown generator report results evaluation
VCS
bugtrack_url
requirements matplotlib matplotlib-inline mdutils numpy pandas pathlib typing-extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyMD
==================

[![License](https://img.shields.io/badge/license-MIT-black.svg)](https://opensource.org/licenses/MIT)

# Overview
This packages provides an intuitive way to generate markdown files. While sweeping over parameters for a project, results can be neatly organized and stored within a markdown file.

# Features
* Index over subsections
* Assign multiple section types to each section
* Add text, images, figures, lists, tables, checkboxes, and hyperlinks to the markdown.
* Save and load as JSON

# Installation
## Pip
Use pip to install PyMD:
```bash
pip install .
```  

# Markdown File Examples

## Create MDGenerator Object
When creating the `MDGenerator` Object, either the save path and filename can be given together in the `save_path` or separately. If given together, this will neglect the `file_name` parameter, and the file descriptor must be given with the `save_path`. File descriptor is not needed if `file_name` is given separately.

A list of authors can be provided or a single name. It will be formatted accordingly.

```python
from PyMD import MDGenerator

md = MDGenerator(save_path="folder/filename.md", title="Title of MD file", author="John Smith")

# Add sections to the md object

# Save when done to generate md file
md.save()
```  

## Create and Index Section Headers
Section headers are automatically created when a section get or set is made. Levels or subsections can be addressed by a file system format. Examples would be:

### Indexing using base object
```python
md.add_text("Section 1/Subsection 1/Subsubsection 1","This is placed in the subsubsection of the first section and first subsection.")
```  

### Dictionary Single Indexing
```python
md["Section 1/Subsection 1/Subsubsection 1"].add_text("This is placed in the subsubsection of the first section and first subsection.")
```  

### Dictionary Multi Indexing
```python
md["Section 1"]["Subsection 1"]["Subsubsection 1"].add_text("This is placed in the subsubsection of the first section and first subsection.")
```  

### Variation of Single and Multi Indexing
```python
md["Section 1/Subsection 1"]["Subsubsection 1"].add_text("This is placed in the subsubsection of the first section and first subsection.")
```  
However, indexing through a function call can only be done by the base object. Not a membering object.

## Assignment Functions
Each function will have its own parameters, but the provided functions are the following:
```python
md.add_text(text)
md.add_code(text)
md.add_figure(figure)
md.add_image(image_path)
md.add_table(table)
md.add_list(text_list)
md.add_link(link, text)
md.add_checkbox(text_list, checked)
```  

## Default Assignments
To speed up common assignments, text, figures, tables, and lists are allowed to be assigned to the dictionary. For examples, each assignment can be made to add to a section:

### Text Assignmnet
```python
md["Section 1"]["Subsection 1"]["Subsubsection 1"] = "This is placed in the subsubsection of the first section and first subsection."
```  

### Figure Assignment
```python
from matplotlib import pyplot as plt

fig, ax = plt.subplots()
# Add to the figure
md["Figure or Image Section"] = fig
```

### Dataframe Assignment
```python
from pandas import DataFrame

# Create array instance with or without columns
table = DataFrame(array, columns=columns)
md["Table Section"] = table
```

### Numpy Assignment
```python
import numpy

# Create array instance
md["Table Section"] = array
```

### List Assignment
```python
md["List Section"] = ["Item 1", "Item 2", "Item 3"]
```

## Save and Load JSON file
```python
md.save_json()
```
```python
md.save_json(new_file_name)
```

```python
md = MDGenerator(save_path=json_file_location)
md.load_json()
```
```python
md = MDGenerator()
md.load_json(json_file_location)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "RPyMD",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "markdown, MarkDown, generator, report, results, evaluation",
    "author": null,
    "author_email": "Randall Fowler <randallfowler77@yahoo.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/71/9be579daff126f8e28190df20194396a154ddaaa5c589cc8a8164896f112/rpymd-1.0.0.tar.gz",
    "platform": null,
    "description": "PyMD\n==================\n\n[![License](https://img.shields.io/badge/license-MIT-black.svg)](https://opensource.org/licenses/MIT)\n\n# Overview\nThis packages provides an intuitive way to generate markdown files. While sweeping over parameters for a project, results can be neatly organized and stored within a markdown file.\n\n# Features\n* Index over subsections\n* Assign multiple section types to each section\n* Add text, images, figures, lists, tables, checkboxes, and hyperlinks to the markdown.\n* Save and load as JSON\n\n# Installation\n## Pip\nUse pip to install PyMD:\n```bash\npip install .\n```  \n\n# Markdown File Examples\n\n## Create MDGenerator Object\nWhen creating the `MDGenerator` Object, either the save path and filename can be given together in the `save_path` or separately. If given together, this will neglect the `file_name` parameter, and the file descriptor must be given with the `save_path`. File descriptor is not needed if `file_name` is given separately.\n\nA list of authors can be provided or a single name. It will be formatted accordingly.\n\n```python\nfrom PyMD import MDGenerator\n\nmd = MDGenerator(save_path=\"folder/filename.md\", title=\"Title of MD file\", author=\"John Smith\")\n\n# Add sections to the md object\n\n# Save when done to generate md file\nmd.save()\n```  \n\n## Create and Index Section Headers\nSection headers are automatically created when a section get or set is made. Levels or subsections can be addressed by a file system format. Examples would be:\n\n### Indexing using base object\n```python\nmd.add_text(\"Section 1/Subsection 1/Subsubsection 1\",\"This is placed in the subsubsection of the first section and first subsection.\")\n```  \n\n### Dictionary Single Indexing\n```python\nmd[\"Section 1/Subsection 1/Subsubsection 1\"].add_text(\"This is placed in the subsubsection of the first section and first subsection.\")\n```  \n\n### Dictionary Multi Indexing\n```python\nmd[\"Section 1\"][\"Subsection 1\"][\"Subsubsection 1\"].add_text(\"This is placed in the subsubsection of the first section and first subsection.\")\n```  \n\n### Variation of Single and Multi Indexing\n```python\nmd[\"Section 1/Subsection 1\"][\"Subsubsection 1\"].add_text(\"This is placed in the subsubsection of the first section and first subsection.\")\n```  \nHowever, indexing through a function call can only be done by the base object. Not a membering object.\n\n## Assignment Functions\nEach function will have its own parameters, but the provided functions are the following:\n```python\nmd.add_text(text)\nmd.add_code(text)\nmd.add_figure(figure)\nmd.add_image(image_path)\nmd.add_table(table)\nmd.add_list(text_list)\nmd.add_link(link, text)\nmd.add_checkbox(text_list, checked)\n```  \n\n## Default Assignments\nTo speed up common assignments, text, figures, tables, and lists are allowed to be assigned to the dictionary. For examples, each assignment can be made to add to a section:\n\n### Text Assignmnet\n```python\nmd[\"Section 1\"][\"Subsection 1\"][\"Subsubsection 1\"] = \"This is placed in the subsubsection of the first section and first subsection.\"\n```  \n\n### Figure Assignment\n```python\nfrom matplotlib import pyplot as plt\n\nfig, ax = plt.subplots()\n# Add to the figure\nmd[\"Figure or Image Section\"] = fig\n```\n\n### Dataframe Assignment\n```python\nfrom pandas import DataFrame\n\n# Create array instance with or without columns\ntable = DataFrame(array, columns=columns)\nmd[\"Table Section\"] = table\n```\n\n### Numpy Assignment\n```python\nimport numpy\n\n# Create array instance\nmd[\"Table Section\"] = array\n```\n\n### List Assignment\n```python\nmd[\"List Section\"] = [\"Item 1\", \"Item 2\", \"Item 3\"]\n```\n\n## Save and Load JSON file\n```python\nmd.save_json()\n```\n```python\nmd.save_json(new_file_name)\n```\n\n```python\nmd = MDGenerator(save_path=json_file_location)\nmd.load_json()\n```\n```python\nmd = MDGenerator()\nmd.load_json(json_file_location)\n```\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Library for recording in a markdown file.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Th3RandyMan/PyMD"
    },
    "split_keywords": [
        "markdown",
        " markdown",
        " generator",
        " report",
        " results",
        " evaluation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12ced815e39462385b1609c9724d70b058cd948183a8b968bb5f5b47b8ec6db2",
                "md5": "0103c58bc3776176246dcd4df96f1857",
                "sha256": "06dafbda3827653d1b52d5a53741359f373a70d9e6a089153dbb623d0325a810"
            },
            "downloads": -1,
            "filename": "RPyMD-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0103c58bc3776176246dcd4df96f1857",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 12579,
            "upload_time": "2024-07-17T18:44:25",
            "upload_time_iso_8601": "2024-07-17T18:44:25.407603Z",
            "url": "https://files.pythonhosted.org/packages/12/ce/d815e39462385b1609c9724d70b058cd948183a8b968bb5f5b47b8ec6db2/RPyMD-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d719be579daff126f8e28190df20194396a154ddaaa5c589cc8a8164896f112",
                "md5": "9d1cc299072d4fbdb5d099a027db9322",
                "sha256": "e7e5cc982309c2b9b68a0264a70a0d50c0686a37346e51253759654b415e9ac6"
            },
            "downloads": -1,
            "filename": "rpymd-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9d1cc299072d4fbdb5d099a027db9322",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14644,
            "upload_time": "2024-07-17T18:44:27",
            "upload_time_iso_8601": "2024-07-17T18:44:27.027016Z",
            "url": "https://files.pythonhosted.org/packages/0d/71/9be579daff126f8e28190df20194396a154ddaaa5c589cc8a8164896f112/rpymd-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-17 18:44:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Th3RandyMan",
    "github_project": "PyMD",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.7.5"
                ]
            ]
        },
        {
            "name": "matplotlib-inline",
            "specs": [
                [
                    "==",
                    "0.1.7"
                ]
            ]
        },
        {
            "name": "mdutils",
            "specs": [
                [
                    "==",
                    "1.6.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.24.4"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.0.3"
                ]
            ]
        },
        {
            "name": "pathlib",
            "specs": [
                [
                    "==",
                    "1.0.1"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.12.2"
                ]
            ]
        }
    ],
    "lcname": "rpymd"
}
        
Elapsed time: 0.32303s