An API app designed to parse a CSV file and return records from different endpoints based on a pre-established set of criteria.
💻 Application Overview
The application consists of the following main components:
CSV Parser
Data Query
⚒️ Technologies Used
🔄 API Reference
Load data from CSV file
POST /api/v1/parser
Usage
ReturnType
Description
Load all people data
int
Reads data from file and persists to database, returns count of rows loaded
Get all people
GET /api/v1/people[action]
Action
ReturnType
Description
Get people with 'Esq' in Company Name
List<Object>
Returns a list of people who have the string 'Esq' in their company name
Get all people whose Company Name contains string 'Esq'
GET /api/v1/people/[action]
Action
ReturnType
Description
Get people from Derbyshire
List<Object>
returns a list of people who live in county Derbyshire
Get all people where house number is three digits
GET /api/v1/people/[action]
Action
ReturnType
Description
Get people whose house number is exactly 3 digits
List<Object>
returns a list of people whose house number is exactly 3 digits
Get all people whose web URL has more than 35 characters
GET /api/v1/people/[action]
Action
ReturnType
Description
Get people whose website URL length is greater than 35 characters
List<Object>
returns a list of people whose URL length > 35
Get all people whose postcode contains only one digit after the city code, example SE2
GET /api/v1/people/[action]
Action
ReturnType
Description
Get people who live in a postcode with a single digit value
List<Object>
returns list of people whose postcode contains one digit
Pre-requisites
C# / .NET 6
NuGet
🔀 Getting Started
Application Setup
Fork this repo to your Github and then clone the forked version of this repo.
Setup:
Open up project in Visual Studio
This application requires a path pointing to a csv file. By default the path is set to @"D:\Data\input.csv":
To use this application you will need to either specify a new file path or create a folder with a file in the default directory location
- To change the filepath in the appliation, you will need to modify the path in the following files: