Skip to content

Commit

Permalink
Fixes to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-griffiths committed Jan 16, 2024
1 parent c460abf commit 1f3be25
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Empty file added bitformat/py.typed
Empty file.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"banner_hiding": "permanent",
"show_theme_credit": False,
"globaltoc_maxdepth": 2,
"source_url": 'https://github.com/scott-griffiths/bitstring/',
"source_url": 'https://github.com/scott-griffiths/bitformat/',
}
18 changes: 17 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@

`bitformat <https://github.com/scott-griffiths/bitformat/>`_ is a Python module for creating and parsing file formats, especially at the bit rather than byte level.

It is intended to complement the **bitstring** module, but is currently at a planning stage and is not yet recommended for use.
It is intended to complement the `bitstring <https://github.com/scott-griffiths/bitstring>`_ module, but is currently at a planning stage and is not yet recommended for use.

----

The `bitformat` module provides the ``Format`` class which is used to define how to create and parse binary formats. ::

from bitformat import Format, Dtype, Bits

f1 = Format(Bits('0xabc')) # A bit literal (12 bits long)
f2 = Format(Dtype('u5')) # A 5-bit unsigned integer

f3 = Format([f1, f2, f2]) # A format made of other formats

d = f3.pack(3, 10) # A Bits object packed with the values 3 and 10
f3.parse(d) # returns 3, 10




These docs are styled using the `Piccolo theme <https://github.com/piccolo-orm/piccolo_theme>`_.
Expand Down

0 comments on commit 1f3be25

Please sign in to comment.