Skip to content

Commit

Permalink
Merge pull request #39 from codePerfectPlus/doc-patch-1
Browse files Browse the repository at this point in the history
updating docs
  • Loading branch information
DrakeEntity authored Oct 29, 2022
2 parents 0be751c + 3cf59a9 commit 26ead9e
Show file tree
Hide file tree
Showing 14 changed files with 339 additions and 133 deletions.
9 changes: 7 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ build:
tools:
python: "3.9"

mkdocs:
configuration: mkdocs.yml
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally declare the Python requirements required to build your docs
python:
Expand Down
35 changes: 1 addition & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,10 @@

[RandomProfile](https://pypi.org/project/random-profile/) is a powerful and simple tool to generate fake data. You can use it to mock classes, populate databases and much more. You can check the full documentation here. Check on [Pypi](https://pypi.org/project/random-profile/)

## Installation

- This is A python 3 Package.
- Install python 3.0+ or Anaconda 3.0+

```bash
pip install random-profile # using pip
conda install random-profile # using anaconda
```

## Documentation

### As Python Module
You can use the RandomProfile as a module in your python code. You can check the full documentation here.

```python
from random_profile import RandomProfile
rp = RandomProfile(num=5)

rp.full_profile(num=10)
```

for detailed documentation check [here](https://randomprofilegenerator.readthedocs.io/)

### As Command Line Tool
You can also use the RandomProfile as a command line tool. You can check the full documentation here.

```bash
random-profile --help
Usage: random-profile [OPTIONS]
```

```bash
random-profile -n 10 -p
```

for detailed documentation check [here](https://randomprofilegenerator.readthedocs.io/)
Documentation is available at [ReadTheDocs](https://randomprofilegenerator.readthedocs.io/en/latest/)

## Upcoming Features

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
94 changes: 0 additions & 94 deletions docs/README.md

This file was deleted.

82 changes: 82 additions & 0 deletions docs/command_line_usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Command line usages
=========

`Random Profile Generator` can be used as a command line tool.
It can be used to generate a random profile and save it to a file.
It can also be used to generate a random profile and print it to the console.

Usages:

.. code-block:: bash
random-profile --help
Usage: random-profile [OPTIONS]
random-profile -n 10 -p
optional arguments:
-h, --help show this help message and exit
-n N Number of random profiles
-f, --fullname Get full name instead of first name
-p, --profile Get full profile instead of first name
-l, --lastname Get last name instead of first name
-ip, --ipv4 Get an ipv4 IP address
-j, --jobtitle Get job title
Get Random Profile:
------------

.. code-block:: bash
# n = number of random profiles, p = profile
random_profile -n 10 -p
Get First Name:
------------

.. code-block:: bash
# n = number of random profiles, f = first name
random_profile -n 10 -f
Get Last Name:
------------

.. code-block:: bash
# n = number of random profiles, l = last name
random_profile -n 10 -l
Get Job Title:
------------

.. code-block:: bash
# n = number of random profiles, j = job title
random_profile -n 10 -j
Get IPv4 Address:
------------

.. code-block:: bash
# n = number of random profiles, ip = ipv4
random_profile -n 10 -ip
Get Random Profile and Save to File:
------------

.. code-block:: bash
# n = number of random profiles, p = profile
random_profile -n 10 -p > random_profiles.txt
Get Random Profile version:
------------

.. code-block:: bash
random_profile --version
random-profile 0.2.3
26 changes: 26 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from datetime import datetime

project = 'audiobook'
copyright = '2022, Deeapk Raj'
author = 'Deeapk Raj'
release = '2.0.4'

extensions = [
'sphinx.ext.autosectionlabel'
]

releases_github_path = "Py-Contributors/RandomProfileGenerator"

autosectionlabel_prefix_document = True

templates_path = ['_templates']
source_suffix = ".rst"
master_doc = "index"
year = datetime.now().year
copyright = "{} Deepak Raj".format(year)

html_theme = 'sphinx_rtd_theme' # 'pydata_sphinx_theme' 'alabaster'

html_static_path = ['_static']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv']
html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
21 changes: 21 additions & 0 deletions docs/import_as_module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Import as module
------------

You can import the module and use it in your own scripts.

.. code-block:: python
from random_profile import RandomProfile
rp = RandomProfile()
# For first name
rp.first_name(num=10)
# For full name
rp.full_name(num=8)
# override the num value
rp.full_profile(num=10)
# For last name
rp.last_name(num=6)
68 changes: 68 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

.. RandomProfileGenerator documentation master file, created by
sphinx-quickstart on Sat Oct 29 16:13:30 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
.. rst-class:: hide-header

Welcome to RandomProfileGenerator's documentation!
=====================================

|PyPI download month|

.. |PyPI download month| image:: https://img.shields.io/pypi/dm/RandomProfileGenerator.svg
:target: https://pypi.python.org/pypi/RandomProfileGenerator/

|PyPI version fury.io|

.. |PyPI version fury.io| image:: https://badge.fury.io/py/RandomProfileGenerator.svg
:target: https://pypi.python.org/pypi/RandomProfileGenerator/

|Open Source Love svg3|

.. |Open Source Love svg3| image:: https://badges.frapsoft.com/os/v3/open-source.svg?v=103
:target: https://github.com/ellerbrock/open-source-badges/

.. image:: https://raw.githubusercontent.com/DrakeEntity/project-Image/master/9b2ca712-347a-4987-bac7-a4c3d106ed24_200x200.png
:width: 200
:alt: Py-Contributors Logo
:align: right


`RandomProfileGenerator` is a powerful and simple tool to generate fake data.
You can use it to mock classes, populate databases and much more.
You can check the full documentation here.

RandomProfileGenerator project developed under the MIT license by Py-Contributors.
Py-Contributors is open source community of developers who are working on various python projects.

If you love open source contributions.

* Join the community on `Discord <https://discord.gg/JfbK3bS>`_.
* join the community on `Github <https://github.com/Py-Contributors/support/issues/new?assignees=&labels=invite+me+to+the+organisation&template=invite.yaml&title=Please+invite+me+to+the+GitHub+Community+Organization>`_.

Other Projects by Py-Contributors:
--------------

* `AudioBook <https://audiobook.readthedocs.io/en/latest//>`_
* `Cybel - The Discord Bot <https://github.com/Py-Contributors/Cybel>`_
* `Twitterify - Tweet-retweet bot <https://github.com/Py-Contributors/twitterify>`_

|forthebadge made-with-python|

.. |forthebadge made-with-python| image:: http://ForTheBadge.com/images/badges/made-with-python.svg
:target: https://www.python.org/


.. toctree::
:hidden:

introduction.rst
installation.rst
command_line_usage.rst
import_as_module.rst
changelog.rst
roadmap.rst
run_test_cases.rst


Loading

0 comments on commit 26ead9e

Please sign in to comment.