{"id":20606976,"url":"https://github.com/aamalev/rsjwt","last_synced_at":"2025-10-24T13:05:02.637Z","repository":{"id":262530118,"uuid":"886403640","full_name":"aamalev/rsjwt","owner":"aamalev","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-01T23:43:54.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T10:38:28.748Z","etag":null,"topics":["jwt","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aamalev.png","metadata":{"files":{"readme":"README.rst","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,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T22:35:06.000Z","updated_at":"2025-09-01T23:43:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"55c5e749-8bf4-441e-9259-be08e977f505","html_url":"https://github.com/aamalev/rsjwt","commit_stats":null,"previous_names":["aamalev/rsjwt"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aamalev/rsjwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Frsjwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Frsjwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Frsjwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Frsjwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aamalev","download_url":"https://codeload.github.com/aamalev/rsjwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamalev%2Frsjwt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280799423,"owners_count":26393089,"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-10-24T02:00:06.418Z","response_time":73,"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":["jwt","python"],"created_at":"2024-11-16T09:35:17.040Z","updated_at":"2025-10-24T13:05:02.620Z","avatar_url":"https://github.com/aamalev.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"rsjwt\n=====\n\n.. image:: https://img.shields.io/badge/License-MIT-blue.svg\n   :target: https://lbesson.mit-license.org/\n\n.. image:: https://img.shields.io/pypi/v/rsjwt.svg\n  :target: https://pypi.org/project/rsjwt\n\n.. image:: https://img.shields.io/pypi/pyversions/rsjwt.svg\n  :target: https://pypi.org/project/rsjwt\n  :alt: Python versions\n\n.. image:: https://readthedocs.org/projects/rsjwt/badge/?version=latest\n  :target: https://github.com/aamalev/rsjwt#rsjwt\n  :alt: Documentation Status\n\n.. image:: https://github.com/aamalev/rsjwt/workflows/Tests/badge.svg\n  :target: https://github.com/aamalev/rsjwt/actions?query=workflow%3ATests\n\n.. image:: https://img.shields.io/pypi/dm/rsjwt.svg\n  :target: https://pypistats.org/packages/rsjwt\n\n|\n\n.. image:: https://img.shields.io/badge/Rustc-1.80.0-blue?logo=rust\n  :target: https://www.rust-lang.org/\n\n.. image:: https://img.shields.io/badge/cargo-clippy-blue?logo=rust\n  :target: https://doc.rust-lang.org/stable/clippy/\n\n.. image:: https://img.shields.io/badge/PyO3-maturin-blue.svg\n  :target: https://github.com/PyO3/maturin\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n  :target: https://github.com/astral-sh/ruff\n  :alt: Linter: ruff\n\n.. image:: https://img.shields.io/badge/code%20style-ruff-000000.svg\n  :target: https://github.com/astral-sh/ruff\n  :alt: Code style: ruff\n\n.. image:: https://img.shields.io/badge/types-Mypy-blue.svg\n  :target: https://github.com/python/mypy\n  :alt: Code style: Mypy\n\n.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n  :alt: Hatch project\n  :target: https://github.com/pypa/hatch\n\n\nPython wrapper for:\n  | `jsonwebtoken \u003chttps://github.com/Keats/jsonwebtoken\u003e`_,\n\n\nFeatures\n--------\n\n* Encode and decode JWT\n* Support HS256, HS384, HS512\n* encode datetime.timedelta to float (now + delta)\n* encode datetime.datetime with timezone (example datetime.now(timezone.utc))\n\n\nInstall\n-------\n\n.. code-block:: shell\n\n    pip install rsjwt\n\n\nUsing\n-----\n\n.. code-block:: python\n\n  from datetime import timedelta\n\n  import rsjwt\n\n\n  v = rsjwt.JWT(\"my-secret\")\n  data = {\n      \"exp\": timedelta(hours=8),\n      \"s\": \"123\",\n      \"a\": [\"123\", 123],\n      \"m\": {\"a\": 1},\n  }\n  token = v.encode(data)\n  assert isinstance(token, str)\n\n  td = v.decode(token)\n  assert td[\"a\"] == data[\"a\"]\n  assert td[\"s\"] == data[\"s\"]\n  assert td[\"m\"] == data[\"m\"]\n  assert isinstance(td[\"exp\"], float)\n\n\nBench\n-----\n\n.. code-block:: bash\n\n    % hatch run bench:py           \n    ───────────────────────────────────────────────────────────────────────────────── bench.py3.9 ─────────────────────────────────────────────────────────────────────────────────\n    Python: 3.9.13 (v3.9.13:6de2ca5339, May 17 2022, 11:37:23) \n    [Clang 13.0.0 (clang-1300.0.29.30)]\n    Algorithm: HS256\n    Iterations: 1000000\n\n    |      package |   secs  |   n    |\n    | ------------ | ------- | ------ |\n    |        rsjwt |  2.2350 |  1.000 |\n    |        pyjwt |  9.4796 |  4.241 |\n    |      authlib | 12.0257 |  5.381 |\n    |  python-jose | 14.7699 |  6.608 |\n    |     jwcrypto | 61.5658 | 27.546 |\n    ──────────────────────────────────────────────────────────────────────────────── bench.py3.13 ─────────────────────────────────────────────────────────────────────────────────\n    Python: 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 16.0.0 (clang-1600.0.26.4)]\n    Algorithm: HS256\n    Iterations: 1000000\n\n    |      package |   secs  |   n    |\n    | ------------ | ------- | ------ |\n    |        rsjwt |  2.1902 |  1.000 |\n    |        pyjwt |  6.2054 |  2.833 |\n    |      authlib |  7.2337 |  3.303 |\n    |     jwcrypto | 41.4919 | 18.944 |\n\n\nDevelopment\n-----------\n\n.. code-block:: bash\n\n    cargo fmt\n    cargo clippy\n    maturin develop\n\n\nor use hatch envs:\n\n.. code-block:: bash\n\n    hatch run fmt\n    hatch run check\n    hatch run build\n    hatch run test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamalev%2Frsjwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faamalev%2Frsjwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamalev%2Frsjwt/lists"}