Skip to content

Commit

Permalink
Finish writer documentation, final cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzoep committed Oct 9, 2024
1 parent d878674 commit f17f4af
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,16 @@ my_keys = KeyCollection(my_secret_key, my_other_secret_key)
with open("hello.txt.c4gh") as f:
crypt4gh = Crypt4GH(my_keys, f)
```

### Container Serialization

An initialized container can be also serialized. Currently the result
of such serialization should be exactly the same binary data as the
original input.

```python
from oarepo_cg4h import Crypt4GHWriter

writer = Crypt4GHWriter(crypt4gh, open("output.c4gh", "w"))
writer.write()
```
1 change: 1 addition & 0 deletions oarepo_c4gh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"SoftwareKey",
"C4GHKey",
"Crypt4GH",
"Crypt4GHWriter",
"Crypt4GHException",
"Crypt4GHKeyException",
"Crypt4GHHeaderException",
Expand Down
3 changes: 2 additions & 1 deletion oarepo_c4gh/crypt4gh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .crypt4gh import Crypt4GH
from .writer import Crypt4GHWriter

__all__ = ["Crypt4GH"]
__all__ = ["Crypt4GH", "Crypt4GHWriter"]
1 change: 1 addition & 0 deletions tests/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_abstract_container(self):
assert c4gh.header is None, "Implementation in abstract class"
assert c4gh.data_blocks is None, "Implementation in abstract class"


class TestCrypt4GHWriter(unittest.TestCase):

def test_writing_header(self):
Expand Down

0 comments on commit f17f4af

Please sign in to comment.