Skip to content

Commit

Permalink
large
Browse files Browse the repository at this point in the history
  • Loading branch information
majiidd committed Mar 24, 2024
1 parent 7606d85 commit a56d3b0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 25 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -41,11 +41,6 @@ jobs:
run: |
pipenv install --dev --python=${{ env.P_PATH }}
- name: Install extra dependency (pytest on windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pipenv install --dev atomicwrites
- name: Run tests
env:
PIPENV_DEFAULT_PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -67,7 +62,7 @@ jobs:
if: github.repository == 'majiidd/persiantools' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -83,15 +78,15 @@ jobs:
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2016-2022 Majid Hajiloo
Copyright (c) 2016-2024 Majid Hajiloo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pytest-cov = "==4.1.0"
pre-commit = "==3.5.0"
tomli = "==2.0.1"
exceptiongroup = {version = "1.2.0", python_versions = "<3.11"}
atomicwrites = {version = "1.4.1", sys_platform = "== 'win32'"}

[requires]
python_version = "3"
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/persiantools.svg)](https://pypi.org/project/persiantools/)
[![PyPI - License](https://img.shields.io/pypi/l/persiantools.svg)](https://pypi.org/project/persiantools/)

- Jalali (Shamsi) date and datetime (based on python datetime's module)

- Convert Jalali to Gregorian date/datetime and vice versa
- Support comparison and arithmetic operators such as `+`, `-`, `==`, `>=`
- Support timezone

- Convert Arabic and Persian characters/digits to each other
- Convert numbers to words
Provides Jalali (also known as Shamsi or Persian) dates and datetimes functionalities, among other tools.
- It converts between Jalali and Gregorian dates and datetimes (based on python datetime's module).
- It supports operators like +, -, ==, and >=.
- It includes timezone support.
- It converts between Arabic and Persian characters/digits.
- It turns numbers into Persian words.

## Install Package

You can install the package using pip with the following command:
```bash
python -m pip install persiantools
```
Persiantools supports Python 3.6+. (_for python 2.7 and 3.5 use [1.5.x](https://github.com/majiidd/persiantools/tree/1.5.x) version_)
Persiantools supports Python 3.8+. (_for python 2.7 and 3.5 use [1.5.x](https://github.com/majiidd/persiantools/tree/1.5.x) version_)

## How to use

Expand Down Expand Up @@ -118,7 +116,7 @@ Based on python `strftime()` behavior
```

### Operators

The package supports various operators for date and time manipulations. Here are some examples:
```python
>>> from persiantools.jdatetime import JalaliDate, JalaliDateTime
>>> import datetime
Expand Down
4 changes: 2 additions & 2 deletions persiantools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

__title__ = "persiantools"
__url__ = "https://github.com/majiidd/persiantools"
__version__ = "3.0.1"
__version__ = "4.0.0"
__build__ = __version__
__author__ = "Majid Hajiloo"
__author_email__ = "majid.hajiloo@gmail.com"
__license__ = "MIT"
__copyright__ = "Copyright (c) 2016-2022 Majid Hajiloo"
__copyright__ = "Copyright (c) 2016-2024 Majid Hajiloo"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ def readme():
author="Majid Hajiloo",
author_email="majid.hajiloo@gmail.com",
license="MIT",
license_files = ("LICENSE",),
packages=["persiantools"],
python_requires=">=3.8",
tests_require=["pytest", "pytest-cov"],
install_requires=[],
install_requires=["pytz"],
include_package_data=True,
zip_safe=False,
)

0 comments on commit a56d3b0

Please sign in to comment.