# temporal-codec
Encode and decode your Temporal data with Python
<!-- toc -->
* [Temporal SDK example](#temporal-sdk-example)
* [Installation](#installation)
* [Example](#example)
<!-- Regenerate with "pre-commit run -a markdown-toc" -->
<!-- tocstop -->
## Temporal SDK example
> See [keys.example.yaml](https://github.com/mrsimonemms/temporal-codec-server/blob/e11e08a51b0cc0673363e6df3d4d4280319bce2b/keys.example.yaml)
> for an example key file.
>
> For best results, use an environment variable rather than hardcoding the file
> path.
### Installation
```sh
pip install temporalcodec
```
### Example
```python
from dataclasses import dataclass_replace
from temporalio.client import Client
import temporalio.converter
from temporalcodec.encryption import EncryptionCodec
async def main():
client = await Client.connect(
"localhost:7233",
data_converter=dataclass_replace(
# Create the EncryptionCodec with keys loaded to memory
temporalio.converter.default(), payload_codec=await EncryptionCodec.create(keypath="/path/to/keyfile")
),
)
if __name__ == "__main__":
asyncio.run(main())
```
Raw data
{
"_id": null,
"home_page": null,
"name": "temporalcodec",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "codec, decoding, decryption, encoding, encryption, temporal, workflow",
"author": null,
"author_email": "Simon Emms <simon@simonemms.com>",
"download_url": "https://files.pythonhosted.org/packages/4b/2d/80598fa16338f7f5a235d49362405820d78907c20a4ba67298be65c79092/temporalcodec-0.4.3.tar.gz",
"platform": null,
"description": "# temporal-codec\n\nEncode and decode your Temporal data with Python\n\n<!-- toc -->\n\n* [Temporal SDK example](#temporal-sdk-example)\n * [Installation](#installation)\n * [Example](#example)\n\n<!-- Regenerate with \"pre-commit run -a markdown-toc\" -->\n\n<!-- tocstop -->\n\n## Temporal SDK example\n\n> See [keys.example.yaml](https://github.com/mrsimonemms/temporal-codec-server/blob/e11e08a51b0cc0673363e6df3d4d4280319bce2b/keys.example.yaml)\n> for an example key file.\n>\n> For best results, use an environment variable rather than hardcoding the file\n> path.\n\n### Installation\n\n```sh\npip install temporalcodec\n```\n\n### Example\n\n```python\nfrom dataclasses import dataclass_replace\nfrom temporalio.client import Client\nimport temporalio.converter\n\nfrom temporalcodec.encryption import EncryptionCodec\n\n\nasync def main():\n client = await Client.connect(\n \"localhost:7233\",\n data_converter=dataclass_replace(\n # Create the EncryptionCodec with keys loaded to memory\n temporalio.converter.default(), payload_codec=await EncryptionCodec.create(keypath=\"/path/to/keyfile\")\n ),\n )\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Encode and decode your Temporal data",
"version": "0.4.3",
"project_urls": {
"Bug Tracker": "https://github.com/mrsimonemms/temporal-codec-server/issues",
"Documentation": "https://github.com/mrsimonemms/temporal-codec-server",
"Homepage": "https://github.com/mrsimonemms/temporal-codec-server",
"Repository": "https://github.com/mrsimonemms/temporal-codec-server"
},
"split_keywords": [
"codec",
" decoding",
" decryption",
" encoding",
" encryption",
" temporal",
" workflow"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "dbf5532793dcd9b845195601b80674f15c7fe0e44a61dfd282a5ddf5d71b704d",
"md5": "9874997ee1652d79cdecfda6dae6bcd8",
"sha256": "0479c1806509bc78b983b223b5ef7ff87f170176185769978ccf56f9193ed2a4"
},
"downloads": -1,
"filename": "temporalcodec-0.4.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9874997ee1652d79cdecfda6dae6bcd8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6286,
"upload_time": "2025-07-13T13:40:06",
"upload_time_iso_8601": "2025-07-13T13:40:06.174240Z",
"url": "https://files.pythonhosted.org/packages/db/f5/532793dcd9b845195601b80674f15c7fe0e44a61dfd282a5ddf5d71b704d/temporalcodec-0.4.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4b2d80598fa16338f7f5a235d49362405820d78907c20a4ba67298be65c79092",
"md5": "1a7afffa501487ee87ce919892db79c9",
"sha256": "66ba18cb9cd5d060ffdb0889f9c204cd487d08d35a0f3264f8bfb7489907a2d7"
},
"downloads": -1,
"filename": "temporalcodec-0.4.3.tar.gz",
"has_sig": false,
"md5_digest": "1a7afffa501487ee87ce919892db79c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2742,
"upload_time": "2025-07-13T13:40:07",
"upload_time_iso_8601": "2025-07-13T13:40:07.173303Z",
"url": "https://files.pythonhosted.org/packages/4b/2d/80598fa16338f7f5a235d49362405820d78907c20a4ba67298be65c79092/temporalcodec-0.4.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-13 13:40:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mrsimonemms",
"github_project": "temporal-codec-server",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "temporalcodec"
}