GithubHelp home page GithubHelp logo

ironcountyschooldistrict / powerschool-alchemy Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 42 KB

This library allows you to interact with a PowerSchool Database with SQLALchemy, a Python ORM

License: MIT License

Python 100.00%
powerschool python3 sqlalchemy

powerschool-alchemy's Introduction

powerschool_alchemy

This library allows you to interact with a PowerSchool Database with SQLALchemy, a Python ORM.

# Usage

from powerschool_alchemy.db import create_session
from powerschool_alchemy.models import Student, Section, CalendarDay, CC, CycleDay
sess = create_session()
sess.query(Student).filter(Student.last_name == 'Doe').filter(Student.first_name == 'Jane').first().guardians[0].guardian
my_section = sess.query(Section).filter(Section.id==149618).first()

section_cal_days = sess \
            .query(CalendarDay, CycleDay.letter) \
            .join(CycleDay) \
            .filter(
                CalendarDay.school_id==my_section.school_id,
                CalendarDay.date_value >= my_section.term.first_day,
                CalendarDay.date_value < my_section.term.last_day,
                CycleDay.letter.in_(
                    list(map(lambda x: x.cycle_day_letter, my_section.section_meetings)))) \
            .all()

section_cal_days = list(map(lambda x: x[0], section_cal_days))
print(type(section_cal_days))

powerschool-alchemy's People

Contributors

basiczombie avatar jonesnc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

powerschool-alchemy's Issues

README: document setup processes

  • Instantclient installation (Mac, Linux)
  • use joinedload for relationships that will be accessed after the session is closed (e.g., templates)

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.