[![Build Status](https://github.com/sapphimars/physkit/actions/workflows/test.yml/badge.svg)](https://github.com/sapphimars/physkit/actions/workflows/test.yml)
[![PyPI Version](https://img.shields.io/pypi/v/physkit)](https://pypi.org/project/physkit/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
<div align="center">
<figure>
<img src="https://github.com/sapphimars/physkit/blob/main/assets/physkit-logo-light.png?raw=true" alt="Light mode logo" width=240 />
</figure>
</div>
###### Icon created by [astroastra](https://github.com/astroastrastudio)
# Physkit - A Python toolkit for constants, unit conversions, and equations
**Physkit** is a Python library for performing scientific computations, unit conversions, and working with physical constants and equations.
It provides tools for astrophysical and physical calculations, supporting multiple unit systems and CLI functionalities.
---
## **License**
This project is licensed under the terms of the **GNU General Public License v3.0**.
See the [LICENSE](https://github.com/sapphimars/physkit/blob/main/LICENSE) file for details.
Copyright (C) 2024 [sapphimars](https://github.com/sapphimars)
---
### **Third-Party Licenses**
This project makes use of the following third-party libraries:
- **[Matplotlib](https://matplotlib.org/)** - Licensed under the Matplotlib License Agreement. See [licenses/LICENSE-MATPLOTLIB.txt](https://github.com/sapphimars/physkit/blob/main/licenses/LICENSE-MATPLOTLIB.txt) or [directly on their repository](https://github.com/matplotlib/matplotlib/tree/main/LICENSE).
- **[Pint](https://github.com/hgrecco/pint)** - Licensed under the BSD 3-Clause License. See [licenses/LICENSE-PINT.txt](https://github.com/sapphimars/physkit/blob/main/licenses/LICENSE-PINT.txt) or [directly on their repository](https://github.com/hgrecco/pint/blob/master/LICENSE).
Note: Third-party libraries included in this project are licensed under their respective terms. See the `licenses/` directory for full details.
---
## **Installation**
### **Requirements**
- Python **3.12** or higher
- Dependencies:
- **Matplotlib** >= 3.5
- **Pint** >= 0.20
---
### **Install via pip**
```bash
pip install physkit
```
---
### **For Development**
```bash
pdm install
```
To install test dependencies:
```bash
pdm install -G test
```
---
## **Usage Examples**
### **Access Constants**
```python
import physkit as pk
from physkit.constants import constants as csts
print(csts.G) # Gravitational constant in SI
pk.set_default("cgs")
print(csts.G) # Gravitational constant in CGS
```
---
### **Unit Conversion**
```python
from physkit.conversions import convert_unit
result = convert_unit(1, 'm', 'cm')
print(result) # Outputs: 100.0
```
---
### **Equations**
```python
from physkit.equations import equations
# Default units are SI. Specify other units explicitly, like so:
mass = 1.0 # Solar mass
radius = equations.gravitational_radius(mass, 'M_sun', 'km') # input mass in solar masses
print(radius) # Gravitational radius in km
```
---
### **Plot Styling**
This is just a quick way to make good looking plots simply.
```python
import physkit as pk
import matplotlib.pyplot as plt
x_data = [...] # Example data for x and y
y_data = [...]
fig, ax = plt.subplots()
pk.plot_styler(x_data, y_data, ax=ax, title="test",
ylabel="y label", xlabel="x label", loglog=True)
plt.show()
```
---
### **Command Line Interface (CLI)**
```bash
physkit constant G --system cgs
```
```bash
physkit convert 1 m cm
```
---
## **Contributing**
Contributions are welcome!
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Commit changes (`git commit -m "Add new feature"`).
4. Push to your branch (`git push origin feature-name`).
5. Open a Pull Request.
---
## **Issues**
If you encounter any issues or have suggestions, feel free to open an issue on [GitHub](https://github.com/sapphimars/physkit/issues).
---
## **Contact**
For inquiries, contact me via GitHub: [sapphimars](https://github.com/sapphimars)
Raw data
{
"_id": null,
"home_page": null,
"name": "physkit",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "physics, units, pint, plotting",
"author": "sapphimars",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7a/3f/bc4cdd31c7e58cc3e5b2e2ead015d5805c59d038180d12ccce2580a3fd56/physkit-0.1.21.tar.gz",
"platform": null,
"description": "[![Build Status](https://github.com/sapphimars/physkit/actions/workflows/test.yml/badge.svg)](https://github.com/sapphimars/physkit/actions/workflows/test.yml)\n[![PyPI Version](https://img.shields.io/pypi/v/physkit)](https://pypi.org/project/physkit/)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n<div align=\"center\">\n <figure>\n <img src=\"https://github.com/sapphimars/physkit/blob/main/assets/physkit-logo-light.png?raw=true\" alt=\"Light mode logo\" width=240 />\n </figure>\n</div>\n\n###### Icon created by [astroastra](https://github.com/astroastrastudio)\n\n# Physkit - A Python toolkit for constants, unit conversions, and equations\n\n**Physkit** is a Python library for performing scientific computations, unit conversions, and working with physical constants and equations. \nIt provides tools for astrophysical and physical calculations, supporting multiple unit systems and CLI functionalities.\n\n---\n\n## **License**\n\nThis project is licensed under the terms of the **GNU General Public License v3.0**. \nSee the [LICENSE](https://github.com/sapphimars/physkit/blob/main/LICENSE) file for details. \n\nCopyright (C) 2024 [sapphimars](https://github.com/sapphimars) \n\n---\n\n### **Third-Party Licenses**\n\nThis project makes use of the following third-party libraries:\n\n- **[Matplotlib](https://matplotlib.org/)** - Licensed under the Matplotlib License Agreement. See [licenses/LICENSE-MATPLOTLIB.txt](https://github.com/sapphimars/physkit/blob/main/licenses/LICENSE-MATPLOTLIB.txt) or [directly on their repository](https://github.com/matplotlib/matplotlib/tree/main/LICENSE).\n- **[Pint](https://github.com/hgrecco/pint)** - Licensed under the BSD 3-Clause License. See [licenses/LICENSE-PINT.txt](https://github.com/sapphimars/physkit/blob/main/licenses/LICENSE-PINT.txt) or [directly on their repository](https://github.com/hgrecco/pint/blob/master/LICENSE).\n\nNote: Third-party libraries included in this project are licensed under their respective terms. See the `licenses/` directory for full details.\n\n---\n\n## **Installation**\n\n### **Requirements**\n\n- Python **3.12** or higher \n- Dependencies:\n - **Matplotlib** >= 3.5 \n - **Pint** >= 0.20 \n\n---\n\n### **Install via pip**\n```bash\npip install physkit\n```\n\n---\n\n### **For Development**\n```bash\npdm install\n```\n\nTo install test dependencies:\n```bash\npdm install -G test\n```\n\n---\n\n## **Usage Examples**\n\n### **Access Constants**\n```python\nimport physkit as pk\nfrom physkit.constants import constants as csts\n\nprint(csts.G) # Gravitational constant in SI\npk.set_default(\"cgs\")\nprint(csts.G) # Gravitational constant in CGS\n```\n\n---\n\n### **Unit Conversion**\n```python\nfrom physkit.conversions import convert_unit\n\nresult = convert_unit(1, 'm', 'cm')\nprint(result) # Outputs: 100.0\n```\n\n---\n\n### **Equations**\n```python\nfrom physkit.equations import equations\n\n# Default units are SI. Specify other units explicitly, like so:\nmass = 1.0 # Solar mass\nradius = equations.gravitational_radius(mass, 'M_sun', 'km') # input mass in solar masses\nprint(radius) # Gravitational radius in km\n```\n\n---\n### **Plot Styling**\nThis is just a quick way to make good looking plots simply.\n```python\nimport physkit as pk\nimport matplotlib.pyplot as plt\n\nx_data = [...] # Example data for x and y\ny_data = [...]\n\nfig, ax = plt.subplots()\npk.plot_styler(x_data, y_data, ax=ax, title=\"test\", \n ylabel=\"y label\", xlabel=\"x label\", loglog=True)\nplt.show()\n\n```\n---\n### **Command Line Interface (CLI)**\n```bash\nphyskit constant G --system cgs\n```\n```bash\nphyskit convert 1 m cm\n```\n\n---\n\n## **Contributing**\n\nContributions are welcome! \n\n1. Fork the repository. \n2. Create a new branch (`git checkout -b feature-name`). \n3. Commit changes (`git commit -m \"Add new feature\"`). \n4. Push to your branch (`git push origin feature-name`). \n5. Open a Pull Request.\n\n---\n\n## **Issues**\n\nIf you encounter any issues or have suggestions, feel free to open an issue on [GitHub](https://github.com/sapphimars/physkit/issues).\n\n---\n\n## **Contact**\n\nFor inquiries, contact me via GitHub: [sapphimars](https://github.com/sapphimars)\n\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "A Python toolkit providing physical constants, unit conversions, and plotting styles",
"version": "0.1.21",
"project_urls": {
"Bug Tracker": "https://github.com/sapphimars/physkit/issues",
"Homepage": "https://github.com/sapphimars/physkit",
"Repository": "https://github.com/sapphimars/physkit"
},
"split_keywords": [
"physics",
" units",
" pint",
" plotting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31302d66380ef7cdacfb4a1906fa6f8d583d514a1cb1c267b170c8dcbea581cc",
"md5": "3cbf35fc981994c1a1e6b3c97bc3ec8c",
"sha256": "77d04927827c59559c3dff1de58f4987a53d3a546d4b7fcbec7a0b35bc001994"
},
"downloads": -1,
"filename": "physkit-0.1.21-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3cbf35fc981994c1a1e6b3c97bc3ec8c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 26519,
"upload_time": "2025-01-03T12:50:41",
"upload_time_iso_8601": "2025-01-03T12:50:41.123996Z",
"url": "https://files.pythonhosted.org/packages/31/30/2d66380ef7cdacfb4a1906fa6f8d583d514a1cb1c267b170c8dcbea581cc/physkit-0.1.21-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7a3fbc4cdd31c7e58cc3e5b2e2ead015d5805c59d038180d12ccce2580a3fd56",
"md5": "452e4f32f48ba2edc9a6cfb28ec6d2a7",
"sha256": "3f2d028eaa4da5f25b29c3443aca0d04846a7e49e63f4532c12ea1c7f8b53b43"
},
"downloads": -1,
"filename": "physkit-0.1.21.tar.gz",
"has_sig": false,
"md5_digest": "452e4f32f48ba2edc9a6cfb28ec6d2a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 23863,
"upload_time": "2025-01-03T12:50:42",
"upload_time_iso_8601": "2025-01-03T12:50:42.710500Z",
"url": "https://files.pythonhosted.org/packages/7a/3f/bc4cdd31c7e58cc3e5b2e2ead015d5805c59d038180d12ccce2580a3fd56/physkit-0.1.21.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-03 12:50:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sapphimars",
"github_project": "physkit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "matplotlib",
"specs": [
[
"==",
"3.10.0"
]
]
},
{
"name": "Pint",
"specs": [
[
"==",
"0.24.4"
]
]
}
],
"lcname": "physkit"
}