byte-codec


Namebyte-codec JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryA simple Python library for encoding and decoding bytes
upload_time2024-10-18 23:22:33
maintainerNone
docs_urlNone
authorMuhammad Daffa
requires_python>=3.7
licenseMIT License Copyright (c) 2024 Muhammad Daffa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords bytes decoder utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Byte Codec

A simple Python Library for encoding and decoding various data types to and from bytes.

## Installation

```bash
pip install byte-codec
```

## Usage

```python
from byte_codec import ByteCodec

codec = ByteCodec()

# Encoding
int_bytes = codec.encode_from_int(12345)
string_bytes = codec.encode_from_string("Hello, World!")
float_bytes = codec.encode_from_float(3.14159)
list_bytes = codec.encode_from_list([b'\x01\x02', b'\x03\x04'])

# Decoding
int_value = codec.decode_to_int(int_bytes)
string_value = codec.decode_to_string(string_bytes)
float_value = codec.decode_to_float(float_bytes)
list_value = codec.decode_to_list(list_bytes, 2)

# Generic encoding
any_bytes = codec.encode_from_any(12345)  # Works with int, str, float, list, or bytes
```

## License

This Project is licensed under the MIT License - see the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "byte-codec",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "bytes, decoder, utility",
    "author": "Muhammad Daffa",
    "author_email": "Muhammad Daffa <mdaffa2301@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0e/7a/fda19a2db91b9221a20c110864ec8e53133e14f5e4c24454a3ac9fb1d781/byte_codec-0.1.4.tar.gz",
    "platform": null,
    "description": "# Byte Codec\n\nA simple Python Library for encoding and decoding various data types to and from bytes.\n\n## Installation\n\n```bash\npip install byte-codec\n```\n\n## Usage\n\n```python\nfrom byte_codec import ByteCodec\n\ncodec = ByteCodec()\n\n# Encoding\nint_bytes = codec.encode_from_int(12345)\nstring_bytes = codec.encode_from_string(\"Hello, World!\")\nfloat_bytes = codec.encode_from_float(3.14159)\nlist_bytes = codec.encode_from_list([b'\\x01\\x02', b'\\x03\\x04'])\n\n# Decoding\nint_value = codec.decode_to_int(int_bytes)\nstring_value = codec.decode_to_string(string_bytes)\nfloat_value = codec.decode_to_float(float_bytes)\nlist_value = codec.decode_to_list(list_bytes, 2)\n\n# Generic encoding\nany_bytes = codec.encode_from_any(12345)  # Works with int, str, float, list, or bytes\n```\n\n## License\n\nThis Project is licensed under the MIT License - see the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Muhammad Daffa  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A simple Python library for encoding and decoding bytes",
    "version": "0.1.4",
    "project_urls": {
        "Homepage": "https://github.com/dap23/byte_decoder"
    },
    "split_keywords": [
        "bytes",
        " decoder",
        " utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f68c3659a5e323764ce66787ee7aa51a3c39ed8fd56d5e66ca4afe1e5d7e674",
                "md5": "ca2032cef81a3933bcbe0d355f9649f0",
                "sha256": "e53f4ac09e27000a375ce03e6fd880361f1d351fda7d55a1ed3fd7c8683e7385"
            },
            "downloads": -1,
            "filename": "byte_codec-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca2032cef81a3933bcbe0d355f9649f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3929,
            "upload_time": "2024-10-18T23:22:31",
            "upload_time_iso_8601": "2024-10-18T23:22:31.407684Z",
            "url": "https://files.pythonhosted.org/packages/6f/68/c3659a5e323764ce66787ee7aa51a3c39ed8fd56d5e66ca4afe1e5d7e674/byte_codec-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e7afda19a2db91b9221a20c110864ec8e53133e14f5e4c24454a3ac9fb1d781",
                "md5": "f07d29ca0a9c3be3dbcd3e938b154ff9",
                "sha256": "b693458484f6cee969ea6ab305275d4e116ce4439236cd6edf81c189cddcd68a"
            },
            "downloads": -1,
            "filename": "byte_codec-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f07d29ca0a9c3be3dbcd3e938b154ff9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3849,
            "upload_time": "2024-10-18T23:22:33",
            "upload_time_iso_8601": "2024-10-18T23:22:33.137342Z",
            "url": "https://files.pythonhosted.org/packages/0e/7a/fda19a2db91b9221a20c110864ec8e53133e14f5e4c24454a3ac9fb1d781/byte_codec-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 23:22:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dap23",
    "github_project": "byte_decoder",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "byte-codec"
}
        
Elapsed time: 0.62079s