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
316 stars 110 forks source link

can't decode byte 0x81 in position 1341 #38

Closed xDetroUK closed 2 years ago

xDetroUK commented 2 years ago

I'm trying to create chart SVG chart file with this code: first = KrInstance("Jack", 1990, 6, 15, 15, 15, "Roma")

name = MakeSvgInstance(second, chart_type="Natal") name.makeSVG()

and when i try to execute the code i receive this message:

Traceback (most recent call last): File "C:\Users\mario\Desktop\University\Please 4.20\RandomTests\test3.py", line 10, in name = MakeSvgInstance(second, chart_type="Natal") File "C:\Users\mario\AppData\Local\Programs\Python\Python39\lib\site-packages\kerykeion\charts\charts_svg.py", line 139, in init natal_aspects_instance = NatalAspects( File "C:\Users\mario\AppData\Local\Programs\Python\Python39\lib\site-packages\kerykeion\aspects.py", line 25, in init self._parse_json_settings() File "C:\Users\mario\AppData\Local\Programs\Python\Python39\lib\site-packages\kerykeion\aspects.py", line 42, in _parse_json_settings settings = json.load(f) File "C:\Users\mario\AppData\Local\Programs\Python\Python39\lib\json__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\mario\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1341: character maps to

any suggestions ?

g-battaglia commented 2 years ago

Hi, I think I've fixed the issue, can you upgrade to versione 3.1.1 and try again?

xDetroUK commented 2 years ago

Hi!, i updated the version and tried again but still receive the same error i tried to execute the following function aswell just as a test :

from kerykeion import CompositeAspects, KrInstance first = KrInstance("Jack", 1990, 6, 15, 15, 15, "Roma") second = KrInstance("Jane", 1991, 10, 25, 21, 00, "Roma")

name = CompositeAspects(first, second) aspect_list = name.get_relevant_aspects() print(aspect_list[0])

but received again the same error

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1341: character maps to

xDetroUK commented 2 years ago

Any updates

paladinic commented 2 years ago

I am also still getting this error. Tried both Python 3.9 and 3.10 Tred also kerykeion==3.1.6 and 3.1.1


  File "<stdin>", line 1, in <module>
  File "C:\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kerykeion\charts\charts_svg.py", line 139, in __init__
    natal_aspects_instance = NatalAspects(
  File "C:\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kerykeion\aspects.py", line 25, in __init__
    self._parse_json_settings()
  File "C:\X\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\kerykeion\aspects.py", line 42, in _parse_json_settings
    settings = json.load(f)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1341: character maps to <undefined>
paladinic commented 2 years ago

fixed in fork: https://github.com/paladinic/kerykeion

g-battaglia commented 2 years ago

Hi, thank you for your contribution, I made a small change to your fix, can you check if still works pleas?

paladinic commented 2 years ago

grazie a te! And I confirm it works for me 👍

xDetroUK commented 2 years ago

All works good now, thanks!

xDetroUK commented 2 years ago

Is it possible to save the chart image only without the information on the side

g-battaglia commented 2 years ago

Yes, you should set the template_type to basic, eg:

MakeSvgInstance(first, chart_type="Composite",
                           second_obj=second, lang="IT", template_type="basic")