dybuf 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dybuf-0.1.0/LICENSE +16 -0
- dybuf-0.1.0/MANIFEST.in +4 -0
- dybuf-0.1.0/PKG-INFO +114 -0
- dybuf-0.1.0/README.md +75 -0
- dybuf-0.1.0/include/dybuf/dybuf.h +1085 -0
- dybuf-0.1.0/include/dybuf/plat_mem.h +105 -0
- dybuf-0.1.0/include/dybuf/plat_string.h +45 -0
- dybuf-0.1.0/include/dybuf/plat_type.h +59 -0
- dybuf-0.1.0/pyproject.toml +46 -0
- dybuf-0.1.0/setup.cfg +4 -0
- dybuf-0.1.0/setup.py +25 -0
- dybuf-0.1.0/src/dybuf/__init__.py +4 -0
- dybuf-0.1.0/src/dybuf/_core.c +37174 -0
- dybuf-0.1.0/src/dybuf/_core.pxd +79 -0
- dybuf-0.1.0/src/dybuf/_core.pyx +289 -0
- dybuf-0.1.0/src/dybuf/tests/__init__.py +1 -0
- dybuf-0.1.0/src/dybuf/tests/test_roundtrip.py +192 -0
- dybuf-0.1.0/src/dybuf.egg-info/PKG-INFO +114 -0
- dybuf-0.1.0/src/dybuf.egg-info/SOURCES.txt +19 -0
- dybuf-0.1.0/src/dybuf.egg-info/dependency_links.txt +1 -0
- dybuf-0.1.0/src/dybuf.egg-info/top_level.txt +1 -0
dybuf-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
dybuf, dynamic buffer library
|
|
2
|
+
Copyright (C) 2015-2016 Yuchi (yuchi518@gmail.com)
|
|
3
|
+
|
|
4
|
+
This program is free software; you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU General Public License version 2 as
|
|
6
|
+
published by the Free Software Foundation. For the terms of this
|
|
7
|
+
license, see <http://www.gnu.org/licenses>.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along
|
|
15
|
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
16
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
dybuf-0.1.0/MANIFEST.in
ADDED
dybuf-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dybuf
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python bindings for the dybuf dynamic buffer library.
|
|
5
|
+
Author-email: Yuchi <yuchi518@gmail.com>
|
|
6
|
+
Maintainer-email: Yuchi <yuchi518@gmail.com>
|
|
7
|
+
License: dybuf, dynamic buffer library
|
|
8
|
+
Copyright (C) 2015-2016 Yuchi (yuchi518@gmail.com)
|
|
9
|
+
|
|
10
|
+
This program is free software; you can redistribute it and/or modify
|
|
11
|
+
it under the terms of the GNU General Public License version 2 as
|
|
12
|
+
published by the Free Software Foundation. For the terms of this
|
|
13
|
+
license, see <http://www.gnu.org/licenses>.
|
|
14
|
+
|
|
15
|
+
This program is distributed in the hope that it will be useful,
|
|
16
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
GNU General Public License for more details.
|
|
19
|
+
|
|
20
|
+
You should have received a copy of the GNU General Public License along
|
|
21
|
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
22
|
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
23
|
+
Project-URL: Homepage, https://github.com/yuchi518/dybuf
|
|
24
|
+
Project-URL: Issues, https://github.com/yuchi518/dybuf/issues
|
|
25
|
+
Keywords: buffer,binary,cython
|
|
26
|
+
Classifier: Development Status :: 3 - Alpha
|
|
27
|
+
Classifier: Intended Audience :: Developers
|
|
28
|
+
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
29
|
+
Classifier: Operating System :: OS Independent
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
32
|
+
Classifier: Programming Language :: C
|
|
33
|
+
Classifier: Programming Language :: Cython
|
|
34
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
35
|
+
Requires-Python: >=3.8
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
License-File: LICENSE
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# dybuf python package
|
|
41
|
+
|
|
42
|
+
Python bindings for the [`dybuf`](../c/dybuf.h) dynamic buffer library implemented in C. The package exposes the `DyBuf` class implemented in Cython and ships binary wheels across the major desktop platforms.
|
|
43
|
+
|
|
44
|
+
## Key features
|
|
45
|
+
|
|
46
|
+
- Thin, fast wrapper around the original `dybuf` implementation.
|
|
47
|
+
- Supports reading and writing unsigned integers (8–64 bits), booleans, and raw byte payloads.
|
|
48
|
+
- Compatible with Windows, Linux, and macOS thanks to compiled extension modules.
|
|
49
|
+
- Designed for publishing on PyPI with automated release workflows.
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
Once released to PyPI the package can be installed with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install dybuf
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quick start
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from dybuf import DyBuf
|
|
63
|
+
|
|
64
|
+
buf = DyBuf(capacity=64)
|
|
65
|
+
buf.append_uint16(0x1234)
|
|
66
|
+
buf.append_uint32(0xDEADBEEF)
|
|
67
|
+
buf.append_bool(True)
|
|
68
|
+
|
|
69
|
+
buf.flip() # prepare for reading
|
|
70
|
+
print(hex(buf.next_uint16())) # 0x1234
|
|
71
|
+
print(hex(buf.next_uint32())) # 0xdeadbeef
|
|
72
|
+
print(buf.next_bool()) # True
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`write()` and `read()` let you work directly with arbitrary byte payloads, while `position`, `limit`, and `capacity` expose the cursor-style API provided by the original library.
|
|
76
|
+
|
|
77
|
+
## Developing locally
|
|
78
|
+
|
|
79
|
+
Create a virtual environment and install the build requirements:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python -m venv .venv
|
|
83
|
+
source .venv/bin/activate
|
|
84
|
+
pip install -r requirements-dev.txt # optional, see below
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Build the extension in editable mode for local testing:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install -e .
|
|
91
|
+
pytest
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The project is configured to build wheels via `python -m build`, producing both source and binary distributions:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
python -m build
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Generate the Sphinx documentation locally with:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install -r requirements-dev.txt # ensures sphinx/docutils are present
|
|
104
|
+
sphinx-build -b html docs docs/_build/html
|
|
105
|
+
open docs/_build/html/index.html # or use your preferred viewer
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Automated releases
|
|
109
|
+
|
|
110
|
+
A GitHub Actions workflow under `.github/workflows/pypi-release.yml` drives [cibuildwheel](https://github.com/pypa/cibuildwheel) to produce Windows, Linux, and macOS artifacts and publish them to PyPI. Provide a `PYPI_API_TOKEN` secret in your repository and tag releases with a semantic version (e.g. `v0.1.0`) to trigger the pipeline.
|
|
111
|
+
|
|
112
|
+
## Licensing
|
|
113
|
+
|
|
114
|
+
The wrapper is distributed under the GNU GPL v2, matching the original dybuf project.
|
dybuf-0.1.0/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# dybuf python package
|
|
2
|
+
|
|
3
|
+
Python bindings for the [`dybuf`](../c/dybuf.h) dynamic buffer library implemented in C. The package exposes the `DyBuf` class implemented in Cython and ships binary wheels across the major desktop platforms.
|
|
4
|
+
|
|
5
|
+
## Key features
|
|
6
|
+
|
|
7
|
+
- Thin, fast wrapper around the original `dybuf` implementation.
|
|
8
|
+
- Supports reading and writing unsigned integers (8–64 bits), booleans, and raw byte payloads.
|
|
9
|
+
- Compatible with Windows, Linux, and macOS thanks to compiled extension modules.
|
|
10
|
+
- Designed for publishing on PyPI with automated release workflows.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Once released to PyPI the package can be installed with:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install dybuf
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick start
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from dybuf import DyBuf
|
|
24
|
+
|
|
25
|
+
buf = DyBuf(capacity=64)
|
|
26
|
+
buf.append_uint16(0x1234)
|
|
27
|
+
buf.append_uint32(0xDEADBEEF)
|
|
28
|
+
buf.append_bool(True)
|
|
29
|
+
|
|
30
|
+
buf.flip() # prepare for reading
|
|
31
|
+
print(hex(buf.next_uint16())) # 0x1234
|
|
32
|
+
print(hex(buf.next_uint32())) # 0xdeadbeef
|
|
33
|
+
print(buf.next_bool()) # True
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`write()` and `read()` let you work directly with arbitrary byte payloads, while `position`, `limit`, and `capacity` expose the cursor-style API provided by the original library.
|
|
37
|
+
|
|
38
|
+
## Developing locally
|
|
39
|
+
|
|
40
|
+
Create a virtual environment and install the build requirements:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
python -m venv .venv
|
|
44
|
+
source .venv/bin/activate
|
|
45
|
+
pip install -r requirements-dev.txt # optional, see below
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Build the extension in editable mode for local testing:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install -e .
|
|
52
|
+
pytest
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The project is configured to build wheels via `python -m build`, producing both source and binary distributions:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python -m build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Generate the Sphinx documentation locally with:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install -r requirements-dev.txt # ensures sphinx/docutils are present
|
|
65
|
+
sphinx-build -b html docs docs/_build/html
|
|
66
|
+
open docs/_build/html/index.html # or use your preferred viewer
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Automated releases
|
|
70
|
+
|
|
71
|
+
A GitHub Actions workflow under `.github/workflows/pypi-release.yml` drives [cibuildwheel](https://github.com/pypa/cibuildwheel) to produce Windows, Linux, and macOS artifacts and publish them to PyPI. Provide a `PYPI_API_TOKEN` secret in your repository and tag releases with a semantic version (e.g. `v0.1.0`) to trigger the pipeline.
|
|
72
|
+
|
|
73
|
+
## Licensing
|
|
74
|
+
|
|
75
|
+
The wrapper is distributed under the GNU GPL v2, matching the original dybuf project.
|