odiatranslit 0.1.0__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.
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Srinibash Samal
4
+
5
+ Portions of this software (odia_transliterate/schemes.py and
6
+ odia_transliterate/_engine.py) are adapted from OpenOdia
7
+ (https://github.com/soumendrak/openodia), which is licensed under the
8
+ MIT License:
9
+
10
+ <PASTE THE COPYRIGHT LINE FROM OPENODIA'S LICENSE FILE HERE>
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: odiatranslit
3
+ Version: 0.1.0
4
+ Summary: Odia <-> Roman transliteration (ISO 15919, Hunterian, ITRANS)
5
+ Author: Srinibash Samal
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/srinibashsamal/odiatranslit
8
+ Project-URL: Issues, https://github.com/srinibashsamal/odiatranslit/issues
9
+ Keywords: odia,oriya,transliteration,iso15919,itrans,indic
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Text Processing :: Linguistic
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7; extra == "dev"
27
+ Requires-Dist: ruff>=0.5; extra == "dev"
28
+ Requires-Dist: mypy>=1.10; extra == "dev"
29
+ Requires-Dist: build; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # Odia Transliterate
33
+
34
+ Convert Odia text to Roman (Latin) script and back, in pure Python.
35
+
36
+ Supports three romanisation schemes, works in both directions, and can
37
+ round-trip text without any loss.
38
+
39
+ ```python
40
+ >>> from odiatranslit import to_roman, from_roman
41
+ >>> to_roman("ଓଡ଼ିଆ ଭାଷା")
42
+ 'ōṛiā bhāṣā'
43
+ >>> from_roman("namaskAra", "ITRANS")
44
+ 'ନମସ୍କାର'
45
+
46
+ ```
47
+
48
+ ## Features
49
+
50
+ - **Two directions**: Odia → Roman with `to_roman`, Roman → Odia with `from_roman`
51
+ - **Three schemes**: ISO 15919, Hunterian and ITRANS
52
+ - **Lossless round-trip** for ISO 15919 and ITRANS with `reversible=True`
53
+ - **Mixed text is safe**: English words, numbers and punctuation pass through untouched
54
+ - **Command-line tool** included
55
+ - **No dependencies**, fully type-hinted
56
+
57
+ ## Installation
58
+
59
+ ```bash
60
+ pip install odiatranslit
61
+ ```
62
+
63
+ Requires Python 3.10 or later.
64
+
65
+ ## Schemes
66
+
67
+ | Scheme | Best for | Example: ଓଡ଼ିଆ ଭାଷା | Reversible |
68
+ | -------------------- | --------------------------------------- | ------------------- | ---------- |
69
+ | `ISO15919` (default) | Academic writing, citations, catalogues | `ōṛiā bhāṣā` | Yes |
70
+ | `ITRANS` | Typing Odia on an English keyboard | `o.DiA bhAShA` | Yes |
71
+ | `Hunterian` | Names, places, URLs, search | `oria bhasha` | No (lossy) |
72
+
73
+ ## Usage
74
+
75
+ ### Odia → Roman
76
+
77
+ ```python
78
+ from odiatranslit import to_roman
79
+
80
+ to_roman("ଓଡ଼ିଆ") # 'ōṛiā'
81
+ to_roman("ନମସ୍କାର", "Hunterian") # 'namaskara'
82
+ to_roman("ନମସ୍କାର", "ITRANS") # 'namaskAra'
83
+ ```
84
+
85
+ ### Roman → Odia
86
+
87
+ ```python
88
+ from odiatranslit import from_roman
89
+
90
+ from_roman("namaskāra") # 'ନମସ୍କାର'
91
+ from_roman("namaskAra", "ITRANS") # 'ନମସ୍କାର'
92
+ from_roman("jesan", "Hunterian") # 'ଜେସନ୍'
93
+ ```
94
+
95
+ ### One function for both directions
96
+
97
+ ```python
98
+ from odiatranslit import transliterate
99
+
100
+ transliterate("ଓଡ଼ିଆ") # 'ōṛiā'
101
+ transliterate("namaskAra", "ITRANS", reverse=True) # 'ନମସ୍କାର'
102
+ ```
103
+
104
+ ### Scheme shortcuts
105
+
106
+ | Odia → Roman | Roman → Odia |
107
+ | ------------------------------------- | ---------------------- |
108
+ | `to_iso15919(text, reversible=False)` | `from_iso15919(text)` |
109
+ | `to_itrans(text, reversible=False)` | `from_itrans(text)` |
110
+ | `to_hunterian(text)` | `from_hunterian(text)` |
111
+
112
+ ```python
113
+ from odiatranslit import to_itrans, from_itrans
114
+
115
+ to_itrans("ନମସ୍କାର") # 'namaskAra'
116
+ from_itrans("namaskAra") # 'ନମସ୍କାର'
117
+ ```
118
+
119
+ ### Lossless round-trip
120
+
121
+ Pass `reversible=True` when you need to get the exact original text back.
122
+ Anything that could be misread is escaped.
123
+
124
+ ```python
125
+ text = "ଜଗନ୍ନାଥ Puri"
126
+
127
+ roman = to_roman(text, "ITRANS", reversible=True) # 'jagannAtha _{Puri_}'
128
+ assert from_roman(roman, "ITRANS") == text
129
+ ```
130
+
131
+ `reversible` works with ISO 15919 and ITRANS. Hunterian merges several
132
+ letters (for example ଣ, ଞ and ନ all become `n`), so it cannot be reversed
133
+ exactly.
134
+
135
+ ### With pandas
136
+
137
+ ```python
138
+ df["name_roman"] = df["name_odia"].map(to_hunterian)
139
+ ```
140
+
141
+ ## Command line
142
+
143
+ ```bash
144
+ odiatranslit "ଓଡ଼ିଆ" # ōṛiā
145
+ odiatranslit "ନମସ୍କାର" -s Hunterian # namaskara
146
+ odiatranslit -r "namaskAra" -s ITRANS # ନମସ୍କାର
147
+ odiatranslit -i input.txt -o output.txt
148
+ echo "ଜଗନ୍ନାଥ" | odiatranslit
149
+ ```
150
+
151
+ | Option | Description |
152
+ | ----------------- | ----------------------------------------------------- |
153
+ | `text` | Text to convert (reads from `-i` or stdin if omitted) |
154
+ | `-s`, `--scheme` | `ISO15919` (default), `Hunterian` or `ITRANS` |
155
+ | `-r`, `--reverse` | Convert Roman → Odia |
156
+ | `--reversible` | Escape output so it converts back exactly |
157
+ | `-i`, `--input` | Read from a UTF-8 file |
158
+ | `-o`, `--output` | Write to a file instead of the screen |
159
+
160
+ ## Notes
161
+
162
+ - Odia digits (୦–୯) become ASCII digits in Hunterian, and in ITRANS
163
+ unless `reversible=True`. ISO 15919 keeps them as they are.
164
+ - ଡ଼ and ଢ଼ have their own spellings: `ṛ`/`ṛh` (ISO), `.D`/`.Dh` (ITRANS),
165
+ `r`/`rh` (Hunterian).
166
+ - ITRANS also accepts common alternatives such as `aa` for `A` and `ii` for `I`.
167
+ - Hunterian decoding is best-effort. Where a spelling is shared, the most
168
+ common Odia letter is chosen.
169
+
170
+ ## Development
171
+
172
+ ```bash
173
+ pip install -e ".[dev]"
174
+ pytest # unit tests + docstring examples
175
+ ruff check .
176
+ mypy
177
+ ```
178
+
179
+ ## Project layout
180
+
181
+ ```
182
+ odiatranslit/
183
+ ├── odiatranslit/
184
+ │ ├── __init__.py # public exports
185
+ │ ├── api.py # public functions
186
+ │ ├── _engine.py # internal encoder / decoder
187
+ │ ├── schemes.py # letter tables for each scheme
188
+ │ ├── cli.py # command-line tool
189
+ │ └── py.typed
190
+ ├── tests/
191
+ │ └── test_transliterate.py
192
+ ├── pyproject.toml
193
+ ├── LICENSE
194
+ └── README.md
195
+ ```
196
+
197
+ ## Acknowledgements
198
+
199
+ The letter tables and transliteration engine are adapted from
200
+ [OpenOdia](https://github.com/soumendrak/openodia) (MIT License).
201
+
202
+ ## Contributing
203
+
204
+ Bug reports and suggestions are welcome. Please
205
+ [open an issue](https://github.com/srinibashsamal/odiatranslit/issues)
206
+ with the input text, the scheme used, and the output you expected.
207
+
208
+ ## License
209
+
210
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,179 @@
1
+ # Odia Transliterate
2
+
3
+ Convert Odia text to Roman (Latin) script and back, in pure Python.
4
+
5
+ Supports three romanisation schemes, works in both directions, and can
6
+ round-trip text without any loss.
7
+
8
+ ```python
9
+ >>> from odiatranslit import to_roman, from_roman
10
+ >>> to_roman("ଓଡ଼ିଆ ଭାଷା")
11
+ 'ōṛiā bhāṣā'
12
+ >>> from_roman("namaskAra", "ITRANS")
13
+ 'ନମସ୍କାର'
14
+
15
+ ```
16
+
17
+ ## Features
18
+
19
+ - **Two directions**: Odia → Roman with `to_roman`, Roman → Odia with `from_roman`
20
+ - **Three schemes**: ISO 15919, Hunterian and ITRANS
21
+ - **Lossless round-trip** for ISO 15919 and ITRANS with `reversible=True`
22
+ - **Mixed text is safe**: English words, numbers and punctuation pass through untouched
23
+ - **Command-line tool** included
24
+ - **No dependencies**, fully type-hinted
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install odiatranslit
30
+ ```
31
+
32
+ Requires Python 3.10 or later.
33
+
34
+ ## Schemes
35
+
36
+ | Scheme | Best for | Example: ଓଡ଼ିଆ ଭାଷା | Reversible |
37
+ | -------------------- | --------------------------------------- | ------------------- | ---------- |
38
+ | `ISO15919` (default) | Academic writing, citations, catalogues | `ōṛiā bhāṣā` | Yes |
39
+ | `ITRANS` | Typing Odia on an English keyboard | `o.DiA bhAShA` | Yes |
40
+ | `Hunterian` | Names, places, URLs, search | `oria bhasha` | No (lossy) |
41
+
42
+ ## Usage
43
+
44
+ ### Odia → Roman
45
+
46
+ ```python
47
+ from odiatranslit import to_roman
48
+
49
+ to_roman("ଓଡ଼ିଆ") # 'ōṛiā'
50
+ to_roman("ନମସ୍କାର", "Hunterian") # 'namaskara'
51
+ to_roman("ନମସ୍କାର", "ITRANS") # 'namaskAra'
52
+ ```
53
+
54
+ ### Roman → Odia
55
+
56
+ ```python
57
+ from odiatranslit import from_roman
58
+
59
+ from_roman("namaskāra") # 'ନମସ୍କାର'
60
+ from_roman("namaskAra", "ITRANS") # 'ନମସ୍କାର'
61
+ from_roman("jesan", "Hunterian") # 'ଜେସନ୍'
62
+ ```
63
+
64
+ ### One function for both directions
65
+
66
+ ```python
67
+ from odiatranslit import transliterate
68
+
69
+ transliterate("ଓଡ଼ିଆ") # 'ōṛiā'
70
+ transliterate("namaskAra", "ITRANS", reverse=True) # 'ନମସ୍କାର'
71
+ ```
72
+
73
+ ### Scheme shortcuts
74
+
75
+ | Odia → Roman | Roman → Odia |
76
+ | ------------------------------------- | ---------------------- |
77
+ | `to_iso15919(text, reversible=False)` | `from_iso15919(text)` |
78
+ | `to_itrans(text, reversible=False)` | `from_itrans(text)` |
79
+ | `to_hunterian(text)` | `from_hunterian(text)` |
80
+
81
+ ```python
82
+ from odiatranslit import to_itrans, from_itrans
83
+
84
+ to_itrans("ନମସ୍କାର") # 'namaskAra'
85
+ from_itrans("namaskAra") # 'ନମସ୍କାର'
86
+ ```
87
+
88
+ ### Lossless round-trip
89
+
90
+ Pass `reversible=True` when you need to get the exact original text back.
91
+ Anything that could be misread is escaped.
92
+
93
+ ```python
94
+ text = "ଜଗନ୍ନାଥ Puri"
95
+
96
+ roman = to_roman(text, "ITRANS", reversible=True) # 'jagannAtha _{Puri_}'
97
+ assert from_roman(roman, "ITRANS") == text
98
+ ```
99
+
100
+ `reversible` works with ISO 15919 and ITRANS. Hunterian merges several
101
+ letters (for example ଣ, ଞ and ନ all become `n`), so it cannot be reversed
102
+ exactly.
103
+
104
+ ### With pandas
105
+
106
+ ```python
107
+ df["name_roman"] = df["name_odia"].map(to_hunterian)
108
+ ```
109
+
110
+ ## Command line
111
+
112
+ ```bash
113
+ odiatranslit "ଓଡ଼ିଆ" # ōṛiā
114
+ odiatranslit "ନମସ୍କାର" -s Hunterian # namaskara
115
+ odiatranslit -r "namaskAra" -s ITRANS # ନମସ୍କାର
116
+ odiatranslit -i input.txt -o output.txt
117
+ echo "ଜଗନ୍ନାଥ" | odiatranslit
118
+ ```
119
+
120
+ | Option | Description |
121
+ | ----------------- | ----------------------------------------------------- |
122
+ | `text` | Text to convert (reads from `-i` or stdin if omitted) |
123
+ | `-s`, `--scheme` | `ISO15919` (default), `Hunterian` or `ITRANS` |
124
+ | `-r`, `--reverse` | Convert Roman → Odia |
125
+ | `--reversible` | Escape output so it converts back exactly |
126
+ | `-i`, `--input` | Read from a UTF-8 file |
127
+ | `-o`, `--output` | Write to a file instead of the screen |
128
+
129
+ ## Notes
130
+
131
+ - Odia digits (୦–୯) become ASCII digits in Hunterian, and in ITRANS
132
+ unless `reversible=True`. ISO 15919 keeps them as they are.
133
+ - ଡ଼ and ଢ଼ have their own spellings: `ṛ`/`ṛh` (ISO), `.D`/`.Dh` (ITRANS),
134
+ `r`/`rh` (Hunterian).
135
+ - ITRANS also accepts common alternatives such as `aa` for `A` and `ii` for `I`.
136
+ - Hunterian decoding is best-effort. Where a spelling is shared, the most
137
+ common Odia letter is chosen.
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ pip install -e ".[dev]"
143
+ pytest # unit tests + docstring examples
144
+ ruff check .
145
+ mypy
146
+ ```
147
+
148
+ ## Project layout
149
+
150
+ ```
151
+ odiatranslit/
152
+ ├── odiatranslit/
153
+ │ ├── __init__.py # public exports
154
+ │ ├── api.py # public functions
155
+ │ ├── _engine.py # internal encoder / decoder
156
+ │ ├── schemes.py # letter tables for each scheme
157
+ │ ├── cli.py # command-line tool
158
+ │ └── py.typed
159
+ ├── tests/
160
+ │ └── test_transliterate.py
161
+ ├── pyproject.toml
162
+ ├── LICENSE
163
+ └── README.md
164
+ ```
165
+
166
+ ## Acknowledgements
167
+
168
+ The letter tables and transliteration engine are adapted from
169
+ [OpenOdia](https://github.com/soumendrak/openodia) (MIT License).
170
+
171
+ ## Contributing
172
+
173
+ Bug reports and suggestions are welcome. Please
174
+ [open an issue](https://github.com/srinibashsamal/odiatranslit/issues)
175
+ with the input text, the scheme used, and the output you expected.
176
+
177
+ ## License
178
+
179
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,34 @@
1
+ """Odia <-> Roman transliteration (ISO 15919, Hunterian, ITRANS)."""
2
+
3
+ from ._engine import SCHEMES, Scheme
4
+ from .api import (
5
+ from_hunterian,
6
+ from_iso15919,
7
+ from_itrans,
8
+ from_roman,
9
+ to_hunterian,
10
+ to_iso15919,
11
+ to_itrans,
12
+ to_roman,
13
+ transliterate,
14
+ )
15
+ from .schemes import TABLES, SchemeTable
16
+
17
+ __version__ = "0.1.0"
18
+
19
+ __all__ = [
20
+ "SCHEMES",
21
+ "TABLES",
22
+ "Scheme",
23
+ "SchemeTable",
24
+ "__version__",
25
+ "from_hunterian",
26
+ "from_iso15919",
27
+ "from_itrans",
28
+ "from_roman",
29
+ "to_hunterian",
30
+ "to_iso15919",
31
+ "to_itrans",
32
+ "to_roman",
33
+ "transliterate",
34
+ ]