Skip to main content

fetchcode is a library to reliably fetch code via HTTP, FTP and version control systems.

Project description

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 and version control (VCS) URLs as used in Python pip and as specified in SPDX 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.Reposnse 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fetchcode-0.2.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

fetchcode-0.2.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file fetchcode-0.2.0.tar.gz.

File metadata

  • Download URL: fetchcode-0.2.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for fetchcode-0.2.0.tar.gz
Algorithm Hash digest
SHA256 45c9f5cafe659326e7923efb10e650ba26441b8feb8cb70901f40422a9c4db30
MD5 fd0adf7f446eadbc804c3f3b37082f48
BLAKE2b-256 7a2d517bac4e7c79925fd54486755926724b147dc0b91d38ef828a55af801e98

See more details on using hashes here.

Provenance

File details

Details for the file fetchcode-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fetchcode-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for fetchcode-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d44a7676655df90b9a2d4a25df788fa0640ee10766aea68b2beae3a6c7a3d0
MD5 11a3f1a541230b20a4a53f447e8ab5dc
BLAKE2b-256 d7e996e9302e84e326b3c10a40c1723f21f4db96b557a17c6871e7a4c6336906

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page