{"id":40501228,"url":"https://github.com/sarugaku/requirementslib","last_synced_at":"2026-01-20T19:08:38.949Z","repository":{"id":39613772,"uuid":"132834642","full_name":"sarugaku/requirementslib","owner":"sarugaku","description":"A tool for converting between pip-style and pipfile requirements - maintained by the pipenv team","archived":false,"fork":false,"pushed_at":"2023-06-18T11:42:46.000Z","size":2556,"stargazers_count":86,"open_issues_count":17,"forks_count":30,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-06T03:10:47.034Z","etag":null,"topics":["pip","pipenv","pipfile","python","requirements"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sarugaku.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["techalchemy","uranusjr"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2018-05-10T01:57:42.000Z","updated_at":"2025-06-13T12:20:12.000Z","dependencies_parsed_at":"2024-06-18T16:41:44.614Z","dependency_job_id":"e54e172a-bca6-4619-a826-c624c6889808","html_url":"https://github.com/sarugaku/requirementslib","commit_stats":{"total_commits":1021,"total_committers":30,"mean_commits":34.03333333333333,"dds":"0.44270323212536733","last_synced_commit":"591f194bb67d7b4124483ca62fdda8cd19088a86"},"previous_names":[],"tags_count":85,"template":false,"template_full_name":null,"purl":"pkg:github/sarugaku/requirementslib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarugaku%2Frequirementslib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarugaku%2Frequirementslib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarugaku%2Frequirementslib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarugaku%2Frequirementslib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarugaku","download_url":"https://codeload.github.com/sarugaku/requirementslib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarugaku%2Frequirementslib/sbom","scorecard":{"id":800922,"data":{"date":"2025-08-11","repo":{"name":"github.com/sarugaku/requirementslib","commit":"591f194bb67d7b4124483ca62fdda8cd19088a86"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Code-Review","score":3,"reason":"Found 1/3 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/pypi_upload.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: tests/artifacts/six/six-1.11.0-py2.py3-none-any.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp27-cp27m-macosx_10_9_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp27-cp27m-win32.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp27-cp27m-win_amd64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp27-cp27mu-manylinux1_i686.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp27-cp27mu-manylinux1_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp35-cp35m-macosx_10_9_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp35-cp35m-manylinux1_i686.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp35-cp35m-manylinux1_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp35-cp35m-win32.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp35-cp35m-win_amd64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp36-cp36m-macosx_10_9_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp36-cp36m-manylinux1_i686.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp36-cp36m-manylinux1_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp36-cp36m-win32.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp36-cp36m-win_amd64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp37-cp37m-macosx_10_9_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp37-cp37m-manylinux1_i686.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp37-cp37m-manylinux1_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp37-cp37m-win32.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp37-cp37m-win_amd64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp38-cp38-macosx_10_9_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp38-cp38-manylinux1_i686.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp38-cp38-manylinux1_x86_64.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp38-cp38-win32.whl:1","Warn: binary detected: tests/fixtures/wheels/llvmlite/llvmlite-0.30.0-cp38-cp38-win_amd64.whl:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi_upload.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/pypi_upload.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi_upload.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/pypi_upload.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi_upload.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/pypi_upload.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pypi_upload.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/pypi_upload.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pypi_upload.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/sarugaku/requirementslib/pypi_upload.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:70","Warn: pipCommand not pinned by hash: .github/workflows/pypi_upload.yml:38","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"43 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-421 / GHSA-h4m5-qpfp-3mpv","Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2021-865 / GHSA-vv2x-vrpj-qqpq","Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: GHSA-3ww4-gg4f-jr7f","Warn: Project is vulnerable to: GHSA-5cpq-8wj7-hf2v","Warn: Project is vulnerable to: GHSA-9v9h-cgj8-h64p","Warn: Project is vulnerable to: PYSEC-2023-254 / GHSA-jfhm-5ghh-2f97","Warn: Project is vulnerable to: GHSA-jm77-qphf-c4w8","Warn: Project is vulnerable to: PYSEC-2021-63 / GHSA-rhm9-p9w5-fwm7","Warn: Project is vulnerable to: GHSA-v8gr-m533-ghj9","Warn: Project is vulnerable to: GHSA-w7pp-m8wf-vj6r","Warn: Project is vulnerable to: GHSA-x4qr-2fvf-3mr5","Warn: Project is vulnerable to: PYSEC-2021-62","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: GHSA-55x5-fj6c-h6m8","Warn: Project is vulnerable to: PYSEC-2021-19 / GHSA-jq4v-f5q6-mjqq","Warn: Project is vulnerable to: PYSEC-2020-62 / GHSA-pgww-xf46-h92r","Warn: Project is vulnerable to: PYSEC-2022-230 / GHSA-wrxv-2j5q-m38w","Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: PYSEC-2021-140 / GHSA-9w8r-397f-prfh","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2021-141 / GHSA-pq64-v7f5-gqh8","Warn: Project is vulnerable to: PYSEC-2021-142 / GHSA-8q59-q68h-6hv4","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2021-108 / GHSA-q2q7-5pp4-w6pg","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T10:27:45.805Z","repository_id":39613772,"created_at":"2025-08-23T10:27:45.805Z","updated_at":"2025-08-23T10:27:45.805Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["pip","pipenv","pipfile","python","requirements"],"created_at":"2026-01-20T19:08:33.841Z","updated_at":"2026-01-20T19:08:38.930Z","avatar_url":"https://github.com/sarugaku.png","language":"Python","funding_links":["https://github.com/sponsors/techalchemy","https://github.com/sponsors/uranusjr"],"categories":[],"sub_categories":[],"readme":"RequirementsLib: Requirement Management Library for Pip and Pipenv\n\n.. image:: https://img.shields.io/pypi/v/requirementslib.svg\n    :target: https://pypi.org/project/requirementslib\n\n.. image:: https://img.shields.io/pypi/l/requirementslib.svg\n    :target: https://pypi.org/project/requirementslib\n\n.. image:: https://github.com/sarugaku/requirementslib/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/sarugaku/requirementslib/actions/workflows/ci.yml\n\n.. image:: https://img.shields.io/pypi/pyversions/requirementslib.svg\n    :target: https://pypi.org/project/requirementslib\n\n.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\n    :target: https://saythanks.io/to/techalchemy\n\n.. image:: https://readthedocs.org/projects/requirementslib/badge/?version=master\n    :target: http://requirementslib.readthedocs.io/en/master/?badge=master\n    :alt: Documentation Status\n\n🐉 Installation\n==================\n\nInstall from `PyPI`_:\n\n.. code:: console\n\n    $ pipenv install requirementslib\n\nInstall from `Github`_:\n\n.. code:: console\n\n    $ pipenv install -e git+https://github.com/sarugaku/requirementslib.git#egg=requirementslib\n\n\n.. _PyPI: https://www.pypi.org/project/requirementslib\n.. _Github: https://github.com/sarugaku/requirementslib\n\n\n.. _`Summary`:\n\n🐉 Summary\n============\n\nRequirementsLib provides a simple layer for building and interacting with\nrequirements in both the `Pipfile \u003chttps://github.com/pypa/pipfile/\u003e`_ format\nand the `requirements.txt \u003chttps://github.com/pypa/pip/\u003e`_ format.  This library\nwas originally built for converting between these formats in `Pipenv \u003chttps://github.com/pypa/pipenv\u003e`_.\n\n.. _`Usage`:\n\n🐉 Usage\n=========\n\nImporting a lockfile into your *setup.py* file\n-----------------------------------------------------\n\nYou can use RequirementsLib to import your lockfile into your setup file for including your\n**install_requires** dependencies:\n\n.. code-block:: pycon\n\n    from requirementslib import Lockfile\n    lockfile = Lockfile.create('/path/to/project/dir')\n    install_requires = lockfile.as_requirements(dev=False)\n\n\nInteracting with a *Pipfile* directly\n-------------------------------------------\n\nYou can also interact directly with a Pipfile:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from requirementslib import Pipfile\n    \u003e\u003e\u003e pf = Pipfile.load('/home/hawk/git/pypa-pipenv')\n    \u003e\u003e\u003e pf.sections\n    [Section(name='packages', requirements=[]), Section(name='dev-packages', requirements=[Requirement(name='pipenv', vcs=None, req=FileRequirement(setup_path=None, path='.', editable=True, uri='file:///home/hawk/git/pypa-pipenv', link=\u003cLink file:///home/hawk/git/pypa-pipenv\u003e, name='pipenv', req=\u003cRequirement: \"-e file:///home/hawk/git/pypa-pipenv\"\u003e), markers='', specifiers=None, index=None, editable=True, hashes=[], extras=None),...]\n\n\nAnd you can even write it back out into Pipfile's native format:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e print(pf.dump(to_dict=False))\n    [packages]\n\n    [dev-packages]\n    pipenv = {path = \".\", editable = true}\n    flake8 = \"\u003e=3.3.0,\u003c4\"\n    pytest = \"*\"\n    mock = \"*\"\n\n    [scripts]\n    tests = \"bash ./run-tests.sh\"\n\n    [pipenv]\n    allow_prereleases = true\n\n\nCreate a requirement object from *requirements.txt* format\n------------------------------------------------------------------\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from requirementslib import Requirement\n    \u003e\u003e\u003e r = Requirement.from_line('-e git+https://github.com/pypa/pipenv.git@master#egg=pipenv')\n    \u003e\u003e\u003e print(r)\n    Requirement(name='pipenv', vcs='git', req=VCSRequirement(editable=True, uri='git+https://github.com/pypa/pipenv.git', path=None, vcs='git', ref='master', subdirectory=None, name='pipenv', link=\u003cLink git+https://github.com/pypa/pipenv.git@master#egg=pipenv\u003e, req=\u003cRequirement: \"-e git+https://github.com/pypa/pipenv.git@master#egg=pipenv\"\u003e), markers=None, specifiers=None, index=None, editable=True, hashes=[], extras=[])\n\n    \u003e\u003e\u003e r.as_pipfile()\n    {'pipenv': {'editable': True, 'ref': 'master', 'git': 'https://github.com/pypa/pipenv.git'}}\n\n\nOr move from *Pipfile* format to *requirements.txt*:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e r = Requirement.from_pipfile(name='pythonfinder', indexes=[], pipfile={'path': '../pythonfinder', 'editable': True})\n    \u003e\u003e\u003e r.as_line()\n    '-e ../pythonfinder'\n\n\nResolving Editable Package Dependencies\n---------------------------------------------\n\nRequirementslib also can resolve the dependencies of editable packages by calling the ``run_requires`` method.\nThis method returns a detailed dictionary containing metadata parsed from the package built in\na transient folder (unless it is already on the system or the call is run in a virtualenv).\n\nThe output of ``run_requires`` is very detailed and in most cases will be sufficient:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from pprint import pprint\n    \u003e\u003e\u003e from requirementslib.models.requirements import Requirement\n    \u003e\u003e\u003e r = Requirement.from_line(\"-e git+git@github.com:sarugaku/vistir.git#egg=vistir[spinner]\")\n    \u003e\u003e\u003e setup_info_dict = r.run_requires()\n    \u003e\u003e\u003e from pprint import pprint\n    \u003e\u003e\u003e pprint(setup_info_dict)\n    {'base_dir': '/tmp/requirementslib-t_ftl6no-src/src/vistir',\n    'build_backend': 'setuptools.build_meta',\n    'build_requires': ['setuptools\u003e=36.2.2', 'wheel\u003e=0.28.0'],\n    'extra_kwargs': {'build_dir': '/tmp/requirementslib-t_ftl6no-src/src',\n                    'download_dir': '/home/hawk/.cache/pipenv/pkgs',\n                    'src_dir': '/tmp/requirementslib-t_ftl6no-src/src',\n                    'wheel_download_dir': '/home/hawk/.cache/pipenv/wheels'},\n    'extras': {'spinner': [Requirement.parse('cursor'),\n                            Requirement.parse('yaspin')],\n                'tests': [Requirement.parse('pytest'),\n                        Requirement.parse('pytest-xdist'),\n                        Requirement.parse('pytest-cov'),\n                        Requirement.parse('pytest-timeout'),\n                        Requirement.parse('hypothesis-fspaths'),\n                        Requirement.parse('hypothesis')]},\n    'ireq': \u003cInstallRequirement object: vistir[spinner] from git+ssh://git@github.com/sarugaku/vistir.git#egg=vistir editable=True\u003e,\n    'name': 'vistir',\n    'pyproject': PosixPath('/tmp/requirementslib-t_ftl6no-src/src/vistir/pyproject.toml'),\n    'python_requires': '\u003e=2.6,!=3.0,!=3.1,!=3.2,!=3.3',\n    'requires': {'backports.functools_lru_cache;python_version\u003c=\"3.4\"': Requirement.parse('backports.functools_lru_cache; python_version \u003c= \"3.4\"'),\n                'backports.shutil_get_terminal_size;python_version\u003c\"3.3\"': Requirement.parse('backports.shutil_get_terminal_size; python_version \u003c \"3.3\"'),\n                'backports.weakref;python_version\u003c\"3.3\"': Requirement.parse('backports.weakref; python_version \u003c \"3.3\"'),\n                'colorama': Requirement.parse('colorama'),\n                'pathlib2;python_version\u003c\"3.5\"': Requirement.parse('pathlib2; python_version \u003c \"3.5\"'),\n                'requests': Requirement.parse('requests'),\n                'six': Requirement.parse('six'),\n                'spinner': [Requirement.parse('cursor'),\n                            Requirement.parse('yaspin')]},\n    'setup_cfg': PosixPath('/tmp/requirementslib-t_ftl6no-src/src/vistir/setup.cfg'),\n    'setup_py': PosixPath('/tmp/requirementslib-t_ftl6no-src/src/vistir/setup.py')}\n\n\nAs a side-effect of calls to ``run_requires``, new metadata is made available on the\nrequirement itself via the property ``requirement.req.dependencies``:\n\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e pprint(r.req.dependencies)\n    ({'backports.functools_lru_cache;python_version\u003c=\"3.4\"': Requirement.parse('backports.functools_lru_cache; python_version \u003c= \"3.4\"'),\n    'backports.shutil_get_terminal_size;python_version\u003c\"3.3\"': Requirement.parse('backports.shutil_get_terminal_size; python_version \u003c \"3.3\"'),\n    'backports.weakref;python_version\u003c\"3.3\"': Requirement.parse('backports.weakref; python_version \u003c \"3.3\"'),\n    'colorama': Requirement.parse('colorama'),\n    'pathlib2;python_version\u003c\"3.5\"': Requirement.parse('pathlib2; python_version \u003c \"3.5\"'),\n    'requests': Requirement.parse('requests'),\n    'six': Requirement.parse('six'),\n    'spinner': [Requirement.parse('cursor'), Requirement.parse('yaspin')]},\n    [],\n    ['setuptools\u003e=36.2.2', 'wheel\u003e=0.28.0'])\n\n\n🐉 Integrations\n==================\n\n* `Pip \u003chttps://github.com/pypa/pip\u003e`_\n* `Pipenv \u003chttps://github.com/pypa/pipenv\u003e`_\n* `Pipfile`_\n\n🐉 Contributing\n===============\n\n1. Fork the repository and clone the fork to your local machine: ``git clone git@github.com:yourusername/requirementslib.git``\n\n2. Move into the repository directory and update the submodules: ``git submodule update --init --recursive``\n\n3. Install the package locally in a virtualenv using `pipenv \u003chttps://github.com/pypa/pipenv\u003e`_: ``pipenv install --dev``\n\n   a. You can also install the package into a `virtualenv \u003chttps://github.com/pypa/virtualenv\u003e`_ by running ``pip install -e .[dev,tests,typing]``\n      to ensure all the development and test dependencies are installed\n\n4. Before making any changes to the code, make sure to file an issue. The best way to ensure a smooth collaboration is to communicate *before*\n   investing significant time and energy into any changes! Make sure to consider not just your own use case but others who might be using the library\n\n5. Create a new branch. For bugs, you can simply branch to ``bugfix/\u003cissuenumber\u003e``. Features can be branched to ``feature/\u003cissuenumber\u003e``. This convention\n   is to streamline the branching process and to encourage good practices around filing issues and associating pull requests with specific issues. If you\n   find yourself addressing many issues in one pull request, that should give you pause\n\n6. Make your desired changes. Don't forget to add additional tests to account for your new code -- continuous integration **will** fail without it\n\n7. Test your changes by running ``pipenv run pytest -ra tests`` or simply ``pytest -ra tests`` if you are inside an activated virtual environment\n\n8. Create a corresponding ``.rst`` file in the ``news`` directory with a one sentence description of your change, e.g. ``Resolved an issue which sometimes prevented requirements from being converted from Pipfile entries to pip lines correctly``\n\n9. Commit your changes. The first line of your commit should be a summary of your changes, no longer than 72 characters, followed by a blank line, followed by a bulleted description of your changes.\n   Don't forget to add separate lines with the phrase ``- Fixes #\u003cissuenumber\u003e`` for each issue you are addressing in your pull request\n\n10. Before submitting your pull request, make sure to ``git remote add upstream git@github.com:sarugaku/requirementslib.git`` and then ``git fetch upstream \u0026\u0026 git pull upstream master`` to ensure your code is in sync with the latest version of the master branch,\n\n11. Create a pull request describing your fix, referencing the issues in question. If your commit message from step 8 was detailed, you should be able to copy and paste it\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarugaku%2Frequirementslib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarugaku%2Frequirementslib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarugaku%2Frequirementslib/lists"}