Skip to main content

No project description provided

Project description

Soufi (Source Finder) is a library that finds downloadable URLs for source packages, given the binary package name and version. It will also create a compressed archive of multiple downloadable files, or save any existing downloadable archive.

Currently supported finders are:
  • Debian OS packages

  • Ubuntu OS packages

  • Red Hat (UBI) packages

  • CentOS packages

  • Alpine packages

  • Photon OS packages

  • AlmaLinux OS packages

  • NPM packages

  • Python sdists

  • Golang modules

  • Java JARs

  • Ruby Gems

If you want to download Alpine packages, you must have git installed.


Soufi is currently tested on Python versions 3.8 through 3.11. It is known not to work on 3.6.


Install Soufi with pip:

pip install soufi

or, with the command-line tool:

pip install soufi[cli]

Using the command line

soufi python flask 2.0.0

soufi debian zlib1g 1:1.2.11.dfsg-1 -o zlib.tar.xz

ls -l zlib.tar.xz
-rw-rw-r-- 1 juledwar juledwar 391740 May 20 15:20 zlib.tar.xz

Using the API

import shutil
import soufi

finder = soufi.finder.factory(
    'python', 'flask', '2.0.0', soufi.finder.SourceType.python
source = finder.find()

finder = soufi.finder.factory(
    'debian', 'zlib1g', '1:1.2.11.dfsg-1', soufi.finder.SourceType.os
source = finder.find()
with source.make_archive() as archive, open('zlib.tar.xz', 'wb') as local:
    shutil.filecopyobj(archive, local)


Soufi uses dogpile.cache to provide a convenient mechanism for caching requests when doing repeated lookups. For sources with network-intensive remote discovery (e.g,, DNF/Yum-based OSes) this is strongly recommended.

For a single-threaded application, an in-memory LRU cache, should be adequate:

import pylru
import soufi

LRU_CACHE = pylru.lrucache(size=1024)
finder = soufi.finder.factory(
    'centos', 'cracklib-dicts', '2.9.0-11.el7', soufi.finder.SourceType.os,
# Re-using the finder will use cached results
print(finder.find('vim-minimal', '7.4.629-8.el7_9'))

More complex applications can use the other backends, e.g., memcached, Redis, custom backends, etc. See the dogpile.cache documentation for details on backend configuration.

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

soufi-2024.3.4.tar.gz (71.7 kB view hashes)

Uploaded Source

Built Distribution

soufi-2024.3.4-py2.py3-none-any.whl (36.8 kB view hashes)

Uploaded Python 2 Python 3

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