hk1980


Namehk1980 JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://github.com/kavandev/hk1980
SummaryA forked project from hk80. This project also convert the coordinates between Hong Kong 1980 Grid System and World Geodetic System 1984 with pyproj, with a more update version of pyproj and providing better performance.
upload_time2025-08-31 07:06:03
maintainerNone
docs_urlNone
authorKavan Chan
requires_python<4.0,>=3.10
licenseMIT
keywords hk80 hk1980 wgs1984 wgs84 grid coordinate hk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # hk1980
A forked project from hk80. This project also convert the coordinates between Hong Kong 1980 Grid System and World Geodetic System 1984 with pyproj, with a more update version of `pyproj` and providing better performance. 
## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) or [poetry](https://python-poetry.org/) to install foobar.

```bash
pip install hk1980
```
or
```bash
poetry add hk1980
```

## Usage

```python
from hk1980 import LatLon, HK80

hku = LatLon(22.284034, 114.137814).to_hk80()
print(hku.northing, hku.easting) # 836303.204 818195.94
print(hku.x, hku.y) # 818195.94 836303.204

hku = HK80(northing=816128, easting=832243).to_wgs84()
print(hku.latitude, hku.longitude) # 22.42944514 113.98124272
print(hku.x, hku.y) # 113.98124272 22.42944514
```
## Performance

hk1980 is roughly well performant than hk80 than 238 times.

```python
#hk80
import timeit
stmt = "LatLon(22.284034, 114.137814).to_hk80()"
_time_ms = timeit.timeit(stmt=stmt, globals=globals(), number=100)*1000
print(f"time: {_time_ms} ms") # 238.1038 ms

#hk1980
import timeit
stmt = "LatLon(22.284034, 114.137814).to_hk80()"
_time_ms = timeit.timeit(stmt=stmt, globals=globals(), number=100)*1000
print(f"time: {_time_ms} ms") # 1.0652 ms
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kavandev/hk1980",
    "name": "hk1980",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "hk80, hk1980, wgs1984, wgs84, grid, coordinate, hk",
    "author": "Kavan Chan",
    "author_email": "kavandevelopment@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f4/12/3f8ea5d07e0bb131257c0b930a1fef42faa13aaf3d1bcf4f3f309a7738b9/hk1980-0.2.3.tar.gz",
    "platform": null,
    "description": "# hk1980\nA forked project from hk80. This project also convert the coordinates between Hong Kong 1980 Grid System and World Geodetic System 1984 with pyproj, with a more update version of `pyproj` and providing better performance. \n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) or [poetry](https://python-poetry.org/) to install foobar.\n\n```bash\npip install hk1980\n```\nor\n```bash\npoetry add hk1980\n```\n\n## Usage\n\n```python\nfrom hk1980 import LatLon, HK80\n\nhku = LatLon(22.284034, 114.137814).to_hk80()\nprint(hku.northing, hku.easting) # 836303.204 818195.94\nprint(hku.x, hku.y) # 818195.94 836303.204\n\nhku = HK80(northing=816128, easting=832243).to_wgs84()\nprint(hku.latitude, hku.longitude) # 22.42944514 113.98124272\nprint(hku.x, hku.y) # 113.98124272 22.42944514\n```\n## Performance\n\nhk1980 is roughly well performant than hk80 than 238 times.\n\n```python\n#hk80\nimport timeit\nstmt = \"LatLon(22.284034, 114.137814).to_hk80()\"\n_time_ms = timeit.timeit(stmt=stmt, globals=globals(), number=100)*1000\nprint(f\"time: {_time_ms} ms\") # 238.1038 ms\n\n#hk1980\nimport timeit\nstmt = \"LatLon(22.284034, 114.137814).to_hk80()\"\n_time_ms = timeit.timeit(stmt=stmt, globals=globals(), number=100)*1000\nprint(f\"time: {_time_ms} ms\") # 1.0652 ms\n```\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A forked project from hk80. This project also convert the coordinates between Hong Kong 1980 Grid System and World Geodetic System 1984 with pyproj, with a more update version of pyproj and providing better performance.",
    "version": "0.2.3",
    "project_urls": {
        "Homepage": "https://github.com/kavandev/hk1980",
        "Repository": "https://github.com/kavandev/hk1980"
    },
    "split_keywords": [
        "hk80",
        " hk1980",
        " wgs1984",
        " wgs84",
        " grid",
        " coordinate",
        " hk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b0da3c1cee3495cd3fdca5a4f20c45b7f132b02ab9e8c799896aa3bb3e518ca",
                "md5": "ef206270ab18b50d0338609508dbac71",
                "sha256": "6bb83ce0790dba289529c75793e742eeb310fa21ccdac1fc96ab2fddfcb6124f"
            },
            "downloads": -1,
            "filename": "hk1980-0.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ef206270ab18b50d0338609508dbac71",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 4400,
            "upload_time": "2025-08-31T07:06:02",
            "upload_time_iso_8601": "2025-08-31T07:06:02.013508Z",
            "url": "https://files.pythonhosted.org/packages/2b/0d/a3c1cee3495cd3fdca5a4f20c45b7f132b02ab9e8c799896aa3bb3e518ca/hk1980-0.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4123f8ea5d07e0bb131257c0b930a1fef42faa13aaf3d1bcf4f3f309a7738b9",
                "md5": "2260a4617de4338489d3c0120ef90a0c",
                "sha256": "4879e351eea430a327c89bff596c2ba4c865ba6193b06a44243aab645f8895a6"
            },
            "downloads": -1,
            "filename": "hk1980-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2260a4617de4338489d3c0120ef90a0c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3524,
            "upload_time": "2025-08-31T07:06:03",
            "upload_time_iso_8601": "2025-08-31T07:06:03.088058Z",
            "url": "https://files.pythonhosted.org/packages/f4/12/3f8ea5d07e0bb131257c0b930a1fef42faa13aaf3d1bcf4f3f309a7738b9/hk1980-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-31 07:06:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kavandev",
    "github_project": "hk1980",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hk1980"
}
        
Elapsed time: 0.95917s