{"id":19339056,"url":"https://github.com/librariesio/conda-parser","last_synced_at":"2025-10-29T13:49:18.686Z","repository":{"id":52348176,"uuid":"201534323","full_name":"librariesio/conda-parser","owner":"librariesio","description":"Parse a Conda environment.yml file by POSTing it to this api.","archived":false,"fork":false,"pushed_at":"2021-12-22T13:31:21.000Z","size":145,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-02T06:22:19.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.tidelift.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/librariesio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-09T20:14:09.000Z","updated_at":"2022-12-22T02:07:17.000Z","dependencies_parsed_at":"2022-09-07T19:41:27.079Z","dependency_job_id":null,"html_url":"https://github.com/librariesio/conda-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librariesio%2Fconda-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librariesio%2Fconda-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librariesio%2Fconda-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/librariesio%2Fconda-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/librariesio","download_url":"https://codeload.github.com/librariesio/conda-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250357461,"owners_count":21417278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T03:19:39.489Z","updated_at":"2025-10-29T13:49:13.651Z","avatar_url":"https://github.com/librariesio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conda parser\n\nA tiny python web service for parsing dependency information from `environment.yml` files for [Libraries.io](https://libraries.io).\n\n## Parsing\n\nWe 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.\n\n  * `numpy`\n  * `numpy 1.8.*`\n  * `numpy 1.8*`\n  * `numpy 1.8.1`\n  * `numpy \u003e=1.8`\n  * `numpy ==1.8.1`\n  * `numpy 1.8|1.8*`\n  * `numpy \u003e=1.8,\u003c2`\n  * `numpy \u003e=1.8,\u003c2|1.9`\n  * `numpy 1.8.1 py27_0`\n  * `numpy=1.8.1=py27_0`\n\n\n## Building and running options.\n\n### Docker\n\nYou can use Docker to run conda-parser\n\nFirst, 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.)\n\nThen, run:\n\n    $ docker pull librariesio/conda-parser\n    $ docker run -it -e PORT=5000 -p 5000:5000 librariesio/conda-parser\n\nconda-parser will be running on http://localhost:5000.\n\nTo build the docker image locally:\n\n    $ docker build -t librariesio/conda-parser .\n\nNote: 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:\n\n    $ docker run -it librariesio/conda-parser /bin/bash\n\n### Docker Compose\n\nDocker Compose makes this a lot easier, but there's one minor setup if using Docker for MacOS.\nYou must add the directory your cloned this to in the Docker Desktop -\u003e Preferences -\u003e File Sharing -\u003e [+]  and Add the directory.\n\nThen you can run\n\n    $ docker-compose build\n    $ docker-compose up\n\nThe 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.\n\n## Consuming the API\n\nYou can test that it works by running one of these curl commands:\n\n```console\n$ curl -X POST -F \"file=@environment.yml\" http://localhost:5000/parse # Post multipart\n\n$ curl -X POST -F \"file=\u003cenvironment.yml;filename=environment.yml\" http://localhost:5000/parse # Post urlencoded\n```\n\nTo POST from something not curl (for example ruby `typhoeus`) please post a body with a file and a filename as such:\n\n```ruby\n# Post urlencoded\nTyphoeus.post(\"http://localhost:5000/parse\", body: {file: file_string, filename: 'environment.yml'})\n\n# post multipart\nTyphoeus.post(\"http://localhost:5000/parse\", body: {file: File.open(filename, \"r\")})\n```\n\n(Both `multipart/form-data` and `application/x-www-form-urlencoded` are supported)\n\n## Development\n\nMost of the logic is in [conda_parser/parse.py](conda_parser/parse.py), the rest of the files are Flask/Tests/Gunicorn support. This file is a good place to start looking at the code.\n\nSource hosted at [GitHub](http://github.com/librariesio/conda-parser).\nReport issues/feature requests on [GitHub Issues](http://github.com/librariesio/conda-parser/issues). Follow us on Twitter [@librariesio](https://twitter.com/librariesio). We also hangout on [Slack](http://slack.libraries.io).\n\nTo get started, install [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) or Miniconda, and then run:\n\n    $ conda env create -f environment.yml\n    $ conda activate conda-parser\n\nThis will create you a conda-parser environment with all the packages installed from conda, (if you wish to not use conda for some reason, a requirements.txt file is also provided to `pip install`). To run the code, run either of the following lines:\n\n    $ python flask_start.py\n    $ FLASK_APP=conda_parser flask run\n\n### Testing\n\nThis application uses `pytest` and `coverage.py`, to run tests, activate the conda environment and run one of the following lines:\n\n    $ pytest\n    $ pytest --cov=conda_parser\n    $ pytest --cov=conda_parser --cov-report html  # To get a pretty html report\n\n\n### Code Style\n\nWe use `black` for formatting.\n\n    $ black .\n\n### Note on Patches/Pull Requests\n\n * Fork the project.\n * Make your feature addition or bug fix.\n * Add tests if adding code.\n * Add documentation if necessary.\n * Make sure you run `black .` before submitting a pull request.\n * Send a pull request. Bonus points for topic branches.\n\n## Copyright\n\nCopyright (c) 2019 Tidelift. See [LICENSE](https://github.com/librariesio/conda-parser/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrariesio%2Fconda-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibrariesio%2Fconda-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibrariesio%2Fconda-parser/lists"}