pydantic-fixedwidth 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pydantic-fixedwidth might be problematic. Click here for more details.
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.github/dependabot.yaml +2 -1
- pydantic_fixedwidth-0.1.2/PKG-INFO +79 -0
- pydantic_fixedwidth-0.1.2/README.md +58 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/pyproject.toml +7 -2
- pydantic_fixedwidth-0.1.0/PKG-INFO +0 -26
- pydantic_fixedwidth-0.1.0/README.md +0 -8
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.devcontainer/devcontainer.json +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.devcontainer/onCreateCommand.sh +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.editorconfig +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.gitattributes +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.github/workflows/ci.yaml +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.github/workflows/release.yaml +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.gitignore +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.pre-commit-config.yaml +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.python-version +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.vscode/extensions.json +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/.vscode/settings.json +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/LICENSE +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/Makefile +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/pydantic_fixedwidth/__init__.py +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/pydantic_fixedwidth/fixedwidth.py +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/pydantic_fixedwidth/py.typed +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/tests/__init__.py +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/tests/test_fixedwidth.py +0 -0
- {pydantic_fixedwidth-0.1.0 → pydantic_fixedwidth-0.1.2}/uv.lock +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
2
2
|
version: 2
|
|
3
|
+
enable-beta-ecosystems: true
|
|
3
4
|
updates:
|
|
4
5
|
- package-ecosystem: github-actions
|
|
5
6
|
directory: /
|
|
6
7
|
schedule:
|
|
7
8
|
interval: monthly
|
|
8
9
|
|
|
9
|
-
- package-ecosystem:
|
|
10
|
+
- package-ecosystem: uv
|
|
10
11
|
directory: /
|
|
11
12
|
schedule:
|
|
12
13
|
interval: monthly
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pydantic-fixedwidth
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Custom Pydantic models for parsing and serializing fixed-width format of data.
|
|
5
|
+
Project-URL: Homepage, https://github.com/lasuillard/pydantic-fixedwidth
|
|
6
|
+
Project-URL: Repository, https://github.com/lasuillard/pydantic-fixedwidth.git
|
|
7
|
+
Project-URL: Issues, https://github.com/lasuillard/pydantic-fixedwidth/issues
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: <4.0,>=3.9
|
|
11
|
+
Requires-Dist: pydantic<3,>=2
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: mypy~=1.11; extra == 'dev'
|
|
14
|
+
Requires-Dist: ruff~=0.6; extra == 'dev'
|
|
15
|
+
Provides-Extra: test
|
|
16
|
+
Requires-Dist: coverage~=7.3; extra == 'test'
|
|
17
|
+
Requires-Dist: pytest-cov<7,>=5; extra == 'test'
|
|
18
|
+
Requires-Dist: pytest-sugar~=1.0; extra == 'test'
|
|
19
|
+
Requires-Dist: pytest~=8.0; extra == 'test'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# pydantic-fixedwidth
|
|
23
|
+
|
|
24
|
+
[](https://opensource.org/licenses/MIT)
|
|
25
|
+
[](https://github.com/lasuillard/pydantic-fixedwidth/actions/workflows/ci.yaml)
|
|
26
|
+
[](https://codecov.io/gh/lasuillard/pydantic-fixedwidth)
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
Custom Pydantic models for serializing and deserializing fixed-width format data.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## 🚀 Quick Start
|
|
33
|
+
|
|
34
|
+
Install this package with pip:
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
$ pip install pydantic-fixedwidth
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Usage example:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from datetime import datetime, timezone
|
|
44
|
+
|
|
45
|
+
from pydantic_fixedwidth import Fixedwidth, Padding
|
|
46
|
+
from pydantic_fixedwidth import OrderedField as Field
|
|
47
|
+
|
|
48
|
+
tzinfo = timezone.utc
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class SomeRequest(Fixedwidth):
|
|
52
|
+
string: str = Field(length=8)
|
|
53
|
+
hangul: str = Field(length=6)
|
|
54
|
+
number: int = Field(length=10, justify="right", fill_char=b"0")
|
|
55
|
+
|
|
56
|
+
# Just an padding field
|
|
57
|
+
p_: str = Padding(length=10)
|
|
58
|
+
|
|
59
|
+
# This field will be ignored in ser/de
|
|
60
|
+
ignore: str = Field(length=10, default="IGNORE", exclude=True)
|
|
61
|
+
|
|
62
|
+
ts: datetime = Field(
|
|
63
|
+
length=20,
|
|
64
|
+
to_str=lambda dt: dt.strftime("%Y%m%d%H%M%S%f"),
|
|
65
|
+
from_str=lambda s: datetime.strptime(s, "%Y%m%d%H%M%S%f").replace(tzinfo=tzinfo),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
some_request = SomeRequest(
|
|
70
|
+
string="<DFG&",
|
|
71
|
+
hangul="한글",
|
|
72
|
+
number=381,
|
|
73
|
+
ts=datetime(2024, 1, 23, 14, 11, 20, 124277, tzinfo=tzinfo),
|
|
74
|
+
)
|
|
75
|
+
b = some_request.format_bytes()
|
|
76
|
+
|
|
77
|
+
assert len(b) == 54
|
|
78
|
+
assert b == b"<DFG& \xed\x95\x9c\xea\xb8\x800000000381 20240123141120124277"
|
|
79
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# pydantic-fixedwidth
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://github.com/lasuillard/pydantic-fixedwidth/actions/workflows/ci.yaml)
|
|
5
|
+
[](https://codecov.io/gh/lasuillard/pydantic-fixedwidth)
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
Custom Pydantic models for serializing and deserializing fixed-width format data.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## 🚀 Quick Start
|
|
12
|
+
|
|
13
|
+
Install this package with pip:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
$ pip install pydantic-fixedwidth
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Usage example:
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from datetime import datetime, timezone
|
|
23
|
+
|
|
24
|
+
from pydantic_fixedwidth import Fixedwidth, Padding
|
|
25
|
+
from pydantic_fixedwidth import OrderedField as Field
|
|
26
|
+
|
|
27
|
+
tzinfo = timezone.utc
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SomeRequest(Fixedwidth):
|
|
31
|
+
string: str = Field(length=8)
|
|
32
|
+
hangul: str = Field(length=6)
|
|
33
|
+
number: int = Field(length=10, justify="right", fill_char=b"0")
|
|
34
|
+
|
|
35
|
+
# Just an padding field
|
|
36
|
+
p_: str = Padding(length=10)
|
|
37
|
+
|
|
38
|
+
# This field will be ignored in ser/de
|
|
39
|
+
ignore: str = Field(length=10, default="IGNORE", exclude=True)
|
|
40
|
+
|
|
41
|
+
ts: datetime = Field(
|
|
42
|
+
length=20,
|
|
43
|
+
to_str=lambda dt: dt.strftime("%Y%m%d%H%M%S%f"),
|
|
44
|
+
from_str=lambda s: datetime.strptime(s, "%Y%m%d%H%M%S%f").replace(tzinfo=tzinfo),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
some_request = SomeRequest(
|
|
49
|
+
string="<DFG&",
|
|
50
|
+
hangul="한글",
|
|
51
|
+
number=381,
|
|
52
|
+
ts=datetime(2024, 1, 23, 14, 11, 20, 124277, tzinfo=tzinfo),
|
|
53
|
+
)
|
|
54
|
+
b = some_request.format_bytes()
|
|
55
|
+
|
|
56
|
+
assert len(b) == 54
|
|
57
|
+
assert b == b"<DFG& \xed\x95\x9c\xea\xb8\x800000000381 20240123141120124277"
|
|
58
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pydantic-fixedwidth"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.2"
|
|
4
4
|
description = "Custom Pydantic models for parsing and serializing fixed-width format of data."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -19,12 +19,17 @@ test = [
|
|
|
19
19
|
"pytest~=8.0",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
|
+
[project.urls]
|
|
23
|
+
Homepage = "https://github.com/lasuillard/pydantic-fixedwidth"
|
|
24
|
+
Repository = "https://github.com/lasuillard/pydantic-fixedwidth.git"
|
|
25
|
+
Issues = "https://github.com/lasuillard/pydantic-fixedwidth/issues"
|
|
26
|
+
|
|
22
27
|
[build-system]
|
|
23
28
|
requires = ["hatchling"]
|
|
24
29
|
build-backend = "hatchling.build"
|
|
25
30
|
|
|
26
31
|
[tool.hatch.build.targets.wheel]
|
|
27
|
-
packages = ["
|
|
32
|
+
packages = ["pydantic_fixedwidth"]
|
|
28
33
|
|
|
29
34
|
[tool.ruff]
|
|
30
35
|
target-version = "py39"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: pydantic-fixedwidth
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Custom Pydantic models for parsing and serializing fixed-width format of data.
|
|
5
|
-
License-Expression: MIT
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Python: <4.0,>=3.9
|
|
8
|
-
Requires-Dist: pydantic<3,>=2
|
|
9
|
-
Provides-Extra: dev
|
|
10
|
-
Requires-Dist: mypy~=1.11; extra == 'dev'
|
|
11
|
-
Requires-Dist: ruff~=0.6; extra == 'dev'
|
|
12
|
-
Provides-Extra: test
|
|
13
|
-
Requires-Dist: coverage~=7.3; extra == 'test'
|
|
14
|
-
Requires-Dist: pytest-cov<7,>=5; extra == 'test'
|
|
15
|
-
Requires-Dist: pytest-sugar~=1.0; extra == 'test'
|
|
16
|
-
Requires-Dist: pytest~=8.0; extra == 'test'
|
|
17
|
-
Description-Content-Type: text/markdown
|
|
18
|
-
|
|
19
|
-
# pydantic-fixedwidth
|
|
20
|
-
|
|
21
|
-
[](https://opensource.org/licenses/MIT)
|
|
22
|
-
[](https://github.com/lasuillard/pydantic-fixedwidth/actions/workflows/ci.yaml)
|
|
23
|
-
[](https://codecov.io/gh/lasuillard/pydantic-fixedwidth)
|
|
24
|
-

|
|
25
|
-
|
|
26
|
-
Custom Pydantic models for parsing and serializing fixed-width format of data.
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# pydantic-fixedwidth
|
|
2
|
-
|
|
3
|
-
[](https://opensource.org/licenses/MIT)
|
|
4
|
-
[](https://github.com/lasuillard/pydantic-fixedwidth/actions/workflows/ci.yaml)
|
|
5
|
-
[](https://codecov.io/gh/lasuillard/pydantic-fixedwidth)
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Custom Pydantic models for parsing and serializing fixed-width format of data.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|