Skip to content

Commit 9c38d07

Browse files
committed
add numt - numerals, si modules
0 parents  commit 9c38d07

19 files changed

+310
-0
lines changed

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.x'
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build twine wheel setuptools
23+
24+
- name: Build package
25+
run: |
26+
python -m pip install -e .
27+
python setup.py sdist bdist_wheel
28+
29+
- name: Publish to PyPI
30+
env:
31+
TWINE_USERNAME: __token__
32+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
33+
run: |
34+
python -m twine upload dist/*

.gitignore

Whitespace-only changes.

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ajithvcoder
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### NumT
2+
3+
NumT is a utility library for formatting numbers, currencies, dates, units, and more.
4+

numt/__init__.py

Whitespace-only changes.

numt/currency.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
def format_currency(amount, currency='USD', precision=2):
2+
"""
3+
Format number as currency.
4+
5+
Args:
6+
amount (float): Amount to format
7+
currency (str): Currency code (USD, EUR, etc.)
8+
precision (int): Number of decimal places
9+
10+
Returns:
11+
str: Formatted currency
12+
"""
13+
currency_symbols = {
14+
'USD': '$',
15+
'EUR': '€',
16+
'GBP': '£',
17+
'JPY': '¥',
18+
'INR': '₹'
19+
}
20+
symbol = currency_symbols.get(currency, currency)
21+
return f"{symbol}{amount:,.{precision}f}"

numt/date_format.py

Whitespace-only changes.

numt/digital.py

Whitespace-only changes.

numt/education.py

Whitespace-only changes.

numt/measurement_imperial.py

Whitespace-only changes.

0 commit comments

Comments
 (0)