Skip to content

Commit 44c645f

Browse files
committed
Added bson
1 parent d03ba95 commit 44c645f

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

LICENSES/Unlicense.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Unlicense (Public Domain)
2+
============================
3+
4+
This is free and unencumbered software released into the public domain.
5+
6+
Anyone is free to copy, modify, publish, use, compile, sell, or
7+
distribute this software, either in source code form or as a compiled
8+
binary, for any purpose, commercial or non-commercial, and by any
9+
means.
10+
11+
In jurisdictions that recognize copyright laws, the author or authors
12+
of this software dedicate any and all copyright interest in the
13+
software to the public domain. We make this dedication for the benefit
14+
of the public at large and to the detriment of our heirs and
15+
successors. We intend this dedication to be an overt act of
16+
relinquishment in perpetuity of all present and future rights to this
17+
software under copyright law.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25+
OTHER DEALINGS IN THE SOFTWARE.
26+
27+
For more information, please refer to &lt;<https://unlicense.org/>&gt;

serialization/bson/ReadMe.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2021 KOLANICH
3+
4+
SPDX-License-Identifier: Unlicense
5+
-->
6+
7+
## bson.bson
8+
9+
Some blob of data serialized into BSON.
10+
11+
Source: Own work.

serialization/bson/bson.bson

141 Bytes
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2021 KOLANICH
2+
SPDX-License-Identifier: Unlicense

serialization/bson/generate.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
3+
import datetime
4+
import decimal
5+
from pathlib import Path
6+
7+
import dateutil.tz
8+
9+
import bson
10+
11+
__license__ = "Unlicense"
12+
13+
etalon_dict = {
14+
"kaitai": ["is", "awesome"],
15+
"bin": b"bin",
16+
"int": 2,
17+
"float": 3.0,
18+
"NaN": float("nan"),
19+
"inf": float("inf"),
20+
"decimal": decimal.Decimal(100500),
21+
"null": None,
22+
"ts": datetime.datetime(1970, 1, 1, 0, 0, tzinfo=dateutil.tz.tzutc())
23+
}
24+
25+
26+
if __name__ == "__main__":
27+
f = Path("bson.bson")
28+
f.write_bytes(bson.dumps(etalon_dict))

0 commit comments

Comments
 (0)