StaelTchinda / bundesagentur-api

This is an API to access to the databases of the German Federal Employment Agency (Deutsche Bundesagentur für Arbeit).
MIT License
0 stars 0 forks source link

Set up knowledge database #10

Closed StaelTchinda closed 5 months ago

StaelTchinda commented 5 months ago

Description

We want to be able to add new features after which we could filter. These include licenses, work fields, skills, ... For this purpose, we need to store them somewhere and to fetch them back.

Resources

I recommend using the json library (Official doc) to read the information (Tutorial to read/write files).

Tasks

The tasks include:

class KnowledgeDb: def init(self, path: PathLike): """Initialize the "database".

    Args:
        path (PathLike): The path to the json file.
    """
    raise NotImplementedError("This class is not implemented yet.")

def get_all(self) -> List[Dict]:
    """
    Retrieves all the records from the database.

    Returns:
        A list of dictionaries representing the records in the database.
    """
    raise NotImplementedError("This class is not implemented yet.")

def get(self, query: QueryLike) -> List[Dict]:
    """
    Retrieves data from the database based on the provided query.

    Args:
        query (QueryLike): The query used to filter the data.

    Returns:
        List[Dict]: A list of dictionaries representing the retrieved data.
    """
    raise NotImplementedError("This class is not implemented yet.")

def get_by_regex(self, regex: Text) -> List[Dict]:
    """
    Retrieves data from the database based on the provided regex.

    Args:
        regex (Text): The regex used to filter the data.

    Returns:
        List[Dict]: A list of dictionaries representing the retrieved data.
    """
    raise NotImplementedError("This class is not implemented yet.")

- [x] Implement the class for each criterion:
-    - [x] licenses
-    - [x] work fields
-    - [x] skills (Kenntnisse)
-    - [x] competences (Kompetenzen)
-    - [x] locations
-    - [x] languages
-    - [x] jobs (Beruf)
-    - [x] locations