https://github.com/guilhermecaz/pylibcsv
This repository represents my solution to a challenge which involved generating a shared-object using Cython to handle CSVs
https://github.com/guilhermecaz/pylibcsv
csv cython python shared-library
Last synced: about 1 year ago
JSON representation
This repository represents my solution to a challenge which involved generating a shared-object using Cython to handle CSVs
- Host: GitHub
- URL: https://github.com/guilhermecaz/pylibcsv
- Owner: GuilhermeCAz
- License: mit
- Created: 2024-07-15T14:54:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-21T22:56:23.000Z (almost 2 years ago)
- Last Synced: 2025-02-11T13:39:12.153Z (over 1 year ago)
- Topics: csv, cython, python, shared-library
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libcsv
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://github.com/pytest-dev/pytest)
[](https://www.docker.com/)
[](https://www.gnu.org/software/make/)
[](https://github.com/astral-sh/ruff)
[](https://mypy-lang.org/)
## Overview
This project demonstrates an efficient integration of Python and C (using Cython) for building a shared library for CSV processing, developed as part of a code challenge in a recruitment process.
The original challenge contained the [Dockerfile](Dockerfile), [libcsv.h](libcsv.h) and `test_libcsv` files. These files should not be modified. Instead, the [build.sh](build.sh) script should contain the steps to build a shared object, containing functions declared in [libcsv.h](libcsv.h).
`test_libcsv` was an ELF executable containing a single test to verify if the shared object was loaded correctly. The company requested not to share it (nor the challenge requirements) for security reasons. As such, the original `docker run` command is now invalid.
## Installation and Execution
1. Build the Docker image `(make build)`:
```bash
docker build -t libcsv .
```
2. Run the Docker image (no longer valid) `(make run)`:
```bash
docker run -it libcsv
```
3. Execute Python tests `(make tests)`:
```bash
docker run -it libcsv /bin/sh -c "source /app/.venv/bin/activate && pytest"
```