Giter Club home page Giter Club logo

ftadvisory / open-astro-org-web-service Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 4.0 10.93 MB

Webservice to generate Astrological charts using a trimmed down version of OpenAstro.org (https://github.com/pascallemazurier/openastro-dev) and the full version of Pyswisseph which is a python implementation of swiss ephemeris (https://github.com/astrorigin/pyswisseph)

License: GNU General Public License v3.0

Dockerfile 1.13% Shell 2.08% Python 96.80%
astrological astrology astrology-api python swiss-ephemeris web-service

open-astro-org-web-service's Introduction

OpenAstroWebService

Webservice to generate Astrological charts using a trimmed down version of OpenAstro.org (https://github.com/pascallemazurier/openastro-dev) and the full version of Pyswisseph which is a python implementation of swiss ephemeris (https://github.com/astrorigin/pyswisseph).

The source applications were re-engineered to be deployed as a web service with Docker deployment. All source and configurations for the deployment are included in this repository.

Consistent with the OpenAstro and Pysswisseph projects, this is published under the GNU Affero General Public License version 3. See the LICENSE.txt file.

Note that the original swisseph library is distributed under a dual licensing system: GNU Affero General Public License, or Swiss Ephemeris Professional License. For more information, see file libswe/LICENSE (https://github.com/astrorigin/swisseph/blob/696bda432298d482d27e67a0cf1238920301a7dd/LICENSE).

Instructions to setup (assuming use of VS Code)

  • uses ZSH scripts to build (will require changing the permission of these scripts to enable execution)

  • Requires Python 3.9 or higher and a docker environment

  • A valid project is required to run on gcp

  • Setup a virtual Python environment (https://code.visualstudio.com/docs/python/environments) in the project's root directory

    • python3 -m venv .venv
    • source ./.venv/bin/activate
  • Confirm that Python is installed

    • which python (should point to the virtual environment setup above)
    • python --version (should be Python 3.9+)
  • Change the permissions for the shell scripts

    • chmod 744 *.zsh
  • Setup the development environment (loads required packages)

    • ./setDevEnv.zsh
  • To build the python packages run:

    • ./package-build.zsh
  • To deploy to docker and run (on port 5050)

    • ./docker-build.zsh
  • To test the docker deployment

    • http://localhost:5050

    • will return: "Web Service for OpenAstro v1.1.57"

    • python ./invokeService.py

    • will return the chart for Joanne Woodward

    • ./test-webservice-and-cleanup.zsh

    • will install needed packages, test the docker deployment and remove the packages. Note that this completely removes the relevant packages. To reinstall them use "setDevEnv.zsh"

  • To deploy to GCP - after editing gcloud-build.zsh to point to the GCP project

    • ./gloud-build.zsh
  • To test the GCP installation

    • http://your-gcp-url

    • will return: "Web Service for OpenAstro v1.1.57"

    • And after editing invokeService.py to point to the GCP deployment

    • ./test/invokeService.py

    • will return the chart for Joanne Woodward

open-astro-org-web-service's People

Contributors

dschwartznyc avatar ftadvisory avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

open-astro-org-web-service's Issues

Issues with `werkzeug` and running without Docker?

I followed the instructions to create the .venv in the project directory. Getting the following error in the docker container:

2024-01-25 11:23:09 Traceback (most recent call last):
2024-01-25 11:23:09   File "/open-astro-web-service/app/app.py", line 1, in <module>
2024-01-25 11:23:09     from flask import Flask, request, jsonify
2024-01-25 11:23:09   File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
2024-01-25 11:23:09     from .app import Flask as Flask
2024-01-25 11:23:09   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
2024-01-25 11:23:09     from . import cli
2024-01-25 11:23:09   File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
2024-01-25 11:23:09     from .helpers import get_debug_flag
2024-01-25 11:23:09   File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
2024-01-25 11:23:09     from werkzeug.urls import url_quote
2024-01-25 11:23:09 ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
2024-01-25 11:23:22 Traceback (most recent call last):
2024-01-25 11:23:22   File "/open-astro-web-service/app/app.py", line 1, in <module>
2024-01-25 11:23:22     from flask import Flask, request, jsonify
2024-01-25 11:23:22   File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
2024-01-25 11:23:22     from .app import Flask as Flask
2024-01-25 11:23:22   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
2024-01-25 11:23:22     from . import cli
2024-01-25 11:23:22   File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
2024-01-25 11:23:22     from .helpers import get_debug_flag
2024-01-25 11:23:22   File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
2024-01-25 11:23:22     from werkzeug.urls import url_quote
2024-01-25 11:23:22 ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
2024-01-25 11:24:25 Traceback (most recent call last):
2024-01-25 11:24:25   File "/open-astro-web-service/app/app.py", line 1, in <module>
2024-01-25 11:24:25     from flask import Flask, request, jsonify
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
2024-01-25 11:24:25     from .app import Flask as Flask
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
2024-01-25 11:24:25     from . import cli
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
2024-01-25 11:24:25     from .helpers import get_debug_flag
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
2024-01-25 11:24:25     from werkzeug.urls import url_quote
2024-01-25 11:24:25 ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)
2024-01-25 11:24:25 Traceback (most recent call last):
2024-01-25 11:24:25   File "/open-astro-web-service/app/app.py", line 1, in <module>
2024-01-25 11:24:25     from flask import Flask, request, jsonify
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
2024-01-25 11:24:25     from .app import Flask as Flask
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
2024-01-25 11:24:25     from . import cli
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
2024-01-25 11:24:25     from .helpers import get_debug_flag
2024-01-25 11:24:25   File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
2024-01-25 11:24:25     from werkzeug.urls import url_quote
2024-01-25 11:24:25 ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.10/site-packages/werkzeug/urls.py)

I am using python 3.11 to create the .venv ?
Any ideas on how to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.