Skip to content

Commit 1c9fac2

Browse files
updating main branch with dev (#47)
* better cli output * updating documentation * updating documentation * updating badge * updating changelog Co-authored-by: Deepak Raj <54245038+codePerfectPlus@users.noreply.github.com>
1 parent a799a36 commit 1c9fac2

13 files changed

Lines changed: 57 additions & 50 deletions

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ All notable changes to this project will be documented in this file. The format
44

55
## Changelog
66

7-
## [Unreleased]
7+
## [0.2.4]
88

9+
- Beautiful command line output
910
- Moved test files to random_profile to avoid flake8:402 error
1011
- Following proper changelog format, added changelog file
11-
- Added config for readthedocs
12+
- Docs: Added documentation for the project
13+
- Bug fixed: Fixed a bug with random_profile import
1214

1315
## [v0.2.3] - 13-10-2022
1416

docs/command_line_usage.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Command line usages
2-
=========
2+
===================
33

44
`Random Profile Generator` can be used as a command line tool.
55
It can be used to generate a random profile and save it to a file.
@@ -25,55 +25,62 @@ Usages:
2525
-j, --jobtitle Get job title
2626
2727
Get Random Profile:
28-
------------
28+
-------------------
2929

3030
.. code-block:: bash
3131
3232
# n = number of random profiles, p = profile
3333
random_profile -n 10 -p
3434
3535
Get First Name:
36-
------------
36+
---------------
3737

3838
.. code-block:: bash
3939
4040
# n = number of random profiles, f = first name
4141
random_profile -n 10 -f
4242
4343
Get Last Name:
44-
------------
44+
--------------
4545

4646
.. code-block:: bash
4747
4848
# n = number of random profiles, l = last name
4949
random_profile -n 10 -l
5050
5151
Get Job Title:
52-
------------
52+
--------------
5353

5454
.. code-block:: bash
5555
5656
# n = number of random profiles, j = job title
5757
random_profile -n 10 -j
5858
5959
Get IPv4 Address:
60-
------------
60+
-----------------
6161

6262
.. code-block:: bash
6363
6464
# n = number of random profiles, ip = ipv4
6565
random_profile -n 10 -ip
6666
6767
Get Random Profile and Save to File:
68-
------------
68+
------------------------------------
6969

7070
.. code-block:: bash
7171
7272
# n = number of random profiles, p = profile
7373
random_profile -n 10 -p > random_profiles.txt
7474
75+
.. code-block:: bash
76+
77+
# save to a file
78+
# n = number of random profiles, p = profile
79+
random_profile -n 10 -p >> random_profiles.txt
80+
81+
7582
Get Random Profile version:
76-
------------
83+
---------------------------
7784

7885
.. code-block:: bash
7986

docs/import_as_module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Import as module
2-
------------
2+
----------------
33

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

docs/index.rst

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
.. rst-class:: hide-header
77

88
Welcome to RandomProfileGenerator's documentation!
9-
=====================================
9+
=================================================
1010

11-
|PyPI download month|
11+
|Total download|
1212

13-
.. |PyPI download month| image:: https://img.shields.io/pypi/dm/random_profile.svg
13+
.. |Total download| image:: http://pepy.tech/badge/random_profile
1414
:target: https://pypi.python.org/pypi/random_profile/
1515

1616
|PyPI version fury.io|
@@ -41,21 +41,11 @@ If you love open source contributions.
4141
* Join the community on `Discord <https://discord.gg/JfbK3bS>`_.
4242
* 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>`_.
4343

44-
Other Projects by Py-Contributors:
45-
--------------
46-
47-
* `AudioBook <https://audiobook.readthedocs.io/en/latest//>`_
48-
* `Cybel - The Discord Bot <https://github.com/Py-Contributors/Cybel>`_
49-
* `Twitterify - Tweet-retweet bot <https://github.com/Py-Contributors/twitterify>`_
50-
51-
|forthebadge made-with-python|
52-
53-
.. |forthebadge made-with-python| image:: http://ForTheBadge.com/images/badges/made-with-python.svg
54-
:target: https://www.python.org/
55-
44+
Contents:
45+
---------
5646

5747
.. toctree::
58-
:hidden:
48+
:maxdepth: 2
5949

6050
introduction.rst
6151
installation.rst
@@ -65,4 +55,9 @@ Other Projects by Py-Contributors:
6555
roadmap.rst
6656
run_test_cases.rst
6757

58+
Other Projects by Py-Contributors:
59+
---------------------------------
6860

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

docs/installation.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Installation
2-
=========
2+
============
33

44
Install Via Pip(recommended):
5-
------------
5+
----------------------------
66

77
.. code-block:: bash
88
@@ -11,16 +11,17 @@ Install Via Pip(recommended):
1111
1212
1313
Install from Source(Unreleased):
14-
------------
14+
--------------------------------
1515

1616
.. code-block:: bash
1717
1818
git clone https://github.com/Py-Contributors/RandomProfileGenerator
19+
git checkout main
1920
cd RandomProfileGenerator
2021
python setup.py install
2122
2223
Test Installation:
23-
------------
24+
-----------------
2425

2526
.. code-block:: bash
2627

docs/introduction.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Introduction
2-
=========
2+
============
33

44
`RandomProfileGenerator` is a powerful and simple tool to generate fake data.
55
You can use it to mock classes, populate databases and much more.
@@ -18,9 +18,3 @@ Use cases
1818
- Generating fake data for your demo
1919
- Generating fake data for your blog post
2020

21-
Upcoming features
22-
------------
23-
24-
- Support for more languages (Javascript)
25-
26-

docs/roadmap.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Roadmap and future plans
2-
=========
2+
========================
33

44
* `more test coverage`
55
* `more supported file formats`

docs/run_test_cases.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
Run test cases
2-
=========
2+
==============
33

44
For the test cases, we are using `pytest`. The test cases are located in the `tests` directory. To run the test cases, you can use the following command:
55

66

77
.. code-block:: bash
88
9-
$ pytest tests
9+
pytest tests
10+
11+
12+
.. code-block:: bash
13+
14+
flake8 . --ignore=E501
15+
16+
1017
1118
You can also run the test cases with coverage:
1219

log/__init__.py

Whitespace-only changes.
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
from audiobook.main import RandomProfile
1+
from random_profile.main import RandomProfile
22
import argparse
3+
from pprint import pprint
34

45

56
def main():
@@ -42,17 +43,17 @@ def main():
4243

4344
rp = RandomProfile(args.n)
4445
if args.fullname:
45-
print(*rp.full_name(), sep="\n")
46+
pprint(rp.full_name())
4647
elif args.profile:
47-
print(*rp.full_profile(), sep="\n")
48+
pprint(rp.full_profile())
4849
elif args.lastname:
49-
print(*rp.last_name(), sep="\n")
50+
pprint(rp.last_name())
5051
elif args.jobtitle:
51-
print(*rp.job_title(), sep="\n")
52+
pprint(rp.job_title())
5253
elif args.ipv4:
53-
print(*rp.ipv4(), sep="\n")
54+
pprint(rp.ipv4())
5455
else:
55-
print('Type `random_profile -h` for help')
56+
pprint('Type `random_profile -h` for help')
5657

5758

5859
if __name__ == "__main__":

0 commit comments

Comments
 (0)