Skip to main content

Resources management (files/directories/etc.).

Project description


In what follows

  • python is an alias for python3.5 or any later version (python3.6 and so on),
  • pypy is an alias for pypy3.5 or any later version (pypy3.6 and so on).


Install the latest pip & setuptools packages versions:

  • with CPython
    python -m pip install --upgrade pip setuptools
  • with PyPy
    pypy -m pip install --upgrade pip setuptools


Download and install the latest stable version from PyPI repository:

  • with CPython
    python -m pip install --upgrade rsrc
  • with PyPy
    pypy -m pip install --upgrade rsrc


Download the latest version from GitHub repository

git clone
cd rsrc

Install dependencies:

  • with CPython
    python -m pip install --force-reinstall -r requirements.txt
  • with PyPy
    pypy -m pip install --force-reinstall -r requirements.txt


  • with CPython
    python install
  • with PyPy
    pypy install


The main idea is to use setuptools feature called "Dynamic Discovery of Services and Plugins".

Assuming we have a package rsrc_ftp with structure


which adds support for URLs with ftp scheme

from rsrc.models import Resource

def deserialize(string: str) -> Resource:

to make it available for rsrc package we should register its entry point (rsrc_ftp::deserialize function in our case)

from setuptools import setup

from rsrc import plugins

plugins_entry_points = [
      entry_points={plugins.__name__: plugins_entry_points},

After that the installation of rsrc_ftp package will register rsrc_ftp::deserialize function in rsrc package as an entry point for resources with ftp scheme

>>> from rsrc.base import deserialize
>>> ftp_resource = deserialize('ftp://path/to/resource')
>>> ftp_resource.url
URL('ftp', 'path', '/to/resource', '', '', '')


  • rsrc_local -- adds support for local/local network resources.
  • rsrc_web -- adds support for web resources (both http & https schemes).


Bumping version


Install bump2version.


Choose which version number category to bump following semver specification.

Test bumping version

bump2version --dry-run --verbose $CATEGORY

where $CATEGORY is the target version number category name, possible values are patch/minor/major.

Bump version

bump2version --verbose $CATEGORY

This will set version to major.minor.patch-alpha.


Test bumping version

bump2version --dry-run --verbose release

Bump version

bump2version --verbose release

This will set version to major.minor.patch.


To avoid inconsistency between branches and pull requests, bumping version should be merged into master branch as separate pull request.

Running tests

Install dependencies:

  • with CPython
    python -m pip install --force-reinstall -r requirements-tests.txt
  • with PyPy
    pypy -m pip install --force-reinstall -r requirements-tests.txt



Inside Docker container:

  • with CPython
    docker-compose --file docker-compose.cpython.yml up
  • with PyPy
    docker-compose --file docker-compose.pypy.yml up

Bash script (e.g. can be used in Git hooks):

  • with CPython



    ./ cpython
  • with PyPy

    ./ pypy

PowerShell script (e.g. can be used in Git hooks):

  • with CPython
    .\run-tests.ps1 cpython
  • with PyPy
    .\run-tests.ps1 pypy

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

rsrc-0.1.3.tar.gz (5.9 kB view hashes)

Uploaded source

Built Distribution

rsrc-0.1.3-py3-none-any.whl (7.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page