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

Module incompatible with serverless environments due to SQLite caching #129

Closed ShadowDawg closed 3 weeks ago

ShadowDawg commented 4 weeks ago

Descripition

The module creates a SQLite cache file (kerykeion_geonames_cache.sqlite) in a cachefolder, which makes it unusable in serverless environments with read-only filesystems, such as Vercel.

Problem

When deployed to a serverless environment, the module attempts to write to the filesystem, resulting in a permission error: Copy[Errno 30] Read-only file system: '/var/task/cache'

Steps to Reproduce

Use the module in a serverless function (e.g., AWS Lambda, Vercel, etc.) Attempt to create an AstrologicalSubject Encounter a read-only filesystem error

Is there anything that could be done on my side to fix/bypass this issue? Or is it something to do with the module itself?

g-battaglia commented 4 weeks ago

HI @ShadowDawg, have you tried using the offline mode? Like this:

johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", online=False, tz_str="America/New_York", lng=-87.1111, lat=37.7711)
ShadowDawg commented 3 weeks ago

Hi! Yes, this fixes the issue. Thanks for the quick response.