g-battaglia / kerykeion

Data driven Astrology 💫
Kerykeion is a python library for astrology. It can generate SVG charts and extract all data about a birthchart, a synastry chart and a transit chart.
https://kerykeion.net
GNU Affero General Public License v3.0
297 stars 103 forks source link

Update documentation to claim Python 3.10 as minimum version #114

Closed josephmartin09 closed 4 months ago

josephmartin09 commented 4 months ago

Hello, when running the README example on 3.9.6, I receive the following message

# Import the main class for creating a kerykeion instance:
from kerykeion import AstrologicalSubject

# Create a kerykeion instance:
# Args: Name, year, month, day, hour, minuts, city, nation(optional)
kanye = AstrologicalSubject("Kanye", 1977, 6, 8, 8, 45, "Atlanta")

# Get the information about the sun in the chart:
# (The position of the planets always starts at 0)
kanye.sun

#> {'name': 'Sun', 'quality': 'Mutable', 'element': 'Air', 'sign': 'Gem', 'sign_num': 2, 'pos': 17.598992059774275, 'abs_pos': 77.59899205977428, 'emoji': '♊️', 'house': '12th House', 'retrograde': False}

# Get information about the first house:
kanye.first_house

#> {'name': 'First_House', 'quality': 'Cardinal', 'element': 'Water', 'sign': 'Can', 'sign_num': 3, 'pos': 17.995779673209114, 'abs_pos': 107.99577967320911, 'emoji': '♋️'}

# Get element of the moon sign:
kanye.moon.element

#> 'Water'
(astrology) joe@Joes-MBP astrology % python app.py
/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
Traceback (most recent call last):
  File "/Users/joe/development/astrology/app.py", line 2, in <module>
    from kerykeion import AstrologicalSubject
  File "/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/kerykeion/__init__.py", line 102, in <module>
    from .astrological_subject import AstrologicalSubject
  File "/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/kerykeion/astrological_subject.py", line 13, in <module>
    from kerykeion.kr_types import (
  File "/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/kerykeion/kr_types/__init__.py", line 3, in <module>
    from .kr_models import *
  File "/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/kerykeion/kr_types/kr_models.py", line 110, in <module>
    class AstrologicalSubjectModel(BaseModel):
  File "/Users/joe/.local/share/virtualenvs/astrology-kAYt5ESC/lib/python3.9/site-packages/kerykeion/kr_types/kr_models.py", line 139, in AstrologicalSubjectModel
    chiron: KerykeionPointModel | None
TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'NoneType'
(astrology) joe@Joes-MBP astrology %

When running on 3.10 +, the example works as it should. It could be you are using 3.10+ features somewhere.

g-battaglia commented 4 months ago

Hi, fixed in version 4.5.1, let me know if it's all ok now!