https://github.com/librariesio/conda-parser
Parse a Conda environment.yml file by POSTing it to this api.
https://github.com/librariesio/conda-parser
Last synced: 8 months ago
JSON representation
Parse a Conda environment.yml file by POSTing it to this api.
- Host: GitHub
- URL: https://github.com/librariesio/conda-parser
- Owner: librariesio
- License: agpl-3.0
- Created: 2019-08-09T20:14:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-12-22T13:31:21.000Z (over 4 years ago)
- Last Synced: 2025-04-02T06:22:19.534Z (about 1 year ago)
- Language: Python
- Homepage: https://www.tidelift.com/
- Size: 142 KB
- Stars: 3
- Watchers: 13
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Conda parser
A tiny python web service for parsing dependency information from `environment.yml` files for [Libraries.io](https://libraries.io).
## Parsing
We use Conda.models.MatchSpec to do version matching, as such, environment.yml dependencies should match one of the following formats in order to parse properly.
* `numpy`
* `numpy 1.8.*`
* `numpy 1.8*`
* `numpy 1.8.1`
* `numpy >=1.8`
* `numpy ==1.8.1`
* `numpy 1.8|1.8*`
* `numpy >=1.8,<2`
* `numpy >=1.8,<2|1.9`
* `numpy 1.8.1 py27_0`
* `numpy=1.8.1=py27_0`
## Building and running options.
### Docker
You can use Docker to run conda-parser
First, install Docker. If you run macOS or Windows, Docker for Mac/Windows makes this really easy. (If you have Windows Home Edition, you'll need to download and run Docker Toolbox.)
Then, run:
$ docker pull librariesio/conda-parser
$ docker run -it -e PORT=5000 -p 5000:5000 librariesio/conda-parser
conda-parser will be running on http://localhost:5000.
To build the docker image locally:
$ docker build -t librariesio/conda-parser .
Note: The Dockerfile has `./gunicorn_start.sh` as it's CMD so this can be overridden with `/bin/bash` if you'd like to poke around:
$ docker run -it librariesio/conda-parser /bin/bash
### Docker Compose
Docker Compose makes this a lot easier, but there's one minor setup if using Docker for MacOS.
You must add the directory your cloned this to in the Docker Desktop -> Preferences -> File Sharing -> [+] and Add the directory.
Then you can run
$ docker-compose build
$ docker-compose up
The server will be running, and any time you want to make a change to the code, you can just quit the `docker-compose up` process and re-run it. The new code will be reloaded. Because the `Dockerfile` and `gunicorn_start.sh` run Gunicorn, it won't auto reload when files are changed.
## Consuming the API
You can test that it works by running one of these curl commands:
```console
$ curl -X POST -F "file=@environment.yml" http://localhost:5000/parse # Post multipart
$ curl -X POST -F "file=