semvec/pypi-packages huggingface dataset:
format-def-indent 0.1.7
Make sure arguments in Python function definitions are indented by 8 spaces
License: MIT
Requires Python: >=3.8

# py-def-indent-formatter

A command line tool (and a pre-commit hook) to automatically format haning indentation in Python function definitions to 8 spaces.

Currently, this tool is only designed to work properly _after_ your Python files have been formatted by [`black`](https://github.com/psf/black) or [`blue`](https://github.com/grantjenks/blue).

## Motivation of this tool

`black` and `blue` both use only 4 spaces as haning indentation in function definitions, which is not aligned with [PEP8's recommendation](https://peps.python.org/pep-0008/#indentation).

Therefore, this tool specifically fixes this 4-space style choice of `black` and `blue`.

## Installation

```bash
pip install format-def-indent
```

## Usage

### As a command line tool

To auto-format Python files (.py):

```bash
format-def-indent <PATH_THAT_CONTAINS_PYTHON_FILES>
```
Use `--help` to see documentations of command line arguments.

To auto-format Jupyter notebooks (.ipynb):

```bash
format-def-indent-in-jupyter <PATH_THAT_CONTAINS_PYTHON_FILES>
```

### As a pre-commit hook

To auto-format Python files (.py), put the following into your `.pre-commit-config.yaml` file. Remember to replace `<VERSION>` with your version of this tool (such as `v0.1.4`):
```yaml
-   repo: https://github.com/cyyc1/py-def-indent-formatter
    rev: <VERSION>
    hooks:
    -   id: format-def-indent
```

To auto-format Jupyter notebooks (.ipynb), put the following into your `.pre-commit-config.yaml` file:
```yaml
-   repo: https://github.com/cyyc1/py-def-indent-formatter
    rev: <VERSION>
    hooks:
    -   id: format-def-indent-in-jupyter
```

See [pre-commit](https://github.com/pre-commit/pre-commit) for more instructions.

## What does this formatter do

This tool formats the following "before" (red) into "after" (green).

### Multi-line arguments in function definitions:

```diff
def some_function(
-    arg1,
-    arg2='test',
-    *,
-    arg3: int = 2,
-    arg4: bool = False,
+        arg1,
+        arg2='test',
+        *,
+        arg3: int = 2,
+        arg4: bool = False,
) -> None:
    print(1)
```

or

```diff
def some_functions(
-    arg1,
-    *args,
-    **kwargs,
+        arg1,
+        *args,
+        **kwargs,
):
    print(1)
```

### Single-line arguments in function definitions:

```diff
def some_function(
-    arg1, arg2='test', *, arg3: int = 2, arg4: bool = False,
+        arg1, arg2='test', *, arg3: int = 2, arg4: bool = False,
):
    print(1)
```
jupyter-notebook-parser 0.1.4
A Python library that parses Jupyter notebook cells
License: MIT
Requires Python: >=3.7

# jupyter-notebook-parser
A Python library to parse cell contents from Jupyter notebooks


## Installation

```bash
pip install jupyter-notebook-parser
```

## Usage

### Parser

```python
from jupyter_notebook_parser import JupyterNotebookParser


parsed = JupyterNotebookParser('my_notebook.ipynb')

parsed.get_all_cells()  # returns List[Dict], each Dict is a notebook cell

parsed.get_markdown_cells()  # returns List[Dict], each Dict is a markdown cel
parsed.get_markdown_cell_indices()  # returns List[int], each is a markdown cell's index
parsed.get_markdown_cell_sources()  # returns List[str], each is a markdown cell's text

parsed.get_code_cells()  # returns List[Dict], each Dict is a code cell
parsed.get_code_cell_indices()  # returns List[int], each int is a code cell's index
parsed.get_code_cell_sources()  # returns List[SourceCodeContainer]

source = parsed.get_code_cell_sources()[0]
source.raw_source  # str
source.source_without_magic  # str (all ipython magics excluded)
source.magics  # Dict[int, str] (all magics, from line number to magic text)
```

### Rewriter

```python
from jupyter_notebook_parser import JupyterNotebookParser
from jupyter_notebook_parser import JupyterNotebookRewriter


parsed = JupyterNotebookParser('my_notebook.ipynb')
rewriter = JupyterNotebookRewriter(parsed_notebook=parsed)

rewriter.replace_source_in_code_cell(index=5, new_source='print(2)')
```

### Source code container
```python
from jupyter_notebook_parser import SourceCodeContainer


container = SourceCodeContainer('a = 2\n%timeit b = 2 ** 10\nprint(b)')
container.raw_source  # same as the input
container.source_without_magic  # 'a = 2\n b = 2 ** 10\nprint(b)'
container.magics  # {1: '%timeit'}
```
mynameisdusit 0.0.2
Who is Dusit?
License: MIT
Keywords: Dusit,Casper Ascii art

This package is python that show about Dusit.”
==============================================

PyPi: https://pypi.org/project/mynameisdusit/

Hello, this package show about Dusit, you can see for more information
via facebook.

วิธีติดตั้ง
~~~~~~~~~~~

เปิด CMD / Terminal

.. code:: python

   pip install mynameisdusit

วิธีใช้งานแพ็คเพจนี้
~~~~~~~~~~~~~~~~~~~~

-  เปิด IDLE ขึ้นมาแล้วพิมพ์…

.. code:: python

   from mynameisdusit import UncleEngineer

   uncle = UncleEngineer() # show class
   uncle.show_name() # show name
   uncle.show_youtube() # show youtube link
   uncle.show_page() # show link page
   uncle.about() # show about Dusit
   uncle.show_art() # show ascii art

พัฒนาโดย: ลุงวิศวกร สอนคำนวณ FB: https://www.facebook.com/UncleEngineer

YouTube: https://www.youtube.com/UncleEngineer