{"id":13814182,"url":"https://github.com/toastdriven/alligator","last_synced_at":"2025-07-04T18:38:02.400Z","repository":{"id":25234938,"uuid":"28659494","full_name":"toastdriven/alligator","owner":"toastdriven","description":"Simple offline task queues. For Python.","archived":false,"fork":false,"pushed_at":"2023-05-16T01:10:51.000Z","size":207,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-07T16:54:55.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://alligator.readthedocs.org/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toastdriven.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.rst","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-31T07:24:51.000Z","updated_at":"2024-05-13T04:29:52.000Z","dependencies_parsed_at":"2024-08-04T04:05:23.666Z","dependency_job_id":"c72e6754-ddd2-4884-81f0-e124a00c6897","html_url":"https://github.com/toastdriven/alligator","commit_stats":{"total_commits":108,"total_committers":3,"mean_commits":36.0,"dds":0.01851851851851849,"last_synced_commit":"2bb41e0cf0a57baf90a9c15b3bb01bd74438bc69"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Falligator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Falligator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Falligator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Falligator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toastdriven","download_url":"https://codeload.github.com/toastdriven/alligator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toastdriven%2Falligator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039741,"owners_count":22796905,"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","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":"2024-08-04T04:01:46.211Z","updated_at":"2025-06-10T08:36:36.781Z","avatar_url":"https://github.com/toastdriven.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Alligator\n=========\n\n.. image:: https://travis-ci.org/toastdriven/alligator.png?branch=master\n        :target: https://travis-ci.org/toastdriven/alligator\n\nSimple offline task queues. For Python.\n\n`\"See you later, alligator.\"`\n\nLatest documentation at http://alligator.readthedocs.org/en/latest/.\n\n\nRequirements\n------------\n\n* Python 3.6+\n* (Optional) ``redis`` for the Redis backend\n* (Optional) ``boto3\u003e=1.12.0`` for the SQS backend\n\n\nBasic Usage\n-----------\n\nThis example uses Django, but there's nothing Django-specific about Alligator.\n\nI repeat, You can use it with **any** Python code that would benefit from\nbackground processing.\n\n.. code:: python\n\n    from alligator import Gator\n\n    from django.contrib.auth.models import User\n    from django.shortcuts import send_email\n\n\n    # Make a Gator instance.\n    # Under most circumstances, you would configure this in one place \u0026\n    # import that instance instead.\n    gator = Gator('redis://localhost:6379/0')\n\n\n    # The task itself.\n    # Nothing special, just a plain *undecorated* function.\n    def follow_email(followee_username, follower_username):\n        followee = User.objects.get(username=followee_username)\n        follower = User.objects.get(username=follower_username)\n\n        subject = 'You got followed!'\n        message = 'Hey {}, you just got followed by {}! Whoohoo!'.format(\n            followee.username,\n            follower.username\n        )\n        send_email(subject, message, 'server@example.com', [followee.email])\n\n\n    # An simple, previously expensive view.\n    @login_required\n    def follow(request, username):\n        # You'd import the task function above.\n        if request.method == 'POST':\n            # Schedule the task.\n            # Use args \u0026 kwargs as normal.\n            gator.task(follow_email, request.user.username, username)\n            return redirect('...')\n\n\nRunning Tasks\n-------------\n\nRather than trying to do autodiscovery, fanout, etc., you control how your\nworkers are configured \u0026 what they consume.\n\nIf your needs are simple, run the included ``latergator.py`` worker:\n\n.. code:: bash\n\n    $ python latergator.py redis://localhost:6379/0\n\nIf you have more complex needs, you can create a new executable file\n(bin script, management command, whatever) \u0026 drop in the following code.\n\n.. code:: python\n\n    from alligator import Gator, Worker\n\n    # Bonus points if you import that one pre-configured ``Gator`` instead.\n    gator = Gator('redis://localhost:6379/0')\n\n    # Consume \u0026 handle all tasks.\n    worker = Worker(gator)\n    worker.run_forever()\n\n\nLicense\n-------\n\nNew BSD\n\n\nRunning Tests\n-------------\n\nAlligator has 95%+ test coverage \u0026 aims to be passing/stable at all times.\n\nIf you'd like to run the tests, clone the repo, then run::\n\n    $ virtualenv -p python3 env\n    $ . env/bin/activate\n    $ pip install -r requirements-tests.txt\n    $ python setup.py develop\n    $ pytest -s -v --cov=alligator --cov-report=html tests\n\nThe full test suite can be run via:\n\n    $ export ALLIGATOR_TESTS_INCLUDE_SQS=true\n    $ ./tests/run_all.sh\n\nThis requires all backends/queues to be running, as well as valid AWS\ncredentials if ``ALLIGATOR_TESTS_INCLUDE_SQS=true`` is set.\n\n\nWHY?!!1!\n--------\n\n* Because I have NIH-syndrome.\n* Or because I longed for something simple (~375 loc).\n* Or because I wanted something with tests (90%+ coverage) \u0026 docs.\n* Or because I wanted pluggable backends.\n* Or because testing some other queuing system was a pain.\n* Or because I'm an idiot.\n\n\nRoadmap\n-------\n\nPost-`1.0.0`:\n\n    * Expand the supported backends\n        * Kafka?\n        * ActiveMQ support?\n        * RabbitMQ support?\n        * ???\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Falligator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoastdriven%2Falligator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoastdriven%2Falligator/lists"}