This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/scripts/README.md
Alexander Polynomdivision 1a07fd2ddb scripts: Add add_level.py
2018-10-01 17:33:25 +02:00

40 lines
1.2 KiB
Markdown

# Scripts
A few scripts to help with any task
## csv_vocab_to_mongo.py
Parses the vocabulary files in `$REPO_ROOT/data/vocab/`, converts the vocabulary items
into a format that fits the database model for vocabulary items (see `backend/db.md**) and
writes the data into the MongoDB database.
**NOTE**: Requires `pymongo` to be installed via pip
### Usage
`python csv_vocab_to_mongo.py <URI> <Database>`
- `URI`: The URI of the MongoDB instance
- `Database`: The name of the database in the MongoDB instance
## add_user.js
Asks the user about his data (username, password, class** and adds the user to the database.
**NOTE**: Requires `mongodb** to be installed via npm
**NOTE**: This script is written in JavaScript, so we can ensure that the same pbkdf2 function is used
to create the user and to hash the password later on.
### Usage
`node add_user.js <URI> <Database>`
- `URI`: The URI of the MongoDB instance
- `Database`: The name of the database in the MongoDB instance
## add_level.py
Asks about a new level to add
**NOTE**: Requires `mongodb** to be installed via npm
### Usage
- `URI`: The URI of the MongoDB instance
- `Database`: The name of the database in the MongoDB instance