Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Final changed to documentation and adding frontmatter to main source …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
EdmundGoodman committed Oct 30, 2021
1 parent 72dae02 commit fd32f64
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Exclude the Jupyter notebook files used for testing from the GitHub language
# breakdown
*.ipynb linguist-detectable=false
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,27 @@
A simple tool to extract python code from a Jupyter notebook, and then run
pylint on it for static analysis.

The tool can be downloaded in the following places:
# Usage

- [As a standalone python file](https://raw.githubusercontent.com/EdmundGoodman/Jupyter_Pylinter/main/jupylint/jupylint.py)
- [As a package on PyPI](https://pypi.org/project/jupylint/)
The package can be installed via PyPI, then run from the command line, as
follows:

And has documentation available:
```bash
pip install jupylint
jupylint <input file name>
```

Full documentation is available:

- [On readthedocs](https://jupylint.readthedocs.io/en/latest/)

# Download

The tool can be downloaded in the following places:

- [As a standalone python file](https://raw.githubusercontent.com/EdmundGoodman/Jupyter_Pylinter/main/jupylint/jupylint.py)
- [As a package on PyPI](https://pypi.org/project/jupylint/)

## Contributions and errata

If you find a bug in the code, feel free to submit a pull request or an issue
Expand Down
15 changes: 15 additions & 0 deletions jupylint/jupylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
from os import remove, path


__author__ = "Edmund Goodman"
__copyright__ = "Copyright 2021"
__credits__ = ["Edmund Goodman"]
__license__ = "MIT"
__version__ = "2.0.0"
__maintainer__ = "Edmund Goodman"
__email__ = "egoodman3141@gmail.com"
__status__ = "Production"


class OldJupyterVersionError(Exception):
"""A custom exception for when the Jupyter version is too old"""

Expand Down Expand Up @@ -100,3 +110,8 @@ def run():
def main():
"""External run hook"""
Jupylint.run()


if __name__ == "__main__":
# If the file is run directly, run the main function
main()
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

setup(
name = 'jupylint',
version = '1.1.0',
version = '2.0.0',
license='MIT',
description = 'A tool to run pylint on Jupyter notebooks',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'Edmund Goodman',
author_email = 'egoodman3141@gmail.com',
url = 'https://github.com/EdmundGoodman/Jupyter_Pylinter',
download_url = 'https://github.com/EdmundGoodman/Jupyter_Pylinter/archive/refs/tags/v1.1.0.tar.gz',
download_url = 'https://github.com/EdmundGoodman/Jupyter_Pylinter/archive/refs/tags/v2.0.0.tar.gz',
packages=find_packages(),
entry_points = {
"console_scripts": ['jupylint = jupylint.jupylint:main']
Expand Down
4 changes: 2 additions & 2 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

# -- Project information -----------------------------------------------------

project = 'jupylint'
project = 'Jupylint'
copyright = '2021, Edmund Goodman'
author = 'Edmund Goodman'

# The full version, including alpha/beta/rc tags
release = '1.1.0'
release = '2.0.0'


# -- General configuration ---------------------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Welcome to Jupylint's documentation!
=====================================

A simple tool to extract python code from a Jupyter notebook, and then run
pylint on it for static analysis.
:code:`pylint` on it for static analysis.

Installation
------------

The library package has been published on PyPi, so can be found here: https://pypi.org/project/jupylint/, and can be installed as follows:
The library package has been published on PyPi, so can be found here:
https://pypi.org/project/jupylint/, and can be installed as follows:

.. code-block:: python
Expand All @@ -21,18 +22,18 @@ The library package has been published on PyPi, so can be found here: https://py
Requirements
------------

There are no additional required libraries

The :code:`pylint` package is required, as :code:`jupylint` merely provides a
wrapper around it for Jupyter notebooks.

Contents
--------

.. toctree::
:maxdepth: 2

autodoc
project
usage
autodoc


Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion source/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Project Description
Objective
---------
A simple tool to extract python code from a Jupyter notebook, and then run
pylint on it for static analysis.
:code:`pylint` on it for static analysis.

Source Code
-----------
Expand Down
32 changes: 16 additions & 16 deletions source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ Importing the module
from jupylint import Jupylint
Linting a file from within python
---------------------------------

.. code-block:: python
args = {
"in_file_name": ['./in.ipynb'],
"out_file_name": './out.py',
"save_file": True
}
result = Jupylint.execute(args)
print(result)
Linting a file from the command line
------------------------------------

.. code-block:: bash
python jupylint.py ./in.ipynb
jupylint ./in.ipynb
Getting help from the command line
----------------------------------

.. code-block:: bash
python jupylint.py --help
jupylint --help
Linting a file from within python
---------------------------------

.. code-block:: python
args = {
"in_file_name": ['./in.ipynb'],
"out_file_name": './out.py',
"save_file": True
}
result = Jupylint.execute(args)
print(result)

0 comments on commit fd32f64

Please sign in to comment.