{"id":13419297,"url":"https://github.com/drpancake/chard","last_synced_at":"2025-03-15T05:30:43.598Z","repository":{"id":59076880,"uuid":"534110013","full_name":"drpancake/chard","owner":"drpancake","description":"A simple async/await task queue for Django. One process, no threads, no other dependencies.","archived":false,"fork":false,"pushed_at":"2024-03-02T13:46:57.000Z","size":39,"stargazers_count":201,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-07T18:07:35.022Z","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/drpancake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-08T07:59:53.000Z","updated_at":"2024-02-17T14:41:36.000Z","dependencies_parsed_at":"2024-10-26T16:04:25.814Z","dependency_job_id":"b5272cf1-0659-4f36-b0eb-de79c3601587","html_url":"https://github.com/drpancake/chard","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"3cd5fde136d1c669c412d93fd0600756f774c3d2"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drpancake%2Fchard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drpancake%2Fchard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drpancake%2Fchard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drpancake%2Fchard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drpancake","download_url":"https://codeload.github.com/drpancake/chard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690113,"owners_count":20331726,"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-07-30T22:01:13.988Z","updated_at":"2025-03-15T05:30:43.278Z","avatar_url":"https://github.com/drpancake.png","language":"Python","readme":"# Chard\n\nChard is a simple async/await background task queue for Django. One process,\nno threads, no other dependencies.\n\nIt uses Django's ORM to keep track of tasks.\n\n📖 [**Documentation**](https://chard.readthedocs.io/en/latest/)\n\n🔗 [Check the example Django project](https://github.com/drpancake/chard-django-example)\n\n## Requirements\n\n- Python 3.8+\n- Django 4.1+\n\n## Installation\n\n```sh\npip install django-chard\n```\n\n## Quickstart\n\nFirst add `chard` anywhere in your `INSTALLED_APPS` setting and then run\nthe migrations:\n\n```sh\npython manage.py migrate\n```\n\nCreate a file called `tasks.py` in one of your apps and define a task:\n\n```python\nimport chard\nimport httpx\nfrom asgiref.sync import sync_to_async\n\nfrom .models import MyModel\n\n@chard.task\nasync def my_task(country_code):\n    url = f\"https://somewhere.com/some-api.json?country_code={country_code}\"\n    async with httpx.AsyncClient() as client:\n        resp = await client.get(url)\n        obj = resp.json()\n    for item in obj[\"items\"]:\n        await sync_to_async(MyModel.objects.create)(\n          country_code=country_code,\n          item=item\n        )\n```\n\nTo fire a task for the worker:\n\n```python\n# Note that all arguments must be JSON serializable.\nmy_task.send(\"gb\")\n```\n\nRun the worker process and it will watch for new pending tasks:\n\n```sh\npython manage.py chardworker\n```\n\nTo see a full example of Chard in action:\n\n🔗 [Check the example Django project](https://github.com/drpancake/chard-django-example)\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) the contributing guidelines.\n\n## License\n\nPlease see [LICENSE](LICENSE) for licensing details.\n\n## Changelog\n\n**0.2 (2022-09-16)**\n\n```\n- Type hinting\n- Return a task ID when queueing a task\n- Added docs\n- Tidying and bug fixes\n```\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrpancake%2Fchard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrpancake%2Fchard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrpancake%2Fchard/lists"}