PKG-INFO 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Metadata-Version: 1.1
  2. Name: bitstring
  3. Version: 3.1.3
  4. Summary: Simple construction, analysis and modification of binary data.
  5. Home-page: http://python-bitstring.googlecode.com
  6. Author: Scott Griffiths
  7. Author-email: scott@griffiths.name
  8. License: The MIT License: http://www.opensource.org/licenses/mit-license.php
  9. Download-URL: http://python-bitstring.googlecode.com
  10. Description: ================
  11. bitstring module
  12. ================
  13. **bitstring** is a pure Python module designed to help make
  14. the creation and analysis of binary data as simple and natural as possible.
  15. Bitstrings can be constructed from integers (big and little endian), hex,
  16. octal, binary, strings or files. They can be sliced, joined, reversed,
  17. inserted into, overwritten, etc. with simple functions or slice notation.
  18. They can also be read from, searched and replaced, and navigated in,
  19. similar to a file or stream.
  20. bitstring is open source software, and has been released under the MIT
  21. licence.
  22. This version supports Python 2.6 and later (including Python 3).
  23. For Python 2.4 and 2.5 you should instead download version 1.0.
  24. Documentation
  25. -------------
  26. The manual for the bitstring module is available here
  27. <http://packages.python.org/bitstring>. It contains a walk-through of all
  28. the features and a complete reference section.
  29. It is also available as a PDF as part of the source download.
  30. Installation
  31. ------------
  32. If you have downloaded and unzipped the package then you need to run the
  33. ``setup.py`` script with the 'install' argument::
  34. python setup.py install
  35. You may need to run this with root privileges on Unix-like systems.
  36. If you haven't yet downloaded the package then you can just try::
  37. easy_install bitstring
  38. or ::
  39. pip install bitstring
  40. Simple Examples
  41. ---------------
  42. Creation::
  43. >>> a = BitArray(bin='00101')
  44. >>> b = Bits(a_file_object)
  45. >>> c = BitArray('0xff, 0b101, 0o65, uint:6=22')
  46. >>> d = pack('intle:16, hex=a, 0b1', 100, a='0x34f')
  47. >>> e = pack('<16h', *range(16))
  48. Different interpretations, slicing and concatenation::
  49. >>> a = BitArray('0x1af')
  50. >>> a.hex, a.bin, a.uint
  51. ('1af', '000110101111', 431)
  52. >>> a[10:3:-1].bin
  53. '1110101'
  54. >>> 3*a + '0b100'
  55. BitArray('0o0657056705674')
  56. Reading data sequentially::
  57. >>> b = BitStream('0x160120f')
  58. >>> b.read(12).hex
  59. '160'
  60. >>> b.pos = 0
  61. >>> b.read('uint:12')
  62. 352
  63. >>> b.readlist('uint:12, bin:3')
  64. [288, '111']
  65. Searching, inserting and deleting::
  66. >>> c = BitArray('0b00010010010010001111') # c.hex == '0x1248f'
  67. >>> c.find('0x48')
  68. (8,)
  69. >>> c.replace('0b001', '0xabc')
  70. >>> c.insert('0b0000')
  71. >>> del c[12:16]
  72. Unit Tests
  73. ----------
  74. The 400+ unit tests should all pass for Python 2.6 and later.
  75. ----
  76. The bitstring module has been released as open source under the MIT License.
  77. Copyright (c) 2014 Scott Griffiths
  78. For more information see the project's homepage on Google Code:
  79. <http://python-bitstring.googlecode.com>
  80. Platform: all
  81. Classifier: Development Status :: 5 - Production/Stable
  82. Classifier: Intended Audience :: Developers
  83. Classifier: Operating System :: OS Independent
  84. Classifier: License :: OSI Approved :: MIT License
  85. Classifier: Programming Language :: Python :: 2.6
  86. Classifier: Programming Language :: Python :: 2.7
  87. Classifier: Programming Language :: Python :: 3
  88. Classifier: Programming Language :: Python :: 3.0
  89. Classifier: Programming Language :: Python :: 3.1
  90. Classifier: Programming Language :: Python :: 3.2
  91. Classifier: Programming Language :: Python :: 3.3
  92. Classifier: Topic :: Software Development :: Libraries :: Python Modules