Skip to main content

ZC buildout recipe to fetch urls

Project description

What is iw.recipe.fetcher ?

Download an url to a local directory.

How to use iw.recipe.fetcher ?

The recipe download from an http server:

>>> server_data = tmpdir('server_data')
>>> write(server_data, 'file1.txt', 'test1')
>>> write(server_data, 'file2.txt', 'test1')
>>> write(server_data, 'file3.txt', 'test1')

>>> server_url = start_server(server_data)

We need some buildout vars:

>>> write('buildout.cfg', '''
... [buildout]
... parts=test1
...
... [test1]
... recipe=iw.recipe.fetcher
... urls=
...       %(server_url)s/file1.txt
... base_url=%(server_url)s
... files=
...       file2.txt
...       file3.txt
... ''' % dict(server_url=server_url))

Now we can fetch some urls:

>>> print system(buildout)
Installing test1.
<BLANKLINE>

It works:

>>> ls(sample_buildout, 'test1')
- file1.txt
- file2.txt
- file3.txt


>>> write('buildout.cfg', '''
... [buildout]
... parts=test2
...
... [test2]
... recipe=iw.recipe.fetcher
... urls=
...   http://www.example.com/file1.txt
... find-links=%(server_url)s
... ''' % dict(server_url=server_url))

Now we can fetch some urls:

>>> print system(buildout)
Uninstalling test1.
Installing test2.
<BLANKLINE>

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

iw.recipe.fetcher-0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

iw.recipe.fetcher-0.2-py2.4.egg (10.4 kB view details)

Uploaded Source

File details

Details for the file iw.recipe.fetcher-0.2.tar.gz.

File metadata

File hashes

Hashes for iw.recipe.fetcher-0.2.tar.gz
Algorithm Hash digest
SHA256 52487dfe3a9538712cf051c89c4c6bb8402a6685d2fbdf2efcac96cf2c2a6c7f
MD5 c200b73c998e54a963bd0cd7248ab298
BLAKE2b-256 e55a56fc2a12f01cc4bcbacbe99f3c62215d73ca22e0f47c697e84debcc5ee18

See more details on using hashes here.

File details

Details for the file iw.recipe.fetcher-0.2-py2.4.egg.

File metadata

File hashes

Hashes for iw.recipe.fetcher-0.2-py2.4.egg
Algorithm Hash digest
SHA256 05de36a647efb5571fad8a1d970e84e0c835abbe58d3575ac70ca205d9ee6268
MD5 710b35be21b2fb1cdd2d5897194e6fd5
BLAKE2b-256 fc6e3b2e8856512d73b241824c0a96259df7b88e886d12a705b39d46e418f290

See more details on using hashes here.

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