sparq Client
Python client library for the sparq API - automated degree planning for SJSU students.
Installation
pip install sparq
Quick Start
1. Get Your API Key
First, register and get your API key:
sparq auth
This will:
- Send a verification code to your email
- Generate your API key after verification
- Save it to
~/.sparq/config.txt
2. Generate a Degree Plan
Use the example script to test the API:
python sparq.py
Or use it in your own code:
from sparq import Sparq
# Initialize with your API key (automatically loaded from config)
client = Sparq()
# Generate a degree plan
plan = client.plan(
major="Computer Science",
cc_courses=[{"code": "COMSC 075", "title": "Computer Science I", "grade": "A", "institution": "Evergreen Valley College"}],
units_per_semester=15,
schedule_preferences={"avoid_hours": ["8:00 AM", "8:00 PM"]}
)
print(plan)
# Get available class sections (no API key required)
sections = client.classes("CS 49J")
print(f"Found {len(sections['CS 49J'])} sections for CS 49J")
# Get sections for multiple courses
sections = client.classes(["CS 49J", "MATH 42", "CS 146"])
for course_id, course_sections in sections.items():
print(f"{course_id}: {len(course_sections)} sections")
for section in course_sections:
print(f" - {section['Section']}: {section['Instructor']}, {section['Days']} {section['Times']}")
3. Check Your API Usage
View your API usage statistics:
sparq usage
4. Recover Lost API Key
If you lose your API key:
sparq recover
5. Get Class Sections
Search for available class sections for any SJSU course (no API key required):
sparq classes
This will prompt you to enter course ID(s) and display all available sections with details like:
- Instructor
- Days and times
- Location
- Open seats
- And more
CLI Commands
sparq auth- Register and get your API keysparq usage- View API usage statisticssparq recover- Recover your API key via emailsparq classes- Get available class sections for courses (no API key required)
Features
- Degree Planning: Generate semester-by-semester plans for SJSU majors
- Transfer Credit: Support for community college and AP credits
- Usage Tracking: Monitor your API calls and history
- API Key Recovery: Recover lost API keys via email verification
Updates
For updates please visit: https://github.com/shiventi/sparq/blob/main/docs/documentation.md
Support
For issues or questions, visit: https://github.com/shiventi/sparq
Metadata
Release files for sparq 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sparq-0.2.6.tar.gz | 8.5 kB | Without provenance | Details for sparq-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sparq-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for sparq-0.2.6-py3-none-any.whl |
Total release size: 18.7 kB
Release files / sparq-0.2.6.tar.gz
| Download URL | sparq-0.2.6.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b5764f882f7f521cfbf7e5723e5068aa9374ef4a0fe5bbe09715921bbae902a
|
|
BLAKE2b-256 checksum How to use checksums |
80ddec509ec9e1f672f49106a411a0e9e55b611f157176aad867a4a5cb0b0022
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / sparq-0.2.6-py3-none-any.whl
| Download URL | sparq-0.2.6-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad6e09b6836dd20ada2d31947f10384ab2e754800ab87bd8e3013857449e7c85
|
|
BLAKE2b-256 checksum How to use checksums |
dc98dc1b58c170b2cad3a1d646ed1d0e195520b7c840fb414c4e99cd4559f50e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for sparq 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.