Code Monkey home page Code Monkey logo

fetchcode's Introduction

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 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.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.

fetchcode's People

Contributors

pombredanne avatar jonoyang avatar tg1999 avatar steven-esser avatar ayansinhamahapatra avatar chinyeungli avatar dependabot[bot] avatar jimc404 avatar aalexanderr avatar armijnhemel avatar mjherzog avatar bobquest33 avatar agustinhenze avatar keshav-space avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.