https://github.com/briefmnews/django-pronote
Handle CAS login for Pronote (index éducation)
https://github.com/briefmnews/django-pronote
Last synced: 3 months ago
JSON representation
Handle CAS login for Pronote (index éducation)
- Host: GitHub
- URL: https://github.com/briefmnews/django-pronote
- Owner: briefmnews
- License: gpl-3.0
- Created: 2023-02-20T09:51:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-21T11:44:56.000Z (over 2 years ago)
- Last Synced: 2024-04-24T22:01:42.439Z (about 1 year ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# django-pronote
[](https://www.python.org/downloads/release/python-390/)
[](https://docs.djangoproject.com/en/3.2/)
[](https://github.com/briefmnews/django-pronote/actions/workflows/tests.yaml)
[](https://codecov.io/gh/briefmnews/django-pronote)
[](https://github.com/python/black)Handle CAS login for Pronote (index éducation)
## Installation
Install from [PyPI](https://pypi.org/):
```
pip install django-pronote
```Or, install with [pip](https://pypi.org/project/pip/):
```
pip install -e git://github.com/briefmnews/django-pronote.git@main#egg=pronote
```## Setup
In order to make `django-pronote` works, you'll need to follow the steps below.## Settings
First you need to add the following configuration to your settings:```python
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages','pronote',
...
)
```### Mandatory settings
Here is the list of all the mandatory settings:
```python
PRONOTE_API_KEY
PRONOTE_RESSOURCE_ID
PRONOTE_TERMS_AND_CONDITIONS_URL
PRONOTE_RESSOURCE_TITLE
PRONOTE_URL
```### Optional settings
The optional settings with their default values:
```python
PRONOTE_RESSOURCE_OLD_ID (default: None)
PRONOTE_PUBLISHER (default: None)
PRONOTE_RESSOURCE_TYPE (default: None)
PRONOTE_FAMILY_ID = (default: None)
PRONOTE_FAMILY_LABEL = (default: None)
PRONOTE_FAMILY_JUSTIFICATION = (default: None)
PRONOTE_PERSONAL_INFORMATION_DEFINITION_DATA = (default: ())
PRONOTE_PERSONAL_INFORMATION_DEFINITION_JUSTIFICATION = (default: [])
PRONOTE_PUBLIC = (default: ())
PRONOTE_PUBLIC_QUOTAS = (default: [])
PRONOTE_DISCIPLINES = (default: ())
PRONOTE_MEFSTAT11 = (default: ())
PRONOTE_URL_MOBILE_APP = (default: None)
PRONOTE_API_SUPPORT = (default: ())
PRONOTE_DESCRIPTION = (default: None)
PRONOTE_KEYWORDS = (default: ())
```## Usage
Here is an example of output when running a GET method on `/catalogue/1234?apiKey=test` with the following settings:
```python
PRONOTE_API_KEY = "test"
PRONOTE_RESSOURCE_ID = "briefme"
PRONOTE_TERMS_AND_CONDITIONS_URL = "https://www.brief.me/gar/cgu/"
PRONOTE_RESSOURCE_TITLE = "Brief.me"
PRONOTE_URL = "https://www.brief.me"
PRONOTE_PUBLISHER = "Brief.me"
PRONOTE_RESSOURCE_TYPE = "Manuel"
PRONOTE_FAMILY_ID = "1234"
PRONOTE_FAMILY_LABEL = "test label"
PRONOTE_FAMILY_JUSTIFICATION = "hello"
PRONOTE_PERSONAL_INFORMATION_DEFINITION_DATA = (["Nom", "Prenom"], ["Prenom"])
PRONOTE_PERSONAL_INFORMATION_DEFINITION_JUSTIFICATION = ["test 0", "test 1"]
PRONOTE_PUBLIC = ("Professeur", "Elèves")
PRONOTE_PUBLIC_QUOTAS = ["2", "3"]
PRONOTE_DISCIPLINES = ("041400", "040600")
PRONOTE_MEFSTAT11 = ("10010012110", "21110010012")
PRONOTE_URL_MOBILE_APP = "http://hello.com"
PRONOTE_API_SUPPORT = ("ajoutPanier", "renduPJTAF")
PRONOTE_DESCRIPTION = "Un test de description"
PRONOTE_KEYWORDS = ("key 1",)
```### Output
```xml1.0
0133478Z
9782701181431
15264836
18ZE
EDITEUR
http://urlcgu
Histoire
Manuel
Nom
Prenom
Nom
Prenom
Classes
Professeur
Eleve
041400
040600
10010012110
21110010012
http://monurlderessource.php?idRessource=9782701181431
http://monurlderessourceAppliMobile.php?idRessource=9782701181431
ajoutPanier
renduPJTAF
description de la ressource
keyword1
keyword2
```
## Tests
Testing is managed by `pytest`. Required package for testing can be installed with:
```
pip install -r test_requirements.txt
```To run testing locally:
```
pytest
```