toml-adapt
A simple command-line interface (CLI) for manipulating toml files
🚀 Features • 🛠️ Supported packaging tools • 📦 Installation • 🚀 Usage • 📄 Cite us • 🔑 License • ✨ Contributors
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. ⚙️📄🛠️
- 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.
🚀 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
To install toml-adapt with pip, use:
pip install toml-adapt
Fedora Linux
To install toml-adapt on Fedora, use:
$ dnf install python-toml-adapt
Alpine Linux
To install toml-adapt on Alpine Linux, use:
$ apk add toml-adapt
Arch Linux
To install toml-adapt on Arch Linux, use an AUR helper:
$ 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
toml-adapt -path pyproject.toml -a change -dep niaclass -ver 0.1.0
Add dependency
toml-adapt -path pyproject.toml -a add -dep niaclass -ver 0.1.0
Remove dependency
toml-adapt -path pyproject.toml -a remove -dep niaclass -ver 0.1.0
Other examples
Change all existing dependencies in toml file
toml-adapt -path pyproject.toml -a change -dep ALL -ver X
X represents a *
How to use it in SPEC files?
%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
🔑 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):
Iztok Fister Jr. 💻 📦 💡 🤔 🧑🏫 📖 |
StrajnarFilip 💻 ⚠️ 🤔 💡 |
Ben Beasley 📖 📦 |
Tomasz Kłoczko 🐛 |
Oromion 📦 |
Tadej Lahovnik 📖 ✅ |
This project follows the all-contributors specification. Contributions of any kind welcome!
Metadata
Release files for toml-adapt 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| toml_adapt-0.3.4.tar.gz | 11.7 kB | Without provenance | Details for toml_adapt-0.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| toml_adapt-0.3.4-py3-none-any.whl | Python 3 | none | any | Details for toml_adapt-0.3.4-py3-none-any.whl |
Total release size: 23.6 kB
Release files / toml_adapt-0.3.4.tar.gz
| Download URL | toml_adapt-0.3.4.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92f4f164665b307522e8648489a9c31387e6815931a67f9083aa4ecb2197d97d
|
|
BLAKE2b-256 checksum How to use checksums |
f986861e0ad1f06f16092879d7e1c02a24976812e67f864ac14bc3e113c16d5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.13.1 Linux/6.12.11-200.fc41.x86_64
|
Release files / toml_adapt-0.3.4-py3-none-any.whl
| Download URL | toml_adapt-0.3.4-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
528160a40dfad24220c80c3b591e9d0b32bb7a182da8449137aefa37ab0aac54
|
|
BLAKE2b-256 checksum How to use checksums |
125fdc1460c0007a32199a102204da473899d08c0a309e8cd850ca34dc8e816f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.13.1 Linux/6.12.11-200.fc41.x86_64
|
Security for toml-adapt 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.