-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from dnorhoj/rewrite
Version 0.2.0
- Loading branch information
Showing
18 changed files
with
1,002 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Build and deploy to PyPi | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"python.pythonPath": "C:\\Users\\dnorh\\AppData\\Local\\Programs\\Python\\Python39\\python.exe", | ||
"restructuredtext.confPath": "${workspaceFolder}\\docs", | ||
"python.linting.enabled": true, | ||
"python.linting.flake8Enabled": true, | ||
"python.linting.flake8Args": [ | ||
"--ignore=E501" | ||
] | ||
], | ||
"esbonio.sphinx.confDir": "${workspaceFolder}/docs" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
Installation | ||
============ | ||
|
||
TODO | ||
To install lectio.py and its dependencies, you can simply install it from PyPi:: | ||
|
||
pip install lectio.py | ||
|
||
or clone the repository and install it manually:: | ||
|
||
git clone https://github.com/dnorhoj/Lectio.py.git | ||
cd lectio.py | ||
python setup.py install | ||
|
||
You can check if the installation was successful by running:: | ||
|
||
python | ||
|
||
>>> import lectio | ||
>>> lectio.__version__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
Quickstart | ||
========== | ||
|
||
TODO | ||
Let's start with a simple example, where we will get your schedule for today. | ||
|
||
Schedule | ||
-------- | ||
|
||
Create a new file, and add the following code: | ||
|
||
.. code-block:: python | ||
from lectio import Lectio | ||
from datetime import datetime, timedelta | ||
lec = Lectio('<username>', '<password>') | ||
# Get my user object | ||
me = lec.me() | ||
# Get the schedule for today | ||
schedule = me.get_schedule(datetime.now(), datetime.now() + timedelta(days=1)) | ||
We now have a list of all :class:`lectio.helpers.Module` in the ``schedule`` variable. Let's print it: | ||
|
||
.. code-block:: python | ||
for module in schedule: | ||
print(module.title, module.teacher, module.room) | ||
**More to come...!** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
.. currentmodule:: lectio | ||
|
||
API Reference | ||
============= | ||
|
||
.. automodule:: lectio.lectio | ||
Lectio | ||
------ | ||
|
||
.. autoclass:: Lectio | ||
:members: | ||
:undoc-members: | ||
|
||
|
||
School | ||
------ | ||
|
||
.. autoclass:: lectio.models.school.School | ||
:members: | ||
:undoc-members: | ||
|
||
User | ||
---- | ||
|
||
User | ||
^^^^ | ||
|
||
.. autoclass:: lectio.models.user.User | ||
:members: | ||
:undoc-members: | ||
|
||
Me | ||
^^^ | ||
|
||
.. autoclass:: lectio.models.user.Me | ||
:members: | ||
:undoc-members: | ||
|
||
User types | ||
^^^^^^^^^^ | ||
|
||
.. autoclass:: lectio.models.user.UserType | ||
:members: | ||
:undoc-members: | ||
|
||
Misc | ||
---- | ||
|
||
Module | ||
^^^^^^ | ||
|
||
.. autoclass:: lectio.helpers.schedule.Module | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
# flake8: noqa | ||
from .lectio import Lectio, Module | ||
from . import lectio | ||
from . import exceptions | ||
from .lectio import Lectio | ||
from .helpers.schedule import Module | ||
from .exceptions import * | ||
from .models.user import User, UserType | ||
from .models.school import School | ||
from .models import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# flake8: noqa | ||
from .schedule import * |
Oops, something went wrong.