semvec/pypi-packages huggingface dataset:
docdantic 0.3.1
A markdown plugin for generating docs from Pydantic models
License: MIT
Requires Python: >=3.11,<4.0

# Docdantic

![Gitlab code coverage (specific job)](https://img.shields.io/gitlab/pipeline-coverage/emergentmethods/docdantic?branch=main&job_name=unit-tests&style=flat-square)
![GitLab Release (latest by SemVer)](https://img.shields.io/gitlab/v/release/emergentmethods/docdantic?style=flat-square)
![GitLab](https://img.shields.io/gitlab/license/emergentmethods/docdantic?style=flat-square)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/docdantic?style=flat-square)

Docdantic is a Python library that enables the automatic generation of Markdown documentation from Pydantic models. It works as an extension of the Markdown package, extracting model details and creating neat tables with model fields and their properties.


## Features

* Supports both Pydantic V1 and V2 models.
* Automatically generate tables of Pydantic model fields with their details (name, type, required, default).
* Supports nested Pydantic models.
* Configurable exclusion of specific fields from the documentation.


## Installation

```bash
pip install docdantic
```

## Usage

### Using the Docdantic Extension

To generate documentation directly from Markdown files, you can use the Docdantic extension. Simply include the `!docdantic: import.path.to.Model` directive in your Markdown text:

```markdown
# MyModel Reference

!docdantic: my_module.MyModel
```

Docdantic will replace the !docdantic directive with a table of model field details.

### Using Docdantic in Python Code

If you want to programmatically generate Markdown documentation from Pydantic v2 models, you can use Docdantic in your Python code. Here's an example:

```python
import markdown
from docdantic import Docdantic

markdown_text = "Here are the details of my model:\n\n!docdantic: your.model.path"
converted_text = markdown.markdown(markdown_text, extensions=[Docdantic()])

# `converted_text` will contain the Markdown text with the model documentation
```

You can include the `!docdantic: your.model.path` directive in your Markdown text as before, and the `markdown.markdown` method will process it using the Docdantic extension.

## Configuration

Docdantic allows you to exclude specific fields from the generated documentation by using the exclude configuration. You can provide a JSON object in the exclude field of the configuration to specify which fields to exclude. For example:

```markdown
!docdantic: my_module.MyModel
    {
        "exclude": {
            "MyModel": ["field1", "field2"]
        }
    }
```

In the example above, the fields `field1` and `field2` will be excluded from the documentation of the `MyModel` model. Notice the configuration has to be indented with 2-4 spaces or a tab.

## License

This project is licensed under the terms of the MIT license. See [LICENSE](LICENSE) for more details.
tulia 0.2.1
numpy based machine learning package with sklearn-like API
License: MIT
Keywords: python,machine learning,from scratch,numpy,sklearn-like,random forest,tree,knn

<div align="center">

![logo](/docs/logo.png)

Tulia: a comprehensive machine learning project entirely from scratch, utilizing the power of Python and numpy.

</div>

## Features

### Simplicity

By encapsulating both the training and predicting logic within just a couple of classes, complexity is greatly reduced compared to popular frameworks that heavily rely on abstraction.
Moreover, the library provided here offers a streamlined approach by maintaining only essential parameters in the model class. 

### Familiar approach

This library uses sklearn API to build the codebase. 

## Example usage

```python
from src.linear import LinearRegression

X_train, X_test, y_train, y_test = ...

lr = LinearRegression(n_steps=10_000, learning_rate=1e-4)
lr.fit(X_train, y_train)

y_pred = lr.predict(X_test)

mse = mean_squared_error(y_pred, y_test)  # Here mean_squared_error() is a pseudocode.
```

## Installation


### To use in code

```sh
pip install tulia
```

### Download a whole library

```sh
git clone https://github.com/chuvalniy/Tulia.git
pip install -r requirements.txt
```

## Testing

Every machine learning model is provided with unit test that verifies correctness of fit and predict methods.

Execute the following command in your project directory to run the tests.

```python
pytest -v
```

## License
MIT License