fetchcode


Namefetchcode JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/nexB/fetchcode
Summaryfetchcode is a library to reliably fetch code via HTTP, FTP and version control systems.
upload_time2024-04-01 16:27:17
maintainerNone
docs_urlNone
authornexB. Inc. and others
requires_python>=3.7
licenseApache-2.0
keywords utilities package manager dependencies fetch scancode download downloader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            FetchCode: Utilities to fetch code from purls, URLs and version control repos.
================================================================================

FetchCode is a library to reliably fetch code via HTTP, FTP and version control
systems. It can work using plain HTTP and FTP URLs, as well as
`Package URLs <https://github.com/package-url>`_ and version control (VCS) URLs
as used in Python pip and as specified in `SPDX Package Download Location
<https://spdx.github.io/spdx-spec/3-package-information/#37-package-download-location>`_

Homepage and support: https://github.com/nexB/fetchcode


Why FetchCode?
--------------

It is surprisingly difficult to have a simple API to consistently fetch code
from package repositories, version control repositories and APIs: each site
and each package manager has its own unique and peculiar ways. FetchCode goal
is to abstract all these details and make it easy to fetch things reliably.


Development installation
--------------------------

Clone the repo::

    git clone https://github.com/nexB/fetchcode

Then install all the requirements using::

    configure --dev


Running tests
----------------

To run test suite use::

    pytest -vvs


Usage
--------

Fetch a code archive and get a ``fetchcode.fetch.Response`` object back::

    >>> from fetchcode import fetch
    >>> f = fetch('https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')
    >>> f.location
    '/tmp/tmp_cm02xsg'
    >>> f.content_type
    'application/zip'
    >>> f.url
    'https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'

Fetch some package metadata and get a ``fetchcode.packagedcode_models.Package`` object back::

    >>> from fetchcode import package
    >>> list(package.info('pkg:rubygems/files'))
    [Package(type='rubygems', namespace=None, name='files', version=None)]


License
--------

- SPDX-License-Identifier: Apache-2.0

Copyright (c) nexB Inc. and others.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nexB/fetchcode",
    "name": "fetchcode",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "utilities, package manager, dependencies, fetch, scancode, download, downloader",
    "author": "nexB. Inc. and others",
    "author_email": "info@aboutcode.org",
    "download_url": "https://files.pythonhosted.org/packages/65/54/f3b324fb50768d29c00f58e64103836a894d9e97e577ee276fe7d0da7395/fetchcode-0.5.1.tar.gz",
    "platform": null,
    "description": "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 <https://github.com/package-url>`_ and version control (VCS) URLs\nas used in Python pip and as specified in `SPDX Package Download Location\n<https://spdx.github.io/spdx-spec/3-package-information/#37-package-download-location>`_\n\nHomepage and support: https://github.com/nexB/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/nexB/fetchcode\n\nThen install all the requirements using::\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    >>> from fetchcode import fetch\n    >>> f = fetch('https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')\n    >>> f.location\n    '/tmp/tmp_cm02xsg'\n    >>> f.content_type\n    'application/zip'\n    >>> f.url\n    'https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'\n\nFetch some package metadata and get a ``fetchcode.packagedcode_models.Package`` object back::\n\n    >>> from fetchcode import package\n    >>> list(package.info('pkg:rubygems/files'))\n    [Package(type='rubygems', namespace=None, name='files', version=None)]\n\n\nLicense\n--------\n\n- SPDX-License-Identifier: Apache-2.0\n\nCopyright (c) nexB Inc. and others.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "fetchcode is a library to reliably fetch code via HTTP, FTP and version control systems.",
    "version": "0.5.1",
    "project_urls": {
        "Homepage": "https://github.com/nexB/fetchcode"
    },
    "split_keywords": [
        "utilities",
        " package manager",
        " dependencies",
        " fetch",
        " scancode",
        " download",
        " downloader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11dd56b75a07719a39544179a0b94abc6336b7a61c1ed445dbd8aec627b92a75",
                "md5": "477d9058f2e3b2eebaa850cef2d59514",
                "sha256": "1116f8ff742d5050fae64096ec5e7b355912aef9eca7d3805d53b7b8ad026a13"
            },
            "downloads": -1,
            "filename": "fetchcode-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "477d9058f2e3b2eebaa850cef2d59514",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 1612432,
            "upload_time": "2024-04-01T16:27:14",
            "upload_time_iso_8601": "2024-04-01T16:27:14.561134Z",
            "url": "https://files.pythonhosted.org/packages/11/dd/56b75a07719a39544179a0b94abc6336b7a61c1ed445dbd8aec627b92a75/fetchcode-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6554f3b324fb50768d29c00f58e64103836a894d9e97e577ee276fe7d0da7395",
                "md5": "4973b4967ce3ce2c29bf55a1a03032e7",
                "sha256": "918bdcdfaea460f92e6b3f13fb7926071f26764a01e315b38c3eab001368b399"
            },
            "downloads": -1,
            "filename": "fetchcode-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4973b4967ce3ce2c29bf55a1a03032e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 2546903,
            "upload_time": "2024-04-01T16:27:17",
            "upload_time_iso_8601": "2024-04-01T16:27:17.150648Z",
            "url": "https://files.pythonhosted.org/packages/65/54/f3b324fb50768d29c00f58e64103836a894d9e97e577ee276fe7d0da7395/fetchcode-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-01 16:27:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nexB",
    "github_project": "fetchcode",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "fetchcode"
}
        
Elapsed time: 0.21810s