bitstring 4.1.4__tar.gz → 4.2.0b1__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.
Files changed (44) hide show
  1. {bitstring-4.1.4 → bitstring-4.2.0b1}/LICENSE +21 -21
  2. {bitstring-4.1.4 → bitstring-4.2.0b1}/MANIFEST.in +8 -8
  3. {bitstring-4.1.4/bitstring.egg-info → bitstring-4.2.0b1}/PKG-INFO +18 -16
  4. {bitstring-4.1.4 → bitstring-4.2.0b1}/README.md +132 -130
  5. bitstring-4.2.0b1/bitstring/__init__.py +263 -0
  6. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/__main__.py +49 -49
  7. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/array_.py +740 -740
  8. bitstring-4.1.4/bitstring/bitarray.py → bitstring-4.2.0b1/bitstring/bitarray_.py +576 -621
  9. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/bits.py +1789 -2095
  10. bitstring-4.2.0b1/bitstring/bitstore.py +247 -0
  11. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/bitstore_helpers.py +252 -337
  12. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/bitstream.py +686 -688
  13. bitstring-4.1.4/bitstring/options.py → bitstring-4.2.0b1/bitstring/bitstring_options.py +89 -72
  14. bitstring-4.2.0b1/bitstring/dtypes.py +244 -0
  15. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/exceptions.py +24 -23
  16. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/fp8.py +93 -93
  17. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/methods.py +98 -102
  18. bitstring-4.2.0b1/bitstring/utils.py +235 -0
  19. {bitstring-4.1.4 → bitstring-4.2.0b1/bitstring.egg-info}/PKG-INFO +18 -16
  20. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring.egg-info/SOURCES.txt +3 -2
  21. bitstring-4.2.0b1/bitstring.egg-info/requires.txt +1 -0
  22. {bitstring-4.1.4 → bitstring-4.2.0b1}/pyproject.toml +37 -37
  23. {bitstring-4.1.4 → bitstring-4.2.0b1}/release_notes.txt +1870 -1856
  24. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_array.py +915 -880
  25. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_bitarray.py +978 -971
  26. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_bits.py +974 -836
  27. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_bitstore.py +93 -93
  28. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_bitstream.py +4174 -4183
  29. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_bitstring.py +200 -220
  30. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_constbitstream.py +247 -249
  31. bitstring-4.2.0b1/tests/test_dtypes.py +86 -0
  32. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test_fp8.py +220 -220
  33. bitstring-4.1.4/bitstring/__init__.py +0 -199
  34. bitstring-4.1.4/bitstring/bitstore.py +0 -165
  35. bitstring-4.1.4/bitstring/dtypes.py +0 -118
  36. bitstring-4.1.4/bitstring/utils.py +0 -273
  37. bitstring-4.1.4/bitstring.egg-info/requires.txt +0 -1
  38. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring/py.typed +0 -0
  39. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring.egg-info/dependency_links.txt +0 -0
  40. {bitstring-4.1.4 → bitstring-4.2.0b1}/bitstring.egg-info/top_level.txt +0 -0
  41. {bitstring-4.1.4 → bitstring-4.2.0b1}/setup.cfg +0 -0
  42. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/__init__.py +0 -0
  43. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/smalltestfile +0 -0
  44. {bitstring-4.1.4 → bitstring-4.2.0b1}/tests/test.m1v +0 -0
@@ -1,21 +1,21 @@
1
- The MIT License
2
-
3
- Copyright (c) 2006 Scott Griffiths (dr.scottgriffiths@gmail.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License
2
+
3
+ Copyright (c) 2006 Scott Griffiths (dr.scottgriffiths@gmail.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1,8 +1,8 @@
1
- include tests/test.m1v
2
- include tests/smalltestfile
3
- include tests/__init__.py
4
- include release_notes.txt
5
- include README.md
6
- include bitstring/py.typed
7
- prune doc
8
- include LICENSE
1
+ include tests/test.m1v
2
+ include tests/smalltestfile
3
+ include tests/__init__.py
4
+ include release_notes.txt
5
+ include README.md
6
+ include bitstring/py.typed
7
+ prune doc
8
+ include LICENSE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bitstring
3
- Version: 4.1.4
3
+ Version: 4.2.0b1
4
4
  Summary: Simple construction, analysis and modification of binary data.
5
5
  Author-email: Scott Griffiths <dr.scottgriffiths@gmail.com>
6
6
  Project-URL: homepage, https://github.com/scott-griffiths/bitstring
@@ -10,42 +10,44 @@ Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Intended Audience :: Developers
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.7
14
13
  Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: License :: OSI Approved :: MIT License
19
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Requires-Python: >=3.7
20
+ Requires-Python: >=3.8
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: bitarray<3.0.0,>=2.8.0
23
+ Requires-Dist: bitarray<3.0.0,>=2.9.0
24
24
 
25
25
 
26
26
 
27
27
  ![bitstring](https://raw.githubusercontent.com/scott-griffiths/bitstring/main/doc/bitstring_logo_small.png "bitstring")
28
28
 
29
- **bitstring** is a Python module to help make the creation and analysis of binary data as simple and efficient as possible.
29
+ **bitstring** is a Python module to help make the creation and analysis of all types of bit-level binary data as simple and efficient as possible.
30
30
 
31
-
32
- It has been maintained since 2006 and now has many millions of downloads per year.
31
+ It has been actively maintained since 2006.
33
32
 
34
33
 
35
34
 
36
35
  [![CI badge](https://github.com/scott-griffiths/bitstring/actions/workflows/.github/workflows/ci.yml/badge.svg)](https://github.com/scott-griffiths/bitstring/actions/workflows/ci.yml)
37
- [![Docs](https://img.shields.io/readthedocs/bitstring)](https://bitstring.readthedocs.io/en/latest/)
38
- [![Codacy Badge](https://img.shields.io/codacy/grade/8869499b2eed44548fa1a5149dd451f4)](https://app.codacy.com/gh/scott-griffiths/bitstring/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
39
- [![Downloads](https://img.shields.io/pypi/dm/bitstring?color=blue)](https://pypistats.org/packages/bitstring) &nbsp; &nbsp;
40
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/scott-griffiths/bitstring/main?labpath=doc%2Fwalkthrough.ipynb)
36
+ [![Docs](https://img.shields.io/readthedocs/bitstring?logo=readthedocs&logoColor=white)](https://bitstring.readthedocs.io/en/latest/)
37
+ [![Codacy Badge](https://img.shields.io/codacy/grade/8869499b2eed44548fa1a5149dd451f4?logo=codacy)](https://app.codacy.com/gh/scott-griffiths/bitstring/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
38
+ [![Dependents (via libraries.io)](https://img.shields.io/librariesio/dependents/pypi/bitstring?logo=libraries.io&logoColor=white)](https://libraries.io/pypi/bitstring)
39
+ &nbsp; &nbsp;
40
+ [![Pepy Total Downlods](https://img.shields.io/pepy/dt/bitstring?logo=python&logoColor=white&labelColor=blue&color=blue)](https://pypistats.org/packages/bitstring)
41
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/bitstring?label=%40&labelColor=blue&color=blue)](https://pypistats.org/packages/bitstring)
42
+
41
43
 
42
44
  News
43
45
  ----
44
- **November 2023**: bitstring 4.1.3 released. Version 4.1 is a large update in terms of how much of the code has changed.
46
+ **29th November 2023**: bitstring 4.1.4 released. Version 4.1 is a large update in terms of how much of the code has changed.
45
47
 
46
- * Speed increased with bitarray dependency.
47
48
  * New Array class for homogeneous data.
48
49
  * Support for 8-bit floating point values.
50
+ * Speed increased with bitarray dependency.
49
51
 
50
52
  See the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt) for details. Please let me know if you encounter any problems.
51
53
 
@@ -146,9 +148,9 @@ The 700+ unit tests should all pass. They can be run from the root of the projec
146
148
  Credits
147
149
  -------
148
150
 
149
- Created by Scott Griffiths in 2006 to help with ad hoc parsing and creation of compressed video files.
150
- Maintained and expanded ever since as it became unexpectedly popular. Thanks to all those who have contributed ideas
151
- and code (and bug reports) over the years.
151
+ Created in 2006 to help with ad hoc parsing and creation of compressed video files.
152
+ Maintained and expanded ever since as it became unexpectedly popular.
153
+ Thanks to all those who have contributed ideas and code (and bug reports) over the years.
152
154
 
153
155
 
154
156
  <sub>Copyright (c) 2006 - 2023 Scott Griffiths</sub>
@@ -1,130 +1,132 @@
1
-
2
-
3
- ![bitstring](https://raw.githubusercontent.com/scott-griffiths/bitstring/main/doc/bitstring_logo_small.png "bitstring")
4
-
5
- **bitstring** is a Python module to help make the creation and analysis of binary data as simple and efficient as possible.
6
-
7
-
8
- It has been maintained since 2006 and now has many millions of downloads per year.
9
-
10
-
11
-
12
- [![CI badge](https://github.com/scott-griffiths/bitstring/actions/workflows/.github/workflows/ci.yml/badge.svg)](https://github.com/scott-griffiths/bitstring/actions/workflows/ci.yml)
13
- [![Docs](https://img.shields.io/readthedocs/bitstring)](https://bitstring.readthedocs.io/en/latest/)
14
- [![Codacy Badge](https://img.shields.io/codacy/grade/8869499b2eed44548fa1a5149dd451f4)](https://app.codacy.com/gh/scott-griffiths/bitstring/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
15
- [![Downloads](https://img.shields.io/pypi/dm/bitstring?color=blue)](https://pypistats.org/packages/bitstring) &nbsp; &nbsp;
16
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/scott-griffiths/bitstring/main?labpath=doc%2Fwalkthrough.ipynb)
17
-
18
- News
19
- ----
20
- **November 2023**: bitstring 4.1.3 released. Version 4.1 is a large update in terms of how much of the code has changed.
21
-
22
- * Speed increased with bitarray dependency.
23
- * New Array class for homogeneous data.
24
- * Support for 8-bit floating point values.
25
-
26
- See the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt) for details. Please let me know if you encounter any problems.
27
-
28
-
29
- Overview
30
- --------
31
-
32
- * Efficiently store and manipulate binary data in idiomatic Python.
33
- * Create bitstrings from hex, octal, binary, files, formatted strings, bytes, integers and floats of different endiannesses.
34
- * Powerful binary packing and unpacking functions.
35
- * Bit-level slicing, joining, searching, replacing and more.
36
- * Create and manipulate arrays of fixed-length bitstrings.
37
- * Read from and interpret bitstrings as streams of binary data.
38
- * Rich API - chances are that whatever you want to do there's a simple and elegant way of doing it.
39
- * Open source software, released under the MIT licence.
40
-
41
- Documentation
42
- -------------
43
- Extensive documentation for the bitstring module is available.
44
- Some starting points are given below:
45
-
46
- * [Overview](https://bitstring.readthedocs.io/en/stable/index.html)
47
- * [Quick Reference](https://bitstring.readthedocs.io/en/stable/quick_reference.html)
48
- * [Full Reference](https://bitstring.readthedocs.io/en/stable/reference.html)
49
-
50
- You can also try out the interactive walkthrough notebook on [binder](https://mybinder.org/v2/gh/scott-griffiths/bitstring/main?labpath=doc%2Fwalkthrough.ipynb).
51
-
52
- Release Notes
53
- -------------
54
-
55
- To see what been added, improved or fixed, and also to see what's coming in the next version, see the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt).
56
-
57
- Examples
58
- --------
59
-
60
- ### Installation
61
-
62
- $ pip install bitstring
63
-
64
- ### Creation
65
-
66
- >>> from bitstring import Bits, BitArray, BitStream, pack
67
- >>> a = BitArray(bin='00101')
68
- >>> b = Bits(a_file_object)
69
- >>> c = BitArray('0xff, 0b101, 0o65, uint6=22')
70
- >>> d = pack('intle16, hex=a, 0b1', 100, a='0x34f')
71
- >>> e = pack('<16h', *range(16))
72
-
73
- ### Different interpretations, slicing and concatenation
74
-
75
- >>> a = BitArray('0x3348')
76
- >>> a.hex, a.bin, a.uint, a.float, a.bytes
77
- ('3348', '0011001101001000', 13128, 0.2275390625, b'3H')
78
- >>> a[10:3:-1].bin
79
- '0101100'
80
- >>> '0b100' + 3*a
81
- BitArray('0x866906690669, 0b000')
82
-
83
- ### Reading data sequentially
84
-
85
- >>> b = BitStream('0x160120f')
86
- >>> b.read(12).hex
87
- '160'
88
- >>> b.pos = 0
89
- >>> b.read('uint12')
90
- 352
91
- >>> b.readlist('uint12, bin3')
92
- [288, '111']
93
-
94
- ### Searching, inserting and deleting
95
-
96
- >>> c = BitArray('0b00010010010010001111') # c.hex == '0x1248f'
97
- >>> c.find('0x48')
98
- (8,)
99
- >>> c.replace('0b001', '0xabc')
100
- >>> c.insert('0b0000', pos=3)
101
- >>> del c[12:16]
102
-
103
- ### Arrays of fixed-length formats
104
-
105
- >>> from bitstring import Array
106
- >>> a = Array('uint7', [9, 100, 3, 1])
107
- >>> a.data
108
- BitArray('0x1390181')
109
- >>> a[::2] *= 5
110
- >>> a
111
- Array('uint7', [45, 100, 15, 1])
112
-
113
-
114
- Unit Tests
115
- ----------
116
-
117
- The 700+ unit tests should all pass. They can be run from the root of the project with
118
-
119
- python -m unittest
120
-
121
-
122
- Credits
123
- -------
124
-
125
- Created by Scott Griffiths in 2006 to help with ad hoc parsing and creation of compressed video files.
126
- Maintained and expanded ever since as it became unexpectedly popular. Thanks to all those who have contributed ideas
127
- and code (and bug reports) over the years.
128
-
129
-
130
- <sub>Copyright (c) 2006 - 2023 Scott Griffiths</sub>
1
+
2
+
3
+ ![bitstring](https://raw.githubusercontent.com/scott-griffiths/bitstring/main/doc/bitstring_logo_small.png "bitstring")
4
+
5
+ **bitstring** is a Python module to help make the creation and analysis of all types of bit-level binary data as simple and efficient as possible.
6
+
7
+ It has been actively maintained since 2006.
8
+
9
+
10
+
11
+ [![CI badge](https://github.com/scott-griffiths/bitstring/actions/workflows/.github/workflows/ci.yml/badge.svg)](https://github.com/scott-griffiths/bitstring/actions/workflows/ci.yml)
12
+ [![Docs](https://img.shields.io/readthedocs/bitstring?logo=readthedocs&logoColor=white)](https://bitstring.readthedocs.io/en/latest/)
13
+ [![Codacy Badge](https://img.shields.io/codacy/grade/8869499b2eed44548fa1a5149dd451f4?logo=codacy)](https://app.codacy.com/gh/scott-griffiths/bitstring/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
14
+ [![Dependents (via libraries.io)](https://img.shields.io/librariesio/dependents/pypi/bitstring?logo=libraries.io&logoColor=white)](https://libraries.io/pypi/bitstring)
15
+ &nbsp; &nbsp;
16
+ [![Pepy Total Downlods](https://img.shields.io/pepy/dt/bitstring?logo=python&logoColor=white&labelColor=blue&color=blue)](https://pypistats.org/packages/bitstring)
17
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/bitstring?label=%40&labelColor=blue&color=blue)](https://pypistats.org/packages/bitstring)
18
+
19
+
20
+ News
21
+ ----
22
+ **29th November 2023**: bitstring 4.1.4 released. Version 4.1 is a large update in terms of how much of the code has changed.
23
+
24
+ * New Array class for homogeneous data.
25
+ * Support for 8-bit floating point values.
26
+ * Speed increased with bitarray dependency.
27
+
28
+ See the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt) for details. Please let me know if you encounter any problems.
29
+
30
+
31
+ Overview
32
+ --------
33
+
34
+ * Efficiently store and manipulate binary data in idiomatic Python.
35
+ * Create bitstrings from hex, octal, binary, files, formatted strings, bytes, integers and floats of different endiannesses.
36
+ * Powerful binary packing and unpacking functions.
37
+ * Bit-level slicing, joining, searching, replacing and more.
38
+ * Create and manipulate arrays of fixed-length bitstrings.
39
+ * Read from and interpret bitstrings as streams of binary data.
40
+ * Rich API - chances are that whatever you want to do there's a simple and elegant way of doing it.
41
+ * Open source software, released under the MIT licence.
42
+
43
+ Documentation
44
+ -------------
45
+ Extensive documentation for the bitstring module is available.
46
+ Some starting points are given below:
47
+
48
+ * [Overview](https://bitstring.readthedocs.io/en/stable/index.html)
49
+ * [Quick Reference](https://bitstring.readthedocs.io/en/stable/quick_reference.html)
50
+ * [Full Reference](https://bitstring.readthedocs.io/en/stable/reference.html)
51
+
52
+ You can also try out the interactive walkthrough notebook on [binder](https://mybinder.org/v2/gh/scott-griffiths/bitstring/main?labpath=doc%2Fwalkthrough.ipynb).
53
+
54
+ Release Notes
55
+ -------------
56
+
57
+ To see what been added, improved or fixed, and also to see what's coming in the next version, see the [release notes](https://github.com/scott-griffiths/bitstring/blob/main/release_notes.txt).
58
+
59
+ Examples
60
+ --------
61
+
62
+ ### Installation
63
+
64
+ $ pip install bitstring
65
+
66
+ ### Creation
67
+
68
+ >>> from bitstring import Bits, BitArray, BitStream, pack
69
+ >>> a = BitArray(bin='00101')
70
+ >>> b = Bits(a_file_object)
71
+ >>> c = BitArray('0xff, 0b101, 0o65, uint6=22')
72
+ >>> d = pack('intle16, hex=a, 0b1', 100, a='0x34f')
73
+ >>> e = pack('<16h', *range(16))
74
+
75
+ ### Different interpretations, slicing and concatenation
76
+
77
+ >>> a = BitArray('0x3348')
78
+ >>> a.hex, a.bin, a.uint, a.float, a.bytes
79
+ ('3348', '0011001101001000', 13128, 0.2275390625, b'3H')
80
+ >>> a[10:3:-1].bin
81
+ '0101100'
82
+ >>> '0b100' + 3*a
83
+ BitArray('0x866906690669, 0b000')
84
+
85
+ ### Reading data sequentially
86
+
87
+ >>> b = BitStream('0x160120f')
88
+ >>> b.read(12).hex
89
+ '160'
90
+ >>> b.pos = 0
91
+ >>> b.read('uint12')
92
+ 352
93
+ >>> b.readlist('uint12, bin3')
94
+ [288, '111']
95
+
96
+ ### Searching, inserting and deleting
97
+
98
+ >>> c = BitArray('0b00010010010010001111') # c.hex == '0x1248f'
99
+ >>> c.find('0x48')
100
+ (8,)
101
+ >>> c.replace('0b001', '0xabc')
102
+ >>> c.insert('0b0000', pos=3)
103
+ >>> del c[12:16]
104
+
105
+ ### Arrays of fixed-length formats
106
+
107
+ >>> from bitstring import Array
108
+ >>> a = Array('uint7', [9, 100, 3, 1])
109
+ >>> a.data
110
+ BitArray('0x1390181')
111
+ >>> a[::2] *= 5
112
+ >>> a
113
+ Array('uint7', [45, 100, 15, 1])
114
+
115
+
116
+ Unit Tests
117
+ ----------
118
+
119
+ The 700+ unit tests should all pass. They can be run from the root of the project with
120
+
121
+ python -m unittest
122
+
123
+
124
+ Credits
125
+ -------
126
+
127
+ Created in 2006 to help with ad hoc parsing and creation of compressed video files.
128
+ Maintained and expanded ever since as it became unexpectedly popular.
129
+ Thanks to all those who have contributed ideas and code (and bug reports) over the years.
130
+
131
+
132
+ <sub>Copyright (c) 2006 - 2023 Scott Griffiths</sub>