
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
๐ A beautiful CLI tool for ingesting CSV files into PostgreSQL and serving data via GraphQL
____ _ ____ _ ____ ______ __ ___ _
/ ___|_ __ __ _ _ __ | |__ / __ \| | / ___/ ___\ \ / / |_ _|_ __ __ _ __| |_
| | _| '__/ _` | '_ \| '_ \| | | | | | | \___ \\ \ / / | || '_ \ / _` |/ _` (_)
| |_| | | | (_| | |_) | | | | |__| | |___ | |___ ___) |\ V / | || | | | (_| | (_| |_
\____|_| \__,_| .__/|_| |_|\___\_\_____| \____|____/ \_/ |___|_| |_|\__, |\__,_(_)
|_| |___/
Transform your CSV data into powerful GraphQL APIs in minutes!
๐ Documentation โข ๐ Quick Start โข ๐ป Examples โข ๐ค Contributing
๐ฅ Professional Data Pipeline in Your Terminal
# ๐ Install from PyPI (Recommended)
pip install csv-graphql-cli
# ๐ง Or install in a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install csv-graphql-cli
# ๐ ๏ธ Development installation from source
git clone https://github.com/cjanowski/graphql-ingest.git
cd graphql-ingest
pip install -e ".[dev]"
After running pip install csv-graphql-cli
:
# 1๏ธโฃ Show the main interface and available commands
csvgql
# 2๏ธโฃ Initialize database connection
csvgql init-db
# 3๏ธโฃ Ingest your CSV data
csvgql ingest -f data/sample_data.csv -t employees
# 4๏ธโฃ Preview your data
csvgql preview -t employees
# 5๏ธโฃ Start GraphQL server
csvgql serve
# 6๏ธโฃ Query at http://localhost:8000/graphql
Use the convenient wrapper script (csvgql.py
) if you prefer not to install:
# Navigate to project directory
cd graphql-ingest
# 1๏ธโฃ Show the main interface and available commands
python csvgql.py
# 2๏ธโฃ Initialize database connection
python csvgql.py init-db
# 3๏ธโฃ Ingest your CSV data
python csvgql.py ingest -f data/sample_data.csv -t employees
# 4๏ธโฃ Preview your data
python csvgql.py preview -t employees
# 5๏ธโฃ Start GraphQL server
python csvgql.py serve
# 6๏ธโฃ Query at http://localhost:8000/graphql
For development, you can also run directly from source:
# Navigate to project directory
cd graphql-ingest
# Run CLI directly from source
python -m src.cli
# Or individual commands
python -m src.cli init-db
python -m src.cli ingest -f data/sample_data.csv -t employees
python -m src.cli serve
Demo video coming soon - showing the CLI interface in action!
# Using installed package (after pip install csv-graphql-cli)
csvgql # Show main interface
csvgql init-db # Initialize database
csvgql ingest -f data.csv -t users # Ingest CSV data
csvgql preview -t users # Preview the data
csvgql serve # Start GraphQL server
# OR using wrapper script (development)
python csvgql.py # Show main interface
python csvgql.py init-db # Initialize database
python csvgql.py ingest -f data.csv -t users # Ingest CSV data
python csvgql.py preview -t users # Preview the data
python csvgql.py serve # Start GraphQL server
After running pip install csv-graphql-cli
:
csvgql # Show main interface
csvgql init-db # Initialize database
csvgql ingest -f data.csv -t table # Ingest CSV
csvgql serve # Start GraphQL server
csvgql preview -t table # Preview table data
csvgql tables # List tables
csvgql config-info # Show configuration
If you prefer not to install the package:
# Navigate to project directory
cd graphql-ingest
# Use the wrapper script
python csvgql.py # Show main interface
python csvgql.py init-db # Initialize database
python csvgql.py ingest -f data.csv -t table # Ingest CSV
python csvgql.py serve # Start GraphQL server
python csvgql.py preview -t table # Preview table data
python csvgql.py tables # List tables
python csvgql.py config-info # Show configuration
Command | Description |
---|---|
python -m src.cli | Main CLI interface |
python -m src.cli init-db | Initialize database |
python -m src.cli ingest | Ingest CSV files |
python -m src.cli serve | Start GraphQL server |
python -m src.cli preview | Preview table data |
python -m src.cli tables | List available tables |
python -m src.cli config-info | Show current configuration |
Method | Command | Description |
---|---|---|
PyPI Package | csvgql | Main CLI interface (shows all commands) |
PyPI Package | csvgql init-db | Initialize database |
PyPI Package | csvgql ingest | Ingest CSV files |
PyPI Package | csvgql serve | Start GraphQL server |
PyPI Package | csvgql preview | Preview table data |
PyPI Package | csvgql tables | List available tables |
PyPI Package | csvgql config-info | Show current configuration |
Development | python csvgql.py | Main CLI interface |
Development | python csvgql.py init-db | Initialize database |
Development | python -m src.cli | Main CLI interface |
Development | python -m src.cli init-db | Initialize database |
{
tables {
name
columns {
name
type
}
}
}
{
tableData(tableName: "employees", limit: 10) {
data
total
}
}
mutation {
ingestCsv(file: "new_data.csv", tableName: "products") {
success
message
rowsInserted
}
}
Create .env
file in the project root:
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_NAME=your_database
DB_USER=your_username
DB_PASSWORD=your_password
# Server Configuration
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
DEBUG=false
You can also copy the example configuration:
cp config/env.example .env
graphql-ingest/
โโโ ๐ฆ src/ # Main application code
โ โโโ cli.py # Command-line interface
โ โโโ config.py # Configuration management
โ โโโ database.py # Database operations
โ โโโ graphql_schema.py # GraphQL schema definition
โ โโโ server.py # FastAPI server
โโโ ๐งช tests/ # Test suite
โ โโโ test_basic.py # Basic functionality tests
โ โโโ integration_test_examples.py
โโโ ๐ examples/ # Usage examples
โโโ ๐ docs/ # Documentation
โโโ ๐ณ docker/ # Docker configuration
โโโ ๐ data/ # Sample data files
โ โโโ sample_data.csv # Test data
โ โโโ test_data_large.csv # Larger test dataset
โโโ โ๏ธ config/ # Configuration files
โ โโโ env.example # Environment template
โ โโโ setup.cfg # Setup configuration
โ โโโ MANIFEST.in # Package manifest
โโโ ๐ ๏ธ tools/ # Build and development tools
โ โโโ setup.py # Package setup script
โ โโโ coverage.xml # Coverage reports
โโโ ๐ .github/ # GitHub workflows
โโโ ๐ requirements/ # Dependency management
โโโ ๐ CONTRIBUTE.md # Contribution guidelines
โโโ ๐ CHANGELOG.md # Change log
โโโ ๐ QUICKSTART.md # Quick start guide
โโโ ๐ README.md # Project overview
# Create virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate
# Install with development dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=src
# Run with verbose output
pytest -v
# Run specific test file
pytest tests/test_basic.py
# Build and run with Docker
docker-compose up
# Or use the Dockerfile directly
docker build -t csv-graphql-cli .
docker run -p 8000:8000 csv-graphql-cli
pip install csv-graphql-cli
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install csv-graphql-cli
git clone https://github.com/cjanowski/graphql-ingest.git
cd graphql-ingest
pip install -e ".[dev]"
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ and lots of ๐๐๐!
FAQs
๐ A beautiful CLI tool for ingesting CSV files into PostgreSQL and serving data via GraphQL
We found that csv-graphql-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600ร faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.