pydantic-settings-export


Namepydantic-settings-export JSON
Version 0.3.6 PyPI version JSON
download
home_pageNone
SummaryExport your Pydantic settings to a Markdown and .env.example files!
upload_time2024-11-27 12:05:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 Jag_k Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords config dotenv export markdown pydantic settings
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydantic-settings-export

[![PyPI version](https://img.shields.io/pypi/v/pydantic-settings-export?logo=pypi&label=pydantic-settings-export)](https://pypi.org/project/pydantic-settings-export/)
![Pepy Total Downloads](https://img.shields.io/pepy/dt/pydantic-settings-export)

*Export your Pydantic settings to Markdown and .env.example files!*

This package provides a way to use [pydantic](https://docs.pydantic.dev/) (and [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/)) models to generate a Markdown file with the settings and their descriptions, and a `.env.example` file with the settings and their default values.

## Installation

```bash
pip install pydantic-settings-export
# or
pipx install pydantic-settings-export  # for a global installation and using as a CLI
# or
uv tool install pydantic-settings-export
```

## Usage

You can see the usage examples of this package in the [./docs/Configuration.md](https://github.com/jag-k/pydantic-settings-export/blob/main/docs/Configuration.md) and [.env.example](https://github.com/jag-k/pydantic-settings-export/blob/main/.env.example).

### As code

```python
from pydantic import BaseSettings
from pydantic_settings_export import Exporter, MarkdownSettings, Settings as PSESettings


class Settings(BaseSettings):
  my_setting: str = "default value"
  another_setting: int = 42


# Export the settings to a Markdown file `docs/Configuration.md` and `.env.example` file
Exporter(
  PSESettings(
    markdown=MarkdownSettings(
      save_dirs=["docs"],
    ),
  ),
).run_all(Settings)
```

### As CLI

```bash
pydantic-settings-export --help
```

## Configuration

You can add a `pydantic_settings_export` section to your `pyproject.toml` file to configure the exporter.

```toml

[tool.pydantic_settings_export]
project_dir = "."
default_settings = [
  "pydantic_settings_export.settings:Settings",
]
dotenv = { "name" = ".env.example" }

[tool.pydantic_settings_export.markdown]
name = "Configuration.md"
save_dirs = [
  "docs",
  "wiki",
]
```

## Todo

- [ ] Add tests
- [ ] Add more configuration options
- [ ] Add more output formats
  - [ ] TOML (and `pyproject.toml`)
  - [ ] JSON
  - [ ] YAML


## License

[MIT](https://github.com/jag-k/pydantic-settings-export/blob/main/LICENCE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pydantic-settings-export",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "config, dotenv, export, markdown, pydantic, settings",
    "author": null,
    "author_email": "Jag_k <30597878+jag-k@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/d3/b8/607288098b3aeab6d0ed228614cff81bf86179a231a75e963e5210eefa38/pydantic_settings_export-0.3.6.tar.gz",
    "platform": null,
    "description": "# pydantic-settings-export\n\n[![PyPI version](https://img.shields.io/pypi/v/pydantic-settings-export?logo=pypi&label=pydantic-settings-export)](https://pypi.org/project/pydantic-settings-export/)\n![Pepy Total Downloads](https://img.shields.io/pepy/dt/pydantic-settings-export)\n\n*Export your Pydantic settings to Markdown and .env.example files!*\n\nThis package provides a way to use [pydantic](https://docs.pydantic.dev/) (and [pydantic-settings](https://docs.pydantic.dev/latest/concepts/pydantic_settings/)) models to generate a Markdown file with the settings and their descriptions, and a `.env.example` file with the settings and their default values.\n\n## Installation\n\n```bash\npip install pydantic-settings-export\n# or\npipx install pydantic-settings-export  # for a global installation and using as a CLI\n# or\nuv tool install pydantic-settings-export\n```\n\n## Usage\n\nYou can see the usage examples of this package in the [./docs/Configuration.md](https://github.com/jag-k/pydantic-settings-export/blob/main/docs/Configuration.md) and [.env.example](https://github.com/jag-k/pydantic-settings-export/blob/main/.env.example).\n\n### As code\n\n```python\nfrom pydantic import BaseSettings\nfrom pydantic_settings_export import Exporter, MarkdownSettings, Settings as PSESettings\n\n\nclass Settings(BaseSettings):\n  my_setting: str = \"default value\"\n  another_setting: int = 42\n\n\n# Export the settings to a Markdown file `docs/Configuration.md` and `.env.example` file\nExporter(\n  PSESettings(\n    markdown=MarkdownSettings(\n      save_dirs=[\"docs\"],\n    ),\n  ),\n).run_all(Settings)\n```\n\n### As CLI\n\n```bash\npydantic-settings-export --help\n```\n\n## Configuration\n\nYou can add a `pydantic_settings_export` section to your `pyproject.toml` file to configure the exporter.\n\n```toml\n\n[tool.pydantic_settings_export]\nproject_dir = \".\"\ndefault_settings = [\n  \"pydantic_settings_export.settings:Settings\",\n]\ndotenv = { \"name\" = \".env.example\" }\n\n[tool.pydantic_settings_export.markdown]\nname = \"Configuration.md\"\nsave_dirs = [\n  \"docs\",\n  \"wiki\",\n]\n```\n\n## Todo\n\n- [ ] Add tests\n- [ ] Add more configuration options\n- [ ] Add more output formats\n  - [ ] TOML (and `pyproject.toml`)\n  - [ ] JSON\n  - [ ] YAML\n\n\n## License\n\n[MIT](https://github.com/jag-k/pydantic-settings-export/blob/main/LICENCE)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Jag_k  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Export your Pydantic settings to a Markdown and .env.example files!",
    "version": "0.3.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/jag-k/pydantic-settings-export/issues",
        "Documentation": "https://github.com/jag-k/pydantic-settings-export#readme",
        "Homepage": "https://github.com/jag-k/pydantic-settings-export"
    },
    "split_keywords": [
        "config",
        " dotenv",
        " export",
        " markdown",
        " pydantic",
        " settings"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2cbe97fa7708fd160ef05d3285b26a1d8e07ff3a8694ca2ba36a0b4b3bb7d7d2",
                "md5": "086b8d68735167fc37bf18ab9b2c5e86",
                "sha256": "ee50b7a220a4e6a191427043d4874b1edcbdb47c5339ba2bc65a569e157f2c2a"
            },
            "downloads": -1,
            "filename": "pydantic_settings_export-0.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "086b8d68735167fc37bf18ab9b2c5e86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 16963,
            "upload_time": "2024-11-27T12:05:10",
            "upload_time_iso_8601": "2024-11-27T12:05:10.447829Z",
            "url": "https://files.pythonhosted.org/packages/2c/be/97fa7708fd160ef05d3285b26a1d8e07ff3a8694ca2ba36a0b4b3bb7d7d2/pydantic_settings_export-0.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d3b8607288098b3aeab6d0ed228614cff81bf86179a231a75e963e5210eefa38",
                "md5": "4f754e5fb41de6e23593c1286c902977",
                "sha256": "d2f140d8f6db618c27fba3de9bd9814f08cb85c6283fed62ddd5dda8c40aeb2a"
            },
            "downloads": -1,
            "filename": "pydantic_settings_export-0.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "4f754e5fb41de6e23593c1286c902977",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 30715,
            "upload_time": "2024-11-27T12:05:11",
            "upload_time_iso_8601": "2024-11-27T12:05:11.497963Z",
            "url": "https://files.pythonhosted.org/packages/d3/b8/607288098b3aeab6d0ed228614cff81bf86179a231a75e963e5210eefa38/pydantic_settings_export-0.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-27 12:05:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jag-k",
    "github_project": "pydantic-settings-export",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pydantic-settings-export"
}
        
Elapsed time: 0.36722s