Skip to content

c3g/ccv_api

Repository files navigation

Canadian Common CV API

CCV API is a Django-based backed system to query the available CCVs.

Technologies Used

Server-side

Database

Installation

  1. Clone the repository

     git clone https://github.com/c3g/ccv_api.git
  2. Create a virtual environment with Python 3 or later, and activate it

    virtualenv venv -p python3 
    source venv/bin/activate
  3. Install the dependencies required for this project

    pip3 install -r requirements.txt
  4. Create a new configuration file depending on the environment(development or production).

    cp ccv_api/development.cfg.dist ccv_api/development.cfg 
  5. Create a new postgres database and configure credentials in the config file.

    [database]  
    NAME: db_name
    USER: db_user
    PASSWORD: password_for_user
    HOST: localhost
    PORT: 5432
  6. Run migrations to migrate existing schema to the database

    python3 manage.py migrate

Running server

After following all installation steps, Run the Django server

python3 manage.py runserver

Running Parser

If the installation is suceessful and Django server is running, then the parser can be executed

python3 manage.py parse_ccv <ccv_xml_file_path>

# For example
python3 manage.py parse_ccv sample_ccv/ccv_sample_3.xml

The above command takes the XML file as input and ingests the data into the database.

Running Tests

To run tests, run this command

tox -e pytest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages