Add Code
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2006 Scott Griffiths (dr.scottgriffiths@gmail.com)
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,133 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: bitstring
|
||||
Version: 4.2.3
|
||||
Summary: Simple construction, analysis and modification of binary data.
|
||||
Author-email: Scott Griffiths <dr.scottgriffiths@gmail.com>
|
||||
Project-URL: homepage, https://github.com/scott-griffiths/bitstring
|
||||
Project-URL: documentation, https://bitstring.readthedocs.io/
|
||||
Keywords: binary,bitarray,bitvector,bitfield
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||
Requires-Python: >=3.8
|
||||
Description-Content-Type: text/markdown
|
||||
License-File: LICENSE
|
||||
Requires-Dist: bitarray <3.0.0,>=2.9.0
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
**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.
|
||||
|
||||
It has been actively maintained since 2006.
|
||||
|
||||
|
||||
|
||||
[](https://github.com/scott-griffiths/bitstring/actions/workflows/ci.yml)
|
||||
[](https://bitstring.readthedocs.io/en/latest/)
|
||||
[](https://app.codacy.com/gh/scott-griffiths/bitstring/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
|
||||
[](https://libraries.io/pypi/bitstring)
|
||||
|
||||
[](https://www.pepy.tech/projects/bitstring)
|
||||
[](https://pypistats.org/packages/bitstring)
|
||||
|
||||
----
|
||||
|
||||
> [!NOTE]
|
||||
> 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.md).
|
||||
|
||||
|
||||
# Overview
|
||||
|
||||
* Efficiently store and manipulate binary data in idiomatic Python.
|
||||
* Create bitstrings from hex, octal, binary, files, formatted strings, bytes, integers and floats of different endiannesses.
|
||||
* Powerful binary packing and unpacking functions.
|
||||
* Bit-level slicing, joining, searching, replacing and more.
|
||||
* Create and manipulate arrays of fixed-length bitstrings.
|
||||
* Read from and interpret bitstrings as streams of binary data.
|
||||
* Rich API - chances are that whatever you want to do there's a simple and elegant way of doing it.
|
||||
* Open source software, released under the MIT licence.
|
||||
|
||||
# Documentation
|
||||
|
||||
Extensive documentation for the bitstring module is available.
|
||||
Some starting points are given below:
|
||||
|
||||
* [Overview](https://bitstring.readthedocs.io/en/stable/index.html)
|
||||
* [Quick Reference](https://bitstring.readthedocs.io/en/stable/quick_reference.html)
|
||||
* [Full Reference](https://bitstring.readthedocs.io/en/stable/reference.html)
|
||||
|
||||
There is also an introductory walkthrough notebook on [binder](https://mybinder.org/v2/gh/scott-griffiths/bitstring/main?labpath=doc%2Fwalkthrough.ipynb).
|
||||
|
||||
# Examples
|
||||
|
||||
### Installation
|
||||
```
|
||||
$ pip install bitstring
|
||||
```
|
||||
|
||||
### Creation
|
||||
```pycon
|
||||
>>> from bitstring import Bits, BitArray, BitStream, pack
|
||||
>>> a = BitArray(bin='00101')
|
||||
>>> b = Bits(a_file_object)
|
||||
>>> c = BitArray('0xff, 0b101, 0o65, uint6=22')
|
||||
>>> d = pack('intle16, hex=a, 0b1', 100, a='0x34f')
|
||||
>>> e = pack('<16h', *range(16))
|
||||
```
|
||||
|
||||
### Different interpretations, slicing and concatenation
|
||||
```pycon
|
||||
>>> a = BitArray('0x3348')
|
||||
>>> a.hex, a.bin, a.uint, a.float, a.bytes
|
||||
('3348', '0011001101001000', 13128, 0.2275390625, b'3H')
|
||||
>>> a[10:3:-1].bin
|
||||
'0101100'
|
||||
>>> '0b100' + 3*a
|
||||
BitArray('0x866906690669, 0b000')
|
||||
```
|
||||
|
||||
### Reading data sequentially
|
||||
```pycon
|
||||
>>> b = BitStream('0x160120f')
|
||||
>>> b.read(12).hex
|
||||
'160'
|
||||
>>> b.pos = 0
|
||||
>>> b.read('uint12')
|
||||
352
|
||||
>>> b.readlist('uint12, bin3')
|
||||
[288, '111']
|
||||
```
|
||||
|
||||
### Searching, inserting and deleting
|
||||
```pycon
|
||||
>>> c = BitArray('0b00010010010010001111') # c.hex == '0x1248f'
|
||||
>>> c.find('0x48')
|
||||
(8,)
|
||||
>>> c.replace('0b001', '0xabc')
|
||||
>>> c.insert('0b0000', pos=3)
|
||||
>>> del c[12:16]
|
||||
```
|
||||
|
||||
### Arrays of fixed-length formats
|
||||
```pycon
|
||||
>>> from bitstring import Array
|
||||
>>> a = Array('uint7', [9, 100, 3, 1])
|
||||
>>> a.data
|
||||
BitArray('0x1390181')
|
||||
>>> a[::2] *= 5
|
||||
>>> a
|
||||
Array('uint7', [45, 100, 15, 1])
|
||||
```
|
||||
|
||||
|
||||
<sub>Copyright (c) 2006 - 2024 Scott Griffiths</sub>
|
||||
@@ -0,0 +1,39 @@
|
||||
bitstring-4.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
bitstring-4.2.3.dist-info/LICENSE,sha256=NwXu1akj812b-sofEOkTbMhNbldlcK7GYb2mmZHxKeo,1106
|
||||
bitstring-4.2.3.dist-info/METADATA,sha256=aUUR8ljmKXchDLSPxTGzHot_7Wi659yUYUWS5Zi-3Ek,5017
|
||||
bitstring-4.2.3.dist-info/RECORD,,
|
||||
bitstring-4.2.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
||||
bitstring-4.2.3.dist-info/top_level.txt,sha256=9Xh4qfKH0fMhwxzzkSBk3uzTRGiYPPM1FuYFAgCB-ks,10
|
||||
bitstring/__init__.py,sha256=GjT0V01IeR3DBanzVa5utd4csONZx-PUSr6H0fuXnNU,13899
|
||||
bitstring/__main__.py,sha256=Lg6ARiAqKssp_uj1msYpiTGDybhJRshQmeftQ-yTpc0,1658
|
||||
bitstring/__pycache__/__init__.cpython-312.pyc,,
|
||||
bitstring/__pycache__/__main__.cpython-312.pyc,,
|
||||
bitstring/__pycache__/array_.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bitarray_.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bits.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bitstore.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bitstore_helpers.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bitstream.cpython-312.pyc,,
|
||||
bitstring/__pycache__/bitstring_options.cpython-312.pyc,,
|
||||
bitstring/__pycache__/dtypes.cpython-312.pyc,,
|
||||
bitstring/__pycache__/exceptions.cpython-312.pyc,,
|
||||
bitstring/__pycache__/fp8.cpython-312.pyc,,
|
||||
bitstring/__pycache__/luts.cpython-312.pyc,,
|
||||
bitstring/__pycache__/methods.cpython-312.pyc,,
|
||||
bitstring/__pycache__/mxfp.cpython-312.pyc,,
|
||||
bitstring/__pycache__/utils.cpython-312.pyc,,
|
||||
bitstring/array_.py,sha256=d4vuZAc0ecJC95RD5_WPApehyH-ZGms4pcxl2I0R90I,36201
|
||||
bitstring/bitarray_.py,sha256=kZTVYBo32vQuhQ4TZQldQkqRE5OMPVoKCoxEfKOTg8U,22319
|
||||
bitstring/bits.py,sha256=N2bszuYM_WrTfqx-5-m56Vu_XgPZLeTta4xysBqCSYs,76754
|
||||
bitstring/bitstore.py,sha256=jHk1cwBPqCJoYq2TEgIE37u_7K8HZq5K0L__X8edMgc,10337
|
||||
bitstring/bitstore_helpers.py,sha256=6UHBomeOZlfQmY_Wa17U1zi7FBo73n2D9GPPmPztIrk,9107
|
||||
bitstring/bitstream.py,sha256=Hu1ZpcCeP6lfpJiKAwKoJI22A-vsKATN1F2RvnS3rFY,29017
|
||||
bitstring/bitstring_options.py,sha256=54Io4xLDylwXdRQpb12eNkSpSXQhRTW9Aidx7G42h7w,3560
|
||||
bitstring/dtypes.py,sha256=oBrcavnz15vaBZ_GOVm0tOaW6Ml0oXoz8RyZSyqG6Zo,16897
|
||||
bitstring/exceptions.py,sha256=7O3oVJJgvUOadqIzg6U-8fUGyOTu_lmjbMtX3yPc18o,553
|
||||
bitstring/fp8.py,sha256=8CIiGlijn9OmBwdpJOl-1oVPUY6qVL2jGl1N8u8LjAg,3768
|
||||
bitstring/luts.py,sha256=KPuXC9MvTOQSOlb0bFBKbnuxXuVBYlhaFEdIgSrwtzs,27072
|
||||
bitstring/methods.py,sha256=3JM4jo8B6r3xQYY2nvbibmf7byQYTHTZye0F8D2lF10,4351
|
||||
bitstring/mxfp.py,sha256=IxXK0SZy5RTD883YwATg6tlqVfl1uCFQplp5BVBwx9Q,9058
|
||||
bitstring/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
bitstring/utils.py,sha256=tuWHppQUcCVLbtrZoO7eUkpNk6pJLtsOZT7QdWADW78,9221
|
||||
@@ -0,0 +1,5 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.43.0)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
bitstring
|
||||
Reference in New Issue
Block a user