{"id":20325783,"url":"https://github.com/aboutcode-org/fetchcode","last_synced_at":"2026-01-27T23:49:05.680Z","repository":{"id":40404738,"uuid":"212758597","full_name":"aboutcode-org/fetchcode","owner":"aboutcode-org","description":"A library to reliably fetch code via HTTP, FTP and version control systems. This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ Google Summer of Code, nexB and others generous sponsors!","archived":false,"fork":false,"pushed_at":"2025-01-08T21:14:21.000Z","size":4629,"stargazers_count":11,"open_issues_count":47,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-14T20:40:42.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aboutcode-org.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.rst","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-04T07:24:32.000Z","updated_at":"2024-12-20T13:02:18.000Z","dependencies_parsed_at":"2023-12-19T00:00:12.958Z","dependency_job_id":"7b2f1b19-68f9-4e15-ba53-e3e8e216393c","html_url":"https://github.com/aboutcode-org/fetchcode","commit_stats":{"total_commits":304,"total_committers":24,"mean_commits":"12.666666666666666","dds":0.7203947368421053,"last_synced_commit":"8d0bfc78dfe9ab3bd258ffb99af2d4f1ee92b629"},"previous_names":["aboutcode-org/fetchcode"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Ffetchcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Ffetchcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Ffetchcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutcode-org%2Ffetchcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aboutcode-org","download_url":"https://codeload.github.com/aboutcode-org/fetchcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241829321,"owners_count":20027063,"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-14T19:41:39.525Z","updated_at":"2026-01-27T23:49:05.675Z","avatar_url":"https://github.com/aboutcode-org.png","language":"HTML","readme":"FetchCode: Utilities to fetch code from purls, URLs and version control repos.\n================================================================================\n\nFetchCode is a library to reliably fetch code via HTTP, FTP and version control\nsystems. It can work using plain HTTP and FTP URLs, as well as\n`Package URLs \u003chttps://github.com/package-url\u003e`_ and version control (VCS) URLs\nas used in Python pip and as specified in `SPDX Package Download Location\n\u003chttps://spdx.github.io/spdx-spec/3-package-information/#37-package-download-location\u003e`_\n\nHomepage and support: https://github.com/aboutcode-org/fetchcode\n\n\nWhy FetchCode?\n--------------\n\nIt is surprisingly difficult to have a simple API to consistently fetch code\nfrom package repositories, version control repositories and APIs: each site\nand each package manager has its own unique and peculiar ways. FetchCode goal\nis to abstract all these details and make it easy to fetch things reliably.\n\n\nDevelopment installation\n--------------------------\n\nClone the repo::\n\n    git clone https://github.com/aboutcode-org/fetchcode\n\nThen install all the requirements using this command (on POSIX)::\n\n    ./configure --dev\n\n\nRunning tests\n----------------\n\nTo run test suite use::\n\n    pytest -vvs\n\n\nUsage\n--------\n\nFetch a code archive and get a ``fetchcode.fetch.Response`` object back::\n\n    \u003e\u003e\u003e from fetchcode import fetch\n    \u003e\u003e\u003e f = fetch('https://github.com/aboutcode-org/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')\n    \u003e\u003e\u003e f.location\n    '/tmp/tmp_cm02xsg'\n    \u003e\u003e\u003e f.content_type\n    'application/zip'\n    \u003e\u003e\u003e f.url\n    'https://github.com/aboutcode-org/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'\n\nFetch some package metadata and get a ``fetchcode.packagedcode_models.Package`` object back::\n\n    \u003e\u003e\u003e from fetchcode import package\n    \u003e\u003e\u003e list(package.info('pkg:rubygems/files'))\n    [Package(type='rubygems', namespace=None, name='files', version=None)]\n\nFetch a purl and get a ``fetchcode.fetch.Response`` object back::\n\n    \u003e\u003e\u003e from fetchcode import fetch\n    \u003e\u003e\u003e f = fetch('pkg:swift/github.com/Alamofire/Alamofire@5.4.3')\n    \u003e\u003e\u003e f.location\n    '/tmp/tmp_cm02xsg'\n    \u003e\u003e\u003e f.content_type\n    'application/zip'\n    \u003e\u003e\u003e f.url\n    'https://github.com/Alamofire/Alamofire/archive/5.4.3.zip'\n\nEcosystems supported for fetching a purl from fetchcode:\n\n- alpm\n- apk\n- bitbucket\n- cargo\n- composer\n- conda\n- cpan\n- cran\n- deb\n- gem\n- generic\n- github\n- golang\n- hackage\n- hex\n- luarocks\n- maven\n- npm\n- nuget\n- pub\n- pypi\n- swift\n\nLicense\n--------\n\n- SPDX-License-Identifier: Apache-2.0\n\nCopyright (c) nexB Inc. and others.\n\n\nAcknowledgements, Funding, Support and Sponsoring\n--------------------------------------------------------\n\nThis project is funded, supported and sponsored by:\n\n- Generous support and contributions from users like you!\n- the European Commission NGI programme\n- the NLnet Foundation \n- the Swiss State Secretariat for Education, Research and Innovation (SERI)\n- Google, including the Google Summer of Code and the Google Seasons of Doc programmes\n- Mercedes-Benz Group\n- Microsoft and Microsoft Azure\n- AboutCode ASBL\n- nexB Inc. \n\n\n\n|europa|   |dgconnect| \n\n|ngi|   |nlnet|   \n\n|aboutcode|  |nexb|\n\n\nThis project was funded through the NGI0 Core Fund, a fund established by NLnet with financial\nsupport from the European Commission's Next Generation Internet programme, under the aegis of DG\nCommunications Networks, Content and Technology under grant agreement No 101092990.\n\n|ngizerocore| https://nlnet.nl/project/VulnerableCode-enhancements/\n\n\nThis project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial\nsupport from the European Commission's Next Generation Internet programme, under the aegis of DG\nCommunications Networks, Content and Technology under grant agreement No 101069594. \n\n|ngizeroentrust| https://nlnet.nl/project/Back2source/\n\n\nThis project was funded through the NGI0 Core Fund, a fund established by NLnet with financial\nsupport from the European Commission's Next Generation Internet programme, under the aegis of DG\nCommunications Networks, Content and Technology under grant agreement No 101092990.\n\n|ngizerocore| https://nlnet.nl/project/Back2source-next/\n\n\nThis project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial\nsupport from the European Commission's Next Generation Internet programme, under the aegis of DG\nCommunications Networks, Content and Technology under grant agreement No 101069594. \n\n|ngizeroentrust| https://nlnet.nl/project/purl2all/\n\n\n\n.. |nlnet| image:: https://nlnet.nl/logo/banner.png\n    :target: https://nlnet.nl\n    :height: 50\n    :alt: NLnet foundation logo\n\n.. |ngi| image:: https://ngi.eu/wp-content/uploads/thegem-logos/logo_8269bc6efcf731d34b6385775d76511d_1x.png\n    :target: https://ngi.eu35\n    :height: 50\n    :alt: NGI logo\n\n.. |nexb| image:: https://nexb.com/wp-content/uploads/2022/04/nexB.svg\n    :target: https://nexb.com\n    :height: 30\n    :alt: nexB logo\n\n.. |europa| image:: https://ngi.eu/wp-content/uploads/sites/77/2017/10/bandiera_stelle.png\n    :target: http://ec.europa.eu/index_en.htm\n    :height: 40\n    :alt: Europa logo\n\n.. |aboutcode| image:: https://aboutcode.org/wp-content/uploads/2023/10/AboutCode.svg\n    :target: https://aboutcode.org/\n    :height: 30\n    :alt: AboutCode logo\n\n.. |swiss| image:: https://www.sbfi.admin.ch/sbfi/en/_jcr_content/logo/image.imagespooler.png/1493119032540/logo.png\n    :target: https://www.sbfi.admin.ch/sbfi/en/home/seri/seri.html\n    :height: 40\n    :alt: Swiss logo\n\n.. |dgconnect| image:: https://commission.europa.eu/themes/contrib/oe_theme/dist/ec/images/logo/positive/logo-ec--en.svg\n    :target: https://commission.europa.eu/about-european-commission/departments-and-executive-agencies/communications-networks-content-and-technology_en\n    :height: 40\n    :alt: EC DG Connect logo\n\n.. |ngizerocore| image:: https://nlnet.nl/image/logos/NGI0_tag.svg\n    :target: https://nlnet.nl/core\n    :height: 40\n    :alt: NGI Zero Core Logo\n\n.. |ngizerocommons| image:: https://nlnet.nl/image/logos/NGI0_tag.svg\n    :target: https://nlnet.nl/commonsfund/\n    :height: 40\n    :alt: NGI Zero Commons Logo\n\n.. |ngizeropet| image:: https://nlnet.nl/image/logos/NGI0PET_tag.svg\n    :target: https://nlnet.nl/PET\n    :height: 40\n    :alt: NGI Zero PET logo\n\n.. |ngizeroentrust| image:: https://nlnet.nl/image/logos/NGI0Entrust_tag.svg\n    :target: https://nlnet.nl/entrust\n    :height: 38\n    :alt: NGI Zero Entrust logo\n\n.. |ngiassure| image:: https://nlnet.nl/image/logos/NGIAssure_tag.svg\n    :target: https://nlnet.nl/image/logos/NGIAssure_tag.svg\n    :height: 32\n    :alt: NGI Assure logo\n\n.. |ngidiscovery| image:: https://nlnet.nl/image/logos/NGI0Discovery_tag.svg\n    :target: https://nlnet.nl/discovery/\n    :height: 40\n    :alt: NGI Discovery logo\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutcode-org%2Ffetchcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboutcode-org%2Ffetchcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutcode-org%2Ffetchcode/lists"}