toml-adapt


Nametoml-adapt JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/firefly-cpp/toml-adapt
SummaryA simple command-line interface for manipulating toml files
upload_time2024-01-10 14:26:37
maintainer
docs_urlNone
authorIztok Fister Jr.
requires_python>=3.6,<4.0
licenseMIT
keywords adaptation data manipulation flit poetry toml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # toml-adapt ---  A simple command-line interface (CLI) for manipulating toml files

---
[![PyPI Version](https://img.shields.io/pypi/v/toml-adapt.svg)](https://pypi.python.org/pypi/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/toml-adapt.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/toml-adapt.svg)
[![Documentation Status](https://readthedocs.org/projects/toml-adapt/badge/?version=latest)](https://toml-adapt.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/toml-adapt)](https://pepy.tech/project/toml-adapt)
[![GitHub license](https://img.shields.io/github/license/firefly-cpp/toml-adapt.svg)](https://github.com/firefly-cpp/toml-adapt/blob/master/LICENSE)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/toml-adapt.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/toml-adapt.svg)](http://isitmaintained.com/project/firefly-cpp/toml-adapt "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/toml-adapt.svg)](http://isitmaintained.com/project/firefly-cpp/toml-adapt "Percentage of issues still open")
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
[![Fedora package](https://img.shields.io/fedora/v/python3-toml-adapt?color=blue&label=Fedora%20Linux&logo=fedora)](https://src.fedoraproject.org/rpms/python-toml-adapt)
[![AUR package](https://img.shields.io/aur/version/toml-adapt?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/toml-adapt)
[![Packaging status](https://repology.org/badge/tiny-repos/toml-adapt.svg)](https://repology.org/project/toml-adapt/versions)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10467167.svg)](https://doi.org/10.5281/zenodo.10467167)

* **Free software:** MIT license
* **Python versions:** 3.8.x, 3.9.x, 3.10.x, 3.11.x, 3.12.x
* **Documentation:** https://toml-adapt.readthedocs.io/en/latest/
* **Tested OS:** Windows, Ubuntu, Debian, Fedora, Alpine, Arch, macOS. **However, that does not mean it does not work on others.**

## Description 📋
Working with TOML files is becoming inevitable during the package maintenance process in different ecosystems. 🌐 Many times package maintainers must either change the version of dependency or add/remove dependencies when building their packages, due to the inconsistent base system. For example, solving this issue can be done either by using the provided patches or using sed commands. However, this may be slightly time-consuming and irritating. ⏳ A very simple yet user-friendly command line interface was developed in order to make this process easier. ⚙️📄🛠️

### Features 🚀

CLI currently supports the following operations:

- adding/removing dependencies
- changing the  dependency version
- changing the dependency versions of all packages concurrently
- adding/removing/changing dev dependencies

### Supported packaging tools 🛠️

The following packaging tools are currently supported by this software:

- poetry
- flit
- cargo
- julia (partly)

## Installation 📦

### pip3

Install toml-adapt with pip:

```sh
pip install toml-adapt
```

### Fedora Linux

To install toml-adapt on Fedora, use:

```sh
$ dnf install python-toml-adapt
```

### Alpine Linux

To install toml-adapt on Alpine Linux, use:

```sh
$ apk add toml-adapt
```

### Arch Linux

To install toml-adapt on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):

```sh
$ yay -Syyu toml-adapt
```

## Usage

`-a` Available actions are:
- add
- remove
- change
- add-dev
- remove-dev
- change-dev

`-path` Specifies the path to the TOML file you wish to edit.

`-dep` This option sets the name of dependency you wish to manipulate. Reserved keyword `ALL` will instead do action on all dependencies. 

`-ver` This option sets the version. With Python Poetry, there is reserved keyword `X`, which will become `*` (meaning it accepts any version of dependency).

The following are examples of usage:

### Change dependency
```sh
toml-adapt -path pyproject.toml -a change -dep niaclass -ver 0.1.0
```

### Add dependency
```sh
toml-adapt -path pyproject.toml -a add -dep niaclass -ver 0.1.0
```

### Remove dependency
```sh
toml-adapt -path pyproject.toml -a remove -dep niaclass -ver 0.1.0
```

### Other examples

Change all existing dependencies in toml file
```sh
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
```
X represents a *

### How to use it in SPEC files?

```sh
%prep
...
	
## Make dependencies consistent with Fedora dependencies
	
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
```

## Cite us

Fister, Jr., I., & Strajnar, F. (2024). firefly-cpp/toml-adapt: 0.3.1 (0.3.1). Zenodo. [https://doi.org/10.5281/zenodo.10467167](https://doi.org/10.5281/zenodo.10467167)

## License

This package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.

## Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center" valign="top" width="14.28%"><a href="http://www.iztok-jr-fister.eu/"><img src="https://avatars.githubusercontent.com/u/1633361?v=4?s=100" width="100px;" alt="Iztok Fister Jr."/><br /><sub><b>Iztok Fister Jr.</b></sub></a><br /><a href="https://github.com/firefly-cpp/toml-adapt/commits?author=firefly-cpp" title="Code">💻</a> <a href="#platform-firefly-cpp" title="Packaging/porting to new platform">📦</a> <a href="#example-firefly-cpp" title="Examples">💡</a> <a href="#ideas-firefly-cpp" title="Ideas, Planning, & Feedback">🤔</a> <a href="#mentoring-firefly-cpp" title="Mentoring">🧑‍🏫</a> <a href="https://github.com/firefly-cpp/toml-adapt/commits?author=firefly-cpp" title="Documentation">📖</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/StrajnarFilip"><img src="https://avatars.githubusercontent.com/u/46705237?v=4?s=100" width="100px;" alt="StrajnarFilip"/><br /><sub><b>StrajnarFilip</b></sub></a><br /><a href="https://github.com/firefly-cpp/toml-adapt/commits?author=StrajnarFilip" title="Code">💻</a> <a href="https://github.com/firefly-cpp/toml-adapt/commits?author=StrajnarFilip" title="Tests">⚠️</a> <a href="#ideas-StrajnarFilip" title="Ideas, Planning, & Feedback">🤔</a> <a href="#example-StrajnarFilip" title="Examples">💡</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/musicinmybrain"><img src="https://avatars.githubusercontent.com/u/6898909?v=4?s=100" width="100px;" alt="Ben Beasley"/><br /><sub><b>Ben Beasley</b></sub></a><br /><a href="https://github.com/firefly-cpp/toml-adapt/commits?author=musicinmybrain" title="Documentation">📖</a> <a href="#platform-musicinmybrain" title="Packaging/porting to new platform">📦</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/kloczek"><img src="https://avatars.githubusercontent.com/u/31284574?v=4?s=100" width="100px;" alt="Tomasz Kłoczko"/><br /><sub><b>Tomasz Kłoczko</b></sub></a><br /><a href="https://github.com/firefly-cpp/toml-adapt/issues?q=author%3Akloczek" title="Bug reports">🐛</a></td>
      <td align="center" valign="top" width="14.28%"><a href="http://carlosal1015.github.io"><img src="https://avatars.githubusercontent.com/u/21283014?v=4?s=100" width="100px;" alt="Oromion"/><br /><sub><b>Oromion</b></sub></a><br /><a href="#platform-carlosal1015" title="Packaging/porting to new platform">📦</a></td>
      <td align="center" valign="top" width="14.28%"><a href="https://github.com/lahovniktadej"><img src="https://avatars.githubusercontent.com/u/57890734?v=4?s=100" width="100px;" alt="Tadej Lahovnik"/><br /><sub><b>Tadej Lahovnik</b></sub></a><br /><a href="https://github.com/firefly-cpp/toml-adapt/commits?author=lahovniktadej" title="Documentation">📖</a> <a href="#tutorial-lahovniktadej" title="Tutorials">✅</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/firefly-cpp/toml-adapt",
    "name": "toml-adapt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4.0",
    "maintainer_email": "",
    "keywords": "adaptation,data manipulation,flit,poetry,toml",
    "author": "Iztok Fister Jr.",
    "author_email": "iztok@iztok-jr-fister.eu",
    "download_url": "https://files.pythonhosted.org/packages/8c/4f/ec1875c5e3b982ed8006158e7772c4c4e148aa26d08c5a14d7561b6973b1/toml_adapt-0.3.0.tar.gz",
    "platform": null,
    "description": "# toml-adapt ---  A simple command-line interface (CLI) for manipulating toml files\n\n---\n[![PyPI Version](https://img.shields.io/pypi/v/toml-adapt.svg)](https://pypi.python.org/pypi/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/toml-adapt.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/toml-adapt.svg)\n[![Documentation Status](https://readthedocs.org/projects/toml-adapt/badge/?version=latest)](https://toml-adapt.readthedocs.io/en/latest/?badge=latest)\n[![Downloads](https://pepy.tech/badge/toml-adapt)](https://pepy.tech/project/toml-adapt)\n[![GitHub license](https://img.shields.io/github/license/firefly-cpp/toml-adapt.svg)](https://github.com/firefly-cpp/toml-adapt/blob/master/LICENSE)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/w/firefly-cpp/toml-adapt.svg)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/firefly-cpp/toml-adapt.svg)](http://isitmaintained.com/project/firefly-cpp/toml-adapt \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/firefly-cpp/toml-adapt.svg)](http://isitmaintained.com/project/firefly-cpp/toml-adapt \"Percentage of issues still open\")\n[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)\n[![Fedora package](https://img.shields.io/fedora/v/python3-toml-adapt?color=blue&label=Fedora%20Linux&logo=fedora)](https://src.fedoraproject.org/rpms/python-toml-adapt)\n[![AUR package](https://img.shields.io/aur/version/toml-adapt?color=blue&label=Arch%20Linux&logo=arch-linux)](https://aur.archlinux.org/packages/toml-adapt)\n[![Packaging status](https://repology.org/badge/tiny-repos/toml-adapt.svg)](https://repology.org/project/toml-adapt/versions)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10467167.svg)](https://doi.org/10.5281/zenodo.10467167)\n\n* **Free software:** MIT license\n* **Python versions:** 3.8.x, 3.9.x, 3.10.x, 3.11.x, 3.12.x\n* **Documentation:** https://toml-adapt.readthedocs.io/en/latest/\n* **Tested OS:** Windows, Ubuntu, Debian, Fedora, Alpine, Arch, macOS. **However, that does not mean it does not work on others.**\n\n## Description \ud83d\udccb\nWorking with TOML files is becoming inevitable during the package maintenance process in different ecosystems. \ud83c\udf10 Many times package maintainers must either change the version of dependency or add/remove dependencies when building their packages, due to the inconsistent base system. For example, solving this issue can be done either by using the provided patches or using sed commands. However, this may be slightly time-consuming and irritating. \u23f3 A very simple yet user-friendly command line interface was developed in order to make this process easier. \u2699\ufe0f\ud83d\udcc4\ud83d\udee0\ufe0f\n\n### Features \ud83d\ude80\n\nCLI currently supports the following operations:\n\n- adding/removing dependencies\n- changing the  dependency version\n- changing the dependency versions of all packages concurrently\n- adding/removing/changing dev dependencies\n\n### Supported packaging tools \ud83d\udee0\ufe0f\n\nThe following packaging tools are currently supported by this software:\n\n- poetry\n- flit\n- cargo\n- julia (partly)\n\n## Installation \ud83d\udce6\n\n### pip3\n\nInstall toml-adapt with pip:\n\n```sh\npip install toml-adapt\n```\n\n### Fedora Linux\n\nTo install toml-adapt on Fedora, use:\n\n```sh\n$ dnf install python-toml-adapt\n```\n\n### Alpine Linux\n\nTo install toml-adapt on Alpine Linux, use:\n\n```sh\n$ apk add toml-adapt\n```\n\n### Arch Linux\n\nTo install toml-adapt on Arch Linux, please use an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers):\n\n```sh\n$ yay -Syyu toml-adapt\n```\n\n## Usage\n\n`-a` Available actions are:\n- add\n- remove\n- change\n- add-dev\n- remove-dev\n- change-dev\n\n`-path` Specifies the path to the TOML file you wish to edit.\n\n`-dep` This option sets the name of dependency you wish to manipulate. Reserved keyword `ALL` will instead do action on all dependencies. \n\n`-ver` This option sets the version. With Python Poetry, there is reserved keyword `X`, which will become `*` (meaning it accepts any version of dependency).\n\nThe following are examples of usage:\n\n### Change dependency\n```sh\ntoml-adapt -path pyproject.toml -a change -dep niaclass -ver 0.1.0\n```\n\n### Add dependency\n```sh\ntoml-adapt -path pyproject.toml -a add -dep niaclass -ver 0.1.0\n```\n\n### Remove dependency\n```sh\ntoml-adapt -path pyproject.toml -a remove -dep niaclass -ver 0.1.0\n```\n\n### Other examples\n\nChange all existing dependencies in toml file\n```sh\ntoml-adapt -path pyproject.toml -a change -dep ALL -ver X\n```\nX represents a *\n\n### How to use it in SPEC files?\n\n```sh\n%prep\n...\n\t\n## Make dependencies consistent with Fedora dependencies\n\t\ntoml-adapt -path pyproject.toml -a change -dep ALL -ver X\n```\n\n## Cite us\n\nFister, Jr., I., & Strajnar, F. (2024). firefly-cpp/toml-adapt: 0.3.1 (0.3.1). Zenodo. [https://doi.org/10.5281/zenodo.10467167](https://doi.org/10.5281/zenodo.10467167)\n\n## License\n\nThis package is distributed under the MIT License. This license can be found online at <http://www.opensource.org/licenses/MIT>.\n\n## Disclaimer\n\nThis framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!\n\n## Contributors \u2728\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://www.iztok-jr-fister.eu/\"><img src=\"https://avatars.githubusercontent.com/u/1633361?v=4?s=100\" width=\"100px;\" alt=\"Iztok Fister Jr.\"/><br /><sub><b>Iztok Fister Jr.</b></sub></a><br /><a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=firefly-cpp\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#platform-firefly-cpp\" title=\"Packaging/porting to new platform\">\ud83d\udce6</a> <a href=\"#example-firefly-cpp\" title=\"Examples\">\ud83d\udca1</a> <a href=\"#ideas-firefly-cpp\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#mentoring-firefly-cpp\" title=\"Mentoring\">\ud83e\uddd1\u200d\ud83c\udfeb</a> <a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=firefly-cpp\" title=\"Documentation\">\ud83d\udcd6</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/StrajnarFilip\"><img src=\"https://avatars.githubusercontent.com/u/46705237?v=4?s=100\" width=\"100px;\" alt=\"StrajnarFilip\"/><br /><sub><b>StrajnarFilip</b></sub></a><br /><a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=StrajnarFilip\" title=\"Code\">\ud83d\udcbb</a> <a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=StrajnarFilip\" title=\"Tests\">\u26a0\ufe0f</a> <a href=\"#ideas-StrajnarFilip\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#example-StrajnarFilip\" title=\"Examples\">\ud83d\udca1</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/musicinmybrain\"><img src=\"https://avatars.githubusercontent.com/u/6898909?v=4?s=100\" width=\"100px;\" alt=\"Ben Beasley\"/><br /><sub><b>Ben Beasley</b></sub></a><br /><a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=musicinmybrain\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#platform-musicinmybrain\" title=\"Packaging/porting to new platform\">\ud83d\udce6</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/kloczek\"><img src=\"https://avatars.githubusercontent.com/u/31284574?v=4?s=100\" width=\"100px;\" alt=\"Tomasz K\u0142oczko\"/><br /><sub><b>Tomasz K\u0142oczko</b></sub></a><br /><a href=\"https://github.com/firefly-cpp/toml-adapt/issues?q=author%3Akloczek\" title=\"Bug reports\">\ud83d\udc1b</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://carlosal1015.github.io\"><img src=\"https://avatars.githubusercontent.com/u/21283014?v=4?s=100\" width=\"100px;\" alt=\"Oromion\"/><br /><sub><b>Oromion</b></sub></a><br /><a href=\"#platform-carlosal1015\" title=\"Packaging/porting to new platform\">\ud83d\udce6</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/lahovniktadej\"><img src=\"https://avatars.githubusercontent.com/u/57890734?v=4?s=100\" width=\"100px;\" alt=\"Tadej Lahovnik\"/><br /><sub><b>Tadej Lahovnik</b></sub></a><br /><a href=\"https://github.com/firefly-cpp/toml-adapt/commits?author=lahovniktadej\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#tutorial-lahovniktadej\" title=\"Tutorials\">\u2705</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A simple command-line interface for manipulating toml files",
    "version": "0.3.0",
    "project_urls": {
        "Documentation": "https://toml-adapt.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/firefly-cpp/toml-adapt",
        "Repository": "https://github.com/firefly-cpp/toml-adapt"
    },
    "split_keywords": [
        "adaptation",
        "data manipulation",
        "flit",
        "poetry",
        "toml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "14297ed53d093867436f04699bfccc11f510f7ccc7cdf2eda8ed2991ae415c41",
                "md5": "4fa82063a5a1994679d16e2f57728cb9",
                "sha256": "139c79ee45361715e7eaccdcfe7a4381383dd499e106c51ecafe4a3bb28f7df4"
            },
            "downloads": -1,
            "filename": "toml_adapt-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4fa82063a5a1994679d16e2f57728cb9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4.0",
            "size": 11404,
            "upload_time": "2024-01-10T14:26:34",
            "upload_time_iso_8601": "2024-01-10T14:26:34.827601Z",
            "url": "https://files.pythonhosted.org/packages/14/29/7ed53d093867436f04699bfccc11f510f7ccc7cdf2eda8ed2991ae415c41/toml_adapt-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c4fec1875c5e3b982ed8006158e7772c4c4e148aa26d08c5a14d7561b6973b1",
                "md5": "1a53f0fc6db034e7f3f2dc1d02d44019",
                "sha256": "5237e6c8cb337c39d223ffe3525c93d99f7319a31f292369141ef4ca6058e2e7"
            },
            "downloads": -1,
            "filename": "toml_adapt-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1a53f0fc6db034e7f3f2dc1d02d44019",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4.0",
            "size": 11294,
            "upload_time": "2024-01-10T14:26:37",
            "upload_time_iso_8601": "2024-01-10T14:26:37.071460Z",
            "url": "https://files.pythonhosted.org/packages/8c/4f/ec1875c5e3b982ed8006158e7772c4c4e148aa26d08c5a14d7561b6973b1/toml_adapt-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-10 14:26:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "firefly-cpp",
    "github_project": "toml-adapt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "toml-adapt"
}
        
Elapsed time: 0.35893s