Skip to main content

random-markdown-generator

Build Status

Coverage Status

A library to generate random markdown text.

But why?

I was making a blog web-app that lets its users write blog posts using markdown syntax. I couldn't find any python package that does this easily. Using the faker library, I created this package to make a highly configurable markdown post generator. Additionally, it also provides an API for creating markdown files using python.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

You must have python and pip installed on your system, and in you PATH. An activated virtual environment is also recommended.

Using pip:

pip install mdgen

Or using poetry:

poetry add mdgen

Sample usage

from faker import Faker
from mdgen import MarkdownPostProvider
fake = Faker()
fake.add_provider(MarkdownPostProvider)
fake_post = fake.post(size='medium') # available sizes: 'small', 'medium', 'large'
print(fake_post)

The output from the above command:

Drop question writer.

> After step respond support argue issue western movie.
[First memory suffer yard.](https://www.simmons.com/)

        1. Possible career speak another believe realize analysis.
|First fear enter surface hospital nothing raise condition.|Name quickly deep free before if.|Rather church provide walk power thank student.|
|----------------------------------------------------------|---------------------------------|-----------------------------------------------|
|Box seem hotel picture popular politics century.|Side simple daughter central suggest.|Campaign nation Republican economy perform require.|

Documentation

The documentation for this project can be found at https://ignisda.github.io/python-random-markdown-generator/.

Running the tests

The project uses pytest to automate its test suite. To install all dependencies, ensure you have poetry installed on your system and then run:

poetry install

This will install all dependencies for testing this project in a virtual environment. Then run all tests using:

poetry shell
pytest

To see test coverage, run:

pytest --cov --cov-report=html --cache-clear

Then open htmlcov/index.html in your browser to see the test coverage.

Coding style

This project follows the pep8 specifications. The maximum line length has been increased to 90 characters. For the flake8 configuration used, see tox.ini. The test suite automatically runs the linters by default, but you can run just the linting tests.

flake8

Built With

  • Poetry - Dependency Management
  • Sphinx - Used to generate this project's documentation.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

Author

  • IgnisDa (Diptesh Choudhuri) - Initial work

See also the list of contributors who participated in this project. If you have made any contribution to this project, please add it in contributors.md.

License

This project is licensed under the Apache-2.0 License - see the LICENSE.md file for details.

Acknowledgments

  • Hat tip to anyone whose code was used

Release files for mdgen 0.1.10

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

Source distribution (sdist)

Source distribution for mdgen 0.1.10
File Size Uploaded
mdgen-0.1.10.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdgen 0.1.10
File Interpreter ABI Platform
mdgen-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / mdgen-0.1.10.tar.gz

Download URL mdgen-0.1.10.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5e13f414dc40593a013a9b81436d05d8c9b0c231b2e5fe6766772e88283a2271
BLAKE2b-256 checksum
How to use checksums
5797d4130e4523e019a4db2cf4b61fa37cac5c6643183be5e4be8c0478de2333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.2 Linux/5.18.7-arch1-1

Release files / mdgen-0.1.10-py3-none-any.whl

Download URL mdgen-0.1.10-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2de4d250b07aa9c84406baa256e6319dad7857d1a02ed3932d0a7997aa666320
BLAKE2b-256 checksum
How to use checksums
a1537ea81c4ecdb5ac2905ba5ff3b2cc80a0ce6a1a0a69fa5e4ded24abe010dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.2 Linux/5.18.7-arch1-1

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.2

2 release files

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