{"id":19277839,"url":"https://github.com/seankerr/py-celery-sqlalchemy","last_synced_at":"2026-01-18T20:32:26.750Z","repository":{"id":188603677,"uuid":"678849486","full_name":"seankerr/py-celery-sqlalchemy","owner":"seankerr","description":"SQLAlchemy model serialization for celery.","archived":false,"fork":false,"pushed_at":"2024-01-31T16:58:34.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-04T20:42:17.419Z","etag":null,"topics":["celery","serialization","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/celery-sqlalchemy/","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/seankerr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2023-08-15T14:24:07.000Z","updated_at":"2025-01-17T14:38:38.000Z","dependencies_parsed_at":"2024-02-06T04:01:11.018Z","dependency_job_id":null,"html_url":"https://github.com/seankerr/py-celery-sqlalchemy","commit_stats":null,"previous_names":["seankerr/py-celery-sqlalchemy"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/seankerr/py-celery-sqlalchemy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seankerr%2Fpy-celery-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seankerr%2Fpy-celery-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seankerr%2Fpy-celery-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seankerr%2Fpy-celery-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seankerr","download_url":"https://codeload.github.com/seankerr/py-celery-sqlalchemy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seankerr%2Fpy-celery-sqlalchemy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28549830,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T19:56:05.265Z","status":"ssl_error","status_checked_at":"2026-01-18T19:55:54.685Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["celery","serialization","sqlalchemy"],"created_at":"2024-11-09T21:07:03.527Z","updated_at":"2026-01-18T20:32:26.733Z","avatar_url":"https://github.com/seankerr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# celery-sqlalchemy\n\nSQLAlchemy model serialization for celery. Supports SQLAlchemy 1.4 \u0026 2.0.\n\n### Install\n\n```sh\npip install celery-sqlalchemy\n```\n\n### How does it work?\n\nAny model or list of models passed to a celery task as a direct argument will be\nserialized/deserialized by `celery-sqlalchemy`.\n\n### Behind the scenes\n\nThe [orjson](https://github.com/ijl/orjson) library is used behind the scenes to handle\nserialization of commonly used Python types.\n\n### Usage\n\nBy default `celery-sqlalchemy` will configure Celery to use the `json+sqlalchemy`\ncontent type for all tasks and no further configuration is needed.\n\n```python\nfrom celery_sqlalchemy.celery import initialize as initialize_celery\nfrom celery_sqlalchemy.json import JsonSerializer\n\n# setup celery\ncelery = ...\n\n# initialize celery-sqlalchemy\ninitialize_celery(celery, JsonSerializer())\n\n# dispatch a task\nauthor = \"Alan Watts\"\ntitle = \"Become What You Are\"\n\ntask.delay(Model(author=author, title=title))\n```\n\n### Using the json+sqlalchemy content type in combination with other content types\n\nThe first way of doing this is by specifying the `json+sqlalchemy` content type as\nthe default task serializer.\n\n```python\nfrom celery_sqlalchemy.celery import initialize as initialize_celery\nfrom celery_sqlalchemy.json import JsonSerializer\n\n# setup celery\ncelery = ...\n\n# initialize celery-sqlalchemy without the `apply_serializer` setting\ninitialize_celery(celery, JsonSerializer(), apply_serializer=False)\n\n# combine the json+sqlalchemy content type with your other content types\ncelery.conf.accept_content = [\"json+sqlalchemy\", \"your content type\"]\ncelery.conf.result_accept_content = [\"json+sqlalchemy\", \"your content type\"]\n\n# set the default task serializer\ncelery.conf.task_serializer = \"json+sqlalchemy\"\n\n# dispatch a model task\nauthor = \"Alan Watts\"\ntitle = \"Become What You Are\"\n\ntask.delay(Model(author=author, title=title))\n\n# dispatch a task using another content type\ntask.apply_async((author, title), serializer=\"your content type\")\n```\n\nThe other way of doing this is by not specifying the default task serializer, and\ninstead using `apply_async()` to dispatch all tasks.\n\n```python\nfrom celery_sqlalchemy.celery import initialize as initialize_celery\nfrom celery_sqlalchemy.json import JsonSerializer\n\n# setup celery\ncelery = ...\n\n# initialize celery-sqlalchemy without the `apply_serializer` setting\ninitialize_celery(celery, JsonSerializer(), apply_serializer=False)\n\n# combine the json+sqlalchemy content type with your other content types\ncelery.conf.accept_content = [\"json+sqlalchemy\", \"your content type\"]\ncelery.conf.result_accept_content = [\"json+sqlalchemy\", \"your content type\"]\n\n# dispatch a model task\nauthor = \"Alan Watts\"\ntitle = \"Become What You Are\"\n\ntask.apply_async((Model(author=author, title=title),), serializer=\"json+sqlalchemy\")\n\n# dispatch a task using another content type\ntask.apply_async((author, title), serializer=\"your content type\")\n```\n\n### Changelog\n\n- **0.1.6**\n  - Extract celery support into its own module\n  - Remove `celery_sqlalchemy.initialize()`\n- **0.1.5**\n  - Bump sqlalchemy dependency\n- **0.1.4**\n  - Bug fix: schema model may already be converted to model instance when chaining\n- **0.1.3**\n  - Check list type when converting json back to argument\n- **0.1.2**\n  - Add py.typed for mypy\n- **0.1.1**\n  - Add support for SQLAlchemy 1.4\n- **0.1.0**\n  - Initial version with support for common Python types\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseankerr%2Fpy-celery-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseankerr%2Fpy-celery-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseankerr%2Fpy-celery-sqlalchemy/lists"}