{"id":28764990,"url":"https://github.com/klen/dealer","last_synced_at":"2025-08-02T13:42:26.211Z","repository":{"id":4649901,"uuid":"5795288","full_name":"klen/dealer","owner":"klen","description":"Make some staff","archived":false,"fork":false,"pushed_at":"2019-09-06T09:54:30.000Z","size":96,"stargazers_count":62,"open_issues_count":6,"forks_count":13,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-06-17T10:13:17.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klen.png","metadata":{"files":{"readme":"README.rst","changelog":"Changelog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-13T13:50:15.000Z","updated_at":"2023-05-16T17:50:04.000Z","dependencies_parsed_at":"2022-09-21T00:11:05.941Z","dependency_job_id":null,"html_url":"https://github.com/klen/dealer","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/klen/dealer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fdealer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fdealer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fdealer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fdealer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/dealer/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fdealer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268400708,"owners_count":24244445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T10:13:18.677Z","updated_at":"2025-08-02T13:42:26.166Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|logo| Dealer\n#############\n\n.. _description:\n\nDealer — SCM_ revision helper in your projects. Just add SCM_ revision to\nyour static paths and get automatic control at client browser caches:\n\nSomewhere in templates: ::\n    \n    \u003cscript src='/main.js?{{ request.revision }}'\n\nOn clientside: ::\n\n    \u003cscript src='/main.js?34jhfd45hd8'\n\nSupported Git_, Mercurial_ and simple revision parse by file.\n\n.. note:: You should install Mercurial_ for hg support.\n\n.. note:: For Django\u003c2 please use Dealer\u003c2\n\n\n.. _badges:\n\n.. image:: http://img.shields.io/travis/klen/dealer.svg?style=flat-square\n    :target: http://travis-ci.org/klen/dealer\n    :alt: Build Status\n\n.. image:: http://img.shields.io/coveralls/klen/dealer.svg?style=flat-square\n    :target: https://coveralls.io/r/klen/dealer\n    :alt: Coverals\n\n.. image:: http://img.shields.io/pypi/v/dealer.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/dealer\n    :alt: Version\n\n.. image:: http://img.shields.io/pypi/dm/dealer.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/dealer\n    :alt: Downloads\n\n.. image:: http://img.shields.io/gratipay/klen.svg?style=flat-square\n    :target: https://www.gratipay.com/klen/\n    :alt: Donate\n\n\n.. _contents:\n\n.. contents::\n\n\n.. _requirements:\n\nRequirements\n=============\n\n- python 2.7, 3.5+\n\n.. note:: For Django\u003c2 please use Dealer\u003c2\n\n\n.. _installation:\n\nInstallation\n=============\n\n**Dealer** should be installed using pip: ::\n\n    pip install dealer\n\n\n.. _usage:\n\nUsage\n=====\n\nBasic usage\n-----------\n::\n\n    from dealer.git import git\n\n    print git.revision\n\n    print git.tag\n\n::\n\n    # Auto parse repository type\n    from dealer.auto import auto\n    print auto.revision\n\n    print auto.tag\n\n\nManually create backend\n----------------------\n\n**path** — path to SCM_ repository (current dir by default)\n::\n\n    from dealer.mercurial import Backend\n\n    hg = Backend('/path/to/hg/repo')\n\n\nDjango support\n--------------\n\nSettings\n^^^^^^^^\n\n**DEALER_TYPE** — Type of SCM_ repository ('auto', 'git', 'mercurial', 'simple', 'env', 'null'). By default 'auto';\n\n**DEALER_PATH** — Path to SCM_. By default current dir;\n\n**DEALER_SILENT** — Disable log warnings;\n\n**DEALER_BACKENDS** — Backends for auto search by default ('git', 'mercurial', 'simple', 'env', 'null');\n\n\nContext-processor\n^^^^^^^^^^^^^^^^^\n\nAppend to your context processors: ::\n\n    ...\n    context_processors = ['dealer.contrib.django.context_processor']\n\nAnd use the *REVISION* and *TAG* variables in your templates: ::\n\n    \u003clink href=\"/test.css?{{ REVISION }}\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" /\u003e\n    \u003cscript src=\"/test.js?{{ REVISION }}\"\u003e\u003c/script\u003e\n\nMiddleware\n^^^^^^^^^^\n    \nAppend to your settings: ::\n\n    MIDDLEWARE = ['dealer.contrib.django.Middleware']\n\nAnd use in your views: ::\n\n    def view(request):\n        return request.revision\n\nOr in your templates by `request.revision` var.\n\n\nFlask support\n-------------\n\nSettings\n^^^^^^^^\n\n*DEALER_TYPE* — Type of SCM_ repository ('auto', 'git', 'mercurial', 'simple', 'env', 'null'). By default 'auto'\n*DEALER_PARAMS* — Params for backend\n\nUsage\n^^^^^\n\nIn views::\n\n        from flask import Flask, g\n        from dealer.contrib.flask import Dealer\n\n        app = Flask('test')\n        Dealer(app)\n        assert app.revision\n\n        @app.route('/')\n        def usage_in_view():\n            return g.revision\n\n\nIn templates: ::\n\n    \u003clink href=\"/test.css?{{ REVISION }}\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" /\u003e\n\nPyramid support\n---------------\n\n::\n\n    config.include('dealer.contrib.pyramid')\n\n::\n\n    def myview(request):\n        revision = request.registry.dealer.revision\n        tag = request.registry.dealer.tag\n\nIn templates\n\n::\n\n    Revision: {{DEALER_REVISION}}\n    Tag: {{DEALER_TAG}}\n\n\nHeroku support\n-------------\n\nSettings\n^^^^^^^^\n\n*DEALER_TYPE* = 'env'\n*DEALER_PARAMS*:\n    *revision_env_keyname* - Variable name for revision (default: DEALER_REVISION)\n\t*tag_env_keyname* - Variable name for tag (default: DEALER_TAG)\n\nUsage\n^^^^^\n\nSetup your revision and tag value in envirement variables.\nFor example in Heroku.com:\n::\n    heroku config:set DEALER_REVISION='3ffb6b6'\n    heroku config:set DEALER_TAG=v1_1\n\nAfter that use dealer as described above.\n \n\n.. _bagtracker:\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or\nannoyances please report them to the issue tracker\nat https://github.com/klen/Dealer/issues\n\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of dealer happens at github: https://github.com/klen/dealer\n\n\n.. _contributors:\n\nContributors\n=============\n\n* klen_ (Kirill Klenov)\n\n\n.. _license:\n\nLicense\n=======\n\nLicensed under a `BSD license`_.\n\n\n.. _links:\n\n.. _BSD license: http://www.linfo.org/bsdlicense.html\n.. _klen: http://klen.github.com/\n.. _SCM: http://en.wikipedia.org/wiki/Source_Control_Management\n.. _Git: http://en.wikipedia.org/wiki/Git_(oftware)\n.. _Mercurial: http://en.wikipedia.org/wiki/Mercurial\n.. |logo| image:: https://raw.github.com/klen/dealer/develop/docs/_static/logo.png\n                  :width: 100\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fdealer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fdealer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fdealer/lists"}