Metadata-Version: 2.4
Name: degrees
Version: 0.2.0a0
Summary: A python lib for degree calculations and conversions
Author-email: ArcticChar <snake830@vip.163.com>
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# degrees V0.2.0a0
> _Added in version 0.2:_ Supported `pickle`.
# Contents
* Introduction
* Importing
* Class
  * Degree
* Functions
  * degree2radian
  * radian2degree
  * normalize
* Changelog
# Introduction
A python lib for degree calculations and conversions
# Importing
### Just type `import degrees`.
# Class
- ## _class_ degrees.Degree(number)<br>_class_ degrees.Degree(degree_obj)<br>_class_ degrees.Degree(degree=0, minute=0, second=0)
  - ### Creating a Degree object

```python 
import degrees

print(degrees.Degree(1))  # 1°
print(degrees.Degree(2, 3, 4))  # 2°3'4"
print(degrees.Degree(1, second=2))  # 1°0'2"
print(degrees.Degree(1, 3))  # 1°3'
print(degrees.Degree(0, -1))  # -1'
print(degrees.Degree(1.5))  # 1°30'
print(degrees.Degree(2, -4))  # ValueError: if degree is not 0, minute and second must be positive integer
```

  - ### calculating:
    | `a + b`  | `a - b`        | `a * b`         | `a / b`   | `math.trunc(a)` |
    |----------|----------------|-----------------|-----------|-----------------|
    | `abs(a)` | `math.ceil(a)` | `math.floor(a)` | `a % b`   |                 |
    | `a // b` | `+a`           | `-a`            | `hash(a)` |                 |
     > _Added in version 0.1.7:_ Implemented the `math.trunc` function on the Degree objects.

  - ### conversions:
    | `int(a)` | `float(a)` | `str(a)` | `repr(a)` | `bool(a)` | `complex(a)` |
    |----------|------------|----------|-----------|-----------|--------------|

  - ### comparisons:
    | `a >= b` | `a > b` | `a = b`  |
    |----------|---------|----------|
    | `a <= b` | `a < b` | `a != b` |

  - ### _staticmethod_ from_str(string)
     Return a degree object from a string. The **dms** characters should be **`°`, `'` and `"`**.
  - ### _staticmethod_ from_unicode(string)
     Similar to `from_str`, but the **dms** characters should be **`°`, `′` and `″`**.
     > _Added in version 0.1.9._
  - ### _staticmethod_ from_iter(iterable)
     Return a degree object from an iterable.
  - ### _property_ total_seconds
     The total seconds of a degree object.
  - ### deg
     The degree of a degree object(without sign).
  - ### min
     The minute of a degree object(without sign).
  - ### sec
     The second of a degree object(without sign).
  - ### sign
     The sign of a degree object.
  - ### _property_ dms
     A tuple of `(degree, minute, second)`.
   
   > ### Note
   > The attributes of Degree are read-only.
# Functions
## _def_ degree2radian(x: Degree, /)
   - Convert angle x from a degree object to radians.
## _def_ radian2degree(x: Union[int, float], /)
   - Convert angle x from radians to a degree object.
## _def_ normalize(x: Degree, /)
   - Be using for angle normalization.
# Version
## version_info
   - The version of this package, like
[`sys.version_info`](https://docs.python.org/3.14/library/sys.html#sys.version_info)
&larr; click for more info.
# Consts
## DEGREE<br>MINUTE<br>SECOND
   Equals to `°`, `′` and `″`.
# Changelog
   1. Supported `pickle`.
> ### Write in the end
> If you found the bug in the code, you can email me at `snake830@vip.163.com`. I am happy to receive the advice!
