Skip to content

Commit 0e2f2f8

Browse files
committed
Update doc minimally for release
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent ab65b2e commit 0e2f2f8

File tree

2 files changed

+71
-30
lines changed

2 files changed

+71
-30
lines changed

CHANGELOG.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
Release notes
2-
-------------
3-
### Version 0.0.1 2020-10-29
1+
Changelog
2+
=========
43

5-
Initial release
4+
5+
v (next, future)
6+
-----------------------
7+
8+
9+
v0.1.0
10+
---------
11+
12+
First, initial release.
13+

README.rst

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,69 @@
1-
*********
2-
Fetchcode
3-
*********
4-
It is a library to reliably fetch code via HTTP, FTP and version control systems.
1+
FetchCode: Utilities to fetch code from purls, URLs and version control repos.
2+
================================================================================
53

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

10-
:code:`git clone https://github.com/nexB/fetchcode`
10+
Homepage and support: https://github.com/nexB/fetchcode
1111

12-
Then install all the requirements using
1312

14-
:code:`pip3 install -r requirements.txt`
13+
Why FetchCode?
14+
--------------
1515

16-
Running test suite
17-
##################
16+
It is surprisingly difficult to have a simple API to consistently fetch code
17+
from package repositories, version control repositories and APIs: each site
18+
and each package manager has its own unique and peculiar ways. FetchCode goal
19+
is to abstract all these details and make it easy to fetch things reliably.
1820

19-
To run test suite
2021

21-
:code:`python3 -m pytest`
22+
Development installation
23+
--------------------------
2224

23-
Usage of API to fetch HTTP/S and FTP URLs
24-
#########################################
25+
Clone the repo::
2526

26-
.. code-block:: python
27+
git clone https://github.com/nexB/fetchcode
2728

28-
from fetchcode import fetch
29-
url = 'A Http or FTP URL'
30-
# This returns a response object which has attributes
31-
# 'content_type' content type of the file
32-
# 'location' the absolute location of the files that was fetched
33-
# 'scheme' scheme of the URL
34-
# 'size' size of the retrieved content in bytes
35-
# 'url' fetched URL
36-
resp = fetch(url = url)
29+
Then install all the requirements using::
30+
31+
configure --dev
32+
33+
34+
Running tests
35+
----------------
36+
37+
To run test suite use::
38+
39+
pytest -vvs
40+
41+
42+
Usage
43+
--------
44+
45+
Fetch a code archive and get a ``fetchcode.fetch.Reposnse`` object back::
46+
47+
>>> from fetchcode import fetch
48+
>>> f = fetch('https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip')
49+
>>> f.location
50+
'/tmp/tmp_cm02xsg'
51+
>>> f.content_type
52+
'application/zip'
53+
>>> f.url
54+
'https://github.com/nexB/fetchcode/archive/ab65b2e645c889887227ea49eb3332d885fd0a54.zip'
55+
56+
Fetch some package metadata and get a ``fetchcode.packagedcode_models.Package`` object back::
57+
58+
>>> from fetchcode import package
59+
>>> list(package.info('pkg:rubygems/files'))
60+
[Package(type='rubygems', namespace=None, name='files', version=None)]
61+
62+
63+
64+
License
65+
--------
66+
67+
- SPDX-License-Identifier: Apache-2.0
68+
69+
Copyright (c) nexB Inc. and others.

0 commit comments

Comments
 (0)