Giter Site home page Giter Site logo

fastapi-example's Introduction

Setup

  1. Clone the repository and navigate to the root folder in your terminal.
git clone [email protected]:erdem/python-coding-test.git
  1. Create a .env file (git ignored) by copying the .env.example file.

  2. Install the project dependencies with poetry via call make install command.

make install
  1. The project uses pre-commit to enforce code formatting and run linters before every commit. The pre-commit hooks configuration is stored in the .pre-commit-config.yaml file. Install the hooks before making any commit.
pre-commit install
  1. Run FastAPI dev server to explore the API
make dev

Usage

curl --request POST \
  --url http://localhost:8000/api/pdf-checker \
  --header 'Content-Type: application/json' \
  --data '{
      "file_name": "retailco.pdf",
      "company_name": "RetailCo"
    }
'

FastAPI PDF Data Checker

This project demonstrates a FastAPI application that compares company data extracted from PDFs against existing records. It's designed to simulate a common business task: verifying information from multiple sources.

What it does

  1. Extracts data from PDFs using a mocked external service
  2. Compares the extracted data with records stored in a CSV file
  3. Returns a summary of all fields, noting any discrepancies

Key components

  • FastAPI for the API framework
  • A mocked PDF extraction service (src/pdf_service.py)
  • CSV file for storing existing company data (data/database.csv)
  • Data comparison and reporting logic

Technical aspects

  • Integration with an external service (simulated)
  • Data processing and comparison
  • Error handling and input validation

This project serves as an example of using FastAPI to process data and generate comparison reports. It's structured following good coding practices.

fastapi-example's People

Contributors

erdem avatar mikey-lantern avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.