Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tdegeus/conda_envfile
Parse conda environment yaml files
https://github.com/tdegeus/conda_envfile
conda conda-environment formatter parser pre-commit
Last synced: 11 days ago
JSON representation
Parse conda environment yaml files
- Host: GitHub
- URL: https://github.com/tdegeus/conda_envfile
- Owner: tdegeus
- License: mit
- Created: 2022-10-04T08:12:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T16:45:26.000Z (9 months ago)
- Last Synced: 2024-09-18T04:59:49.029Z (about 2 months ago)
- Topics: conda, conda-environment, formatter, parser, pre-commit
- Language: Python
- Homepage: https://conda_envfile.readthedocs.io
- Size: 82 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![ci](https://github.com/tdegeus/conda_envfile/workflows/CI/badge.svg)](https://github.com/tdegeus/conda_envfile/actions)
[![Documentation Status](https://readthedocs.org/projects/conda_envfile/badge/?version=latest)](https://conda_envfile.readthedocs.io/en/latest/?badge=latest)
[![pre-commit](https://github.com/tdegeus/conda_envfile/workflows/pre-commit/badge.svg)](https://github.com/tdegeus/conda_envfile/actions)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/conda_envfile.svg)](https://anaconda.org/conda-forge/conda_envfile)**Documentation: [https://conda_envfile.readthedocs.io](conda_envfile.readthedocs.io)**
# conda_envfile
Provides a Python library, command line tools, and pre-commit tools to manage conda environment files.
## Command line
### conda_envfile_merge
Merge different environment files.
For example:```bash
conda_envfile_merge -a "extra-library" env1.yml env2.yml > env3.yml
```merges `env1.yml` and `env2.yml` and adds the package `extra-library` to the merged environment file `env3.yml`.
### conda_envfile_diff
Show the difference between two environment files.
For example:```bash
conda_envfile_diff env1.yml env2.yml
```## pre-commit
### conda_envfile_parse
Keep your `environment.yaml` file unique, sorted, and legal in terms of version limitations.
In your `.pre-commit-config.yaml`, add:```yaml
- repo: https://github.com/tdegeus/conda_envfile
rev: v0.5.0
hooks:
- id: conda_envfile_parse
files: "environment.yaml"
```### conda_envfile_pyproject
Keep your `pyproject.toml` and `environment.yaml` in sync.
In your `.pre-commit-config.yaml`, add:```yaml
- repo: https://github.com/tdegeus/conda_envfile
rev: v0.5.0
hooks:
- id: conda_envfile_pyproject
files: "environment.yaml"
```## Python
Combine different version restrictions. For example:
```python
import conda_envfilelist(map(str, conda_envfile.unique("foo >1.2.0", "foo =1.2.*")))
```which returns
```python
["foo >1.2.0, <1.3.0"]
```