{"id":15611478,"url":"https://github.com/smlng/pycayennelpp","last_synced_at":"2025-10-05T20:10:54.060Z","repository":{"id":46950872,"uuid":"155441027","full_name":"smlng/pycayennelpp","owner":"smlng","description":"A Cayenne Low Power Payload (CayenneLPP) decoder and encoder for Python","archived":false,"fork":false,"pushed_at":"2021-10-12T20:02:07.000Z","size":131,"stargazers_count":20,"open_issues_count":5,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-19T15:41:32.087Z","etag":null,"topics":["cayennelpp","decoding","encoder","internet-of-things","iot","lora","lorawan","micropython","pypi","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/smlng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-30T19:02:04.000Z","updated_at":"2024-06-11T04:23:12.000Z","dependencies_parsed_at":"2022-09-26T21:40:17.428Z","dependency_job_id":null,"html_url":"https://github.com/smlng/pycayennelpp","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/smlng/pycayennelpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smlng%2Fpycayennelpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smlng%2Fpycayennelpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smlng%2Fpycayennelpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smlng%2Fpycayennelpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smlng","download_url":"https://codeload.github.com/smlng/pycayennelpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smlng%2Fpycayennelpp/sbom","scorecard":{"id":833635,"data":{"date":"2025-08-11","repo":{"name":"github.com/smlng/pycayennelpp","commit":"28f2ba4fba602527d3369c9cfbce16b783916933"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/micropython-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/smlng/pycayennelpp/micropython-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/micropython-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/smlng/pycayennelpp/micropython-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/smlng/pycayennelpp/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/smlng/pycayennelpp/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/micropython-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/micropython-publish.yml:24","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/micropython-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T18:24:04.386Z","repository_id":46950872,"created_at":"2025-08-23T18:24:04.387Z","updated_at":"2025-08-23T18:24:04.387Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278510931,"owners_count":25999005,"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-05T02:00:06.059Z","response_time":54,"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":["cayennelpp","decoding","encoder","internet-of-things","iot","lora","lorawan","micropython","pypi","python"],"created_at":"2024-10-03T06:04:46.924Z","updated_at":"2025-10-05T20:10:53.997Z","avatar_url":"https://github.com/smlng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyCayenneLPP\n\n[![Travis-CI](https://travis-ci.com/smlng/pycayennelpp.svg?branch=master)](https://travis-ci.com/smlng/pycayennelpp)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/a47d55068ce348c2a83497d2ab5f07bf)](https://www.codacy.com/gh/smlng/pycayennelpp/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=smlng/pycayennelpp\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/a47d55068ce348c2a83497d2ab5f07bf)](https://www.codacy.com/gh/smlng/pycayennelpp/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=smlng/pycayennelpp\u0026utm_campaign=Badge_Coverage)\n[![PyPi](https://badge.fury.io/py/pycayennelpp.svg)](https://badge.fury.io/py/pycayennelpp)\n[![GitHub](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/smlng/pycayennelpp/blob/master/LICENSE)\n\nA Cayenne Low Power Payload (CayenneLPP) decoder and encoder written in Python.\n\nPyCayenneLPP offers a concise interface with proper encoding and decoding\nfunctionality for the CayenneLPP format, supporting many sensor types.\nThe project aims for overall high code quality and good test coverage.\n\nSee also [myDevicesIoT/CayenneLPP](https://github.com/myDevicesIoT/CayenneLPP)\nfor more information on the format and a reference implementation in C++.\n\nThe project is under active development. Releases will be published on the\nfly as soon as a certain number of new features and fixes have been made.\n\n## Supported Data Types\n\nThe following table lists the currently supported data types with the LPP code\n(which equals IPSO code - 3200), data size in bytes, dimensions, signedness,\nand data resolution.\n\n| Type Name      | LPP | Size | Dim | Signed | Resolution |\n|----------------|-----|------|-----|--------|------------|\n| Digital Input  |   0 |    1 |   1 | False  | 1          |\n| Digital Output |   1 |    1 |   1 | False  | 1          |\n| Analog Input   |   2 |    2 |   1 | True   | 0.01       |\n| Analog Output  |   3 |    2 |   1 | True   | 0.01       |\n| Generic Sensor | 100 |    4 |   1 | False  | 1          |\n| Illuminance    | 101 |    2 |   1 | False  | 1 Lux      |\n| Presence       | 102 |    1 |   1 | False  | 1          |\n| Temperature    | 103 |    2 |   1 | True   | 0.1°C      |\n| Humidity       | 104 |    1 |   1 | False  | 0.5 %      |\n| Accelerometer  | 113 |    6 |   3 | True   | 0.001 G    |\n| Barometer      | 115 |    2 |   1 | False  | 0.1 hPa    |\n| Voltage        | 116 |    2 |   1 | False  | 0.01 V     |\n| Current        | 117 |    2 |   1 | False  | 0.001 A    |\n| Frequency      | 118 |    4 |   1 | False  | 1 Hz       |\n| Percentage     | 120 |    1 |   1 | False  | 1 %        |\n| Altitude       | 121 |    2 |   1 | True   | 1 m        |\n| Load           | 122 |    3 |   1 | True   | 0.001 kg   |\n| Concentration  | 125 |    2 |   1 | False  | 1          |\n| Power          | 128 |    2 |   1 | False  | 1          |\n| Distance       | 130 |    4 |   1 | False  | 0.001 km   |\n| Energy         | 131 |    4 |   1 | False  | 0.001 kJ   |\n| Direction      | 132 |    2 |   1 | False  | 1 °        |\n| Time           | 133 |    4 |   1 | False  | 1 s        |\n| Gyrometer      | 134 |    6 |   3 | True   | 0.01 °/s   |\n| Colour         | 135 |    3 |   3 | False  | 1 RGB      |\n| Location       | 136 |    9 |   3 | True   | 0.00001 lat|\n|                |     |      |     |        | 0.00001 lon|\n|                |     |      |     |        | 0.01 alt   |\n| Switch         | 142 |    1 |   1 | False  | 1 on/off   |\n\n## Getting Started\n\nPyCayenneLPP does not have any external dependencies and only uses builtin\nfunctions and types of Python 3. It is compatible with all the latest and\nofficially supported Python versions 3.6 and above, though even Python 3.4\nwill do.\n\nSince PyCayenneLPP 1.2.0 MicroPython is officially supported, and published\nas a separate package under `micropython-pycayennelpp`.\n\n### Python 3 Prerequisites\n\nThe PyCayenneLPP package is available via PyPi using `pip`. To install it run:\n\n```Shell\npip3 install pycayennelpp\n```\n\n### MicroPython Prerequisites\n\nUsing MicroPythons `upip` module PyCayenneLPP can be installed as follows\nwithin MicroPython:\n\n```Python\nimport upip\nupip.install(\"micropython-pycayennelpp\")\n```\n\nOr alternatively run with in a shell:\n\n```Shell\nmicropython -m upip install micropython-pycayennelpp\n```\n\n### Usage Examples\n\nThe following show how to utilise PyCayenneLPP in your own application\nto encode and decode data into and from CayenneLPP. The code snippets\nwork with standard Python 3 as well as MicroPython, assuming you have\ninstalled the PyCayenneLPP package as shown above.\n\n***Encoding***\n\n```Python\nfrom cayennelpp import LppFrame\n\n\n# create empty frame\nframe = LppFrame()\n# add some sensor data\nframe.add_temperature(0, -1.2)\nframe.add_humidity(6, 34.5)\n# get byte buffer in CayenneLPP format\nbuffer = bytes(frame)\n```\n\n**Note:** MicroPython does not support `bytes(frame)` utilising the internal\nmethod `LppFrame.__bytes__(self)` (yet).\nHence, you need to use `LppFrame.to_bytes(self)` instead.\n\n***Decoding***\n\n```Python\nfrom cayennelpp import LppFrame\n\n\n# byte buffer in CayenneLPP format with 1 data item\n# i.e. on channel 1, with a temperature of 25.5C\nbuffer = bytearray([0x01, 0x67, 0x00, 0xff])\n# create frame from bytes\nframe = LppFrame().from_bytes(buffer)\n# print the frame and its data\nprint(frame)\n```\n\n***JSON Encoding***\n\nThe LppUtil class provides helper function for proper JSON encoding of\nPyCayenneLpp types, i.e. LppFrame, LppData and LppType.\n\n```python\nimport json\n\nfrom cayennelpp import LppFrame, LppUtil\n\n# create empty frame\nframe = LppFrame()\n# add some sensor data\nframe.add_temperature(0, -1.2)\nframe.add_humidity(6, 34.5)\n# json encoding\nprint(json.dumps(frame, default=LppUtil.json_encode, indent=2))\n```\n\nThere are two wrapper functions to explicitly encode the LPP type as a\nnumber or string, number being default for `LppUtil.json_encode` (see above):\n\n```python\n# type as number\nprint(json.dumps(frame, default=LppUtil.json_encode_type_int, indent=2))\n# type as string\nprint(json.dumps(frame, default=LppUtil.json_encode_type_str, indent=2))\n```\n\n## Contributing\n\nContributing to a free open source software project can take place in many\ndifferent ways. Feel free to open issues and create pull requests to help\nimproving this project. Each pull request has to pass some automatic tests and\nchecks run by Travis-CI before being merged into the master branch.\n\nPlease take note of the [contributing guidelines](CONTRIBUTING.md) and the\n[Code of Conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThis is a free open source software project published under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmlng%2Fpycayennelpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmlng%2Fpycayennelpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmlng%2Fpycayennelpp/lists"}