Skip to main content

A CSV processor for Sendy.co with Brazilian data format support

Project description

CSV2Sendy

PyPI version Python Version Tests Coverage Status Documentation Status License: MIT Code Style: Mypy

A powerful CSV processor for Sendy.co with Brazilian data format support.

Documentation | GitHub Repository

🌟 Features

  • 🔄 Intelligent CSV Processing

    • Auto-detection of delimiters (, or ;)
    • Multiple encoding support (utf-8-sig, latin1, iso-8859-1, cp1252)
    • Smart column mapping and normalization
    • Robust error handling
  • 📧 Email Validation

    • RFC-compliant email validation
    • Case normalization
    • Duplicate removal
    • Invalid email filtering
  • 📱 Phone Number Processing

    • Brazilian format support
    • Format standardization
    • Invalid number filtering
    • DDD (area code) validation
  • 👤 Name Processing

    • First/last name splitting
    • Proper capitalization
    • Special character handling
    • Empty name filtering
  • 🌐 Web Interface

    • File upload and processing
    • Column mapping
    • Tag management
    • CSV download
  • 🔒 Security

    • Secure file handling
    • Automatic file cleanup
    • Input sanitization
    • File size limits

📦 Installation

Using pip

pip install csv2sendy

From source

git clone https://github.com/skaisser/csv2sendy.git
cd csv2sendy
pip install -e ".[dev]"

🚀 Quick Start

Web Interface

# Start the web server
python -m csv2sendy.web.app

Visit http://localhost:8080 in your browser.

Command Line Interface (CLI)

# Start the web server on default port (8080)
csv2sendy

# Start the web server on a specific port
csv2sendy 3000

# Get help
csv2sendy --help

The CLI provides a convenient way to start the web interface. By default, it starts the server on port 8080, but you can specify a different port as a command-line argument.

Python API

from csv2sendy.core import CSVProcessor

# Process a CSV file
processor = CSVProcessor()
df = processor.process_file('input.csv')
df.to_csv('output.csv', index=False)

# Process CSV content directly
content = '''name,email,phone
John Doe,john@example.com,(11) 98765-4321'''
df = processor.process_file(content)

💻 Development

Setup

  1. Clone the repository:
git clone https://github.com/skaisser/csv2sendy.git
cd csv2sendy
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -e ".[dev,test,doc]"

Testing

Run tests with coverage:

pytest --cov=csv2sendy tests/

Run type checking:

mypy csv2sendy

Documentation

Build documentation:

cd docs
make html

🔧 Dependencies

  • Python 3.9
  • pandas >= 1.3.0
  • email-validator >= 1.1.0
  • flask >= 2.0.0
  • werkzeug >= 2.0.0

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Install development dependencies (pip install -e ".[dev,test,doc]")
  4. Make your changes
  5. Run tests and type checking (pytest and mypy csv2sendy)
  6. Commit your changes (git commit -m 'Add amazing feature')
  7. Push to the branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Shirleyson Kaisser

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csv2sendy-1.0.4.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csv2sendy-1.0.4-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file csv2sendy-1.0.4.tar.gz.

File metadata

  • Download URL: csv2sendy-1.0.4.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for csv2sendy-1.0.4.tar.gz
Algorithm Hash digest
SHA256 c815826c9358743564ce208542492f8acdaf8d65f2f978aba87ec64af388be1c
MD5 26f7db2d70c593af033c284fc49d4c6b
BLAKE2b-256 5b6748521458cd325990e9731a4fc64fc8d64f89dd210f4eb5e6375d44495e42

See more details on using hashes here.

File details

Details for the file csv2sendy-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: csv2sendy-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for csv2sendy-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3efe5f6bf20b0313932b5b21f2071085ff376dc7f3f4cc65ceb0bf901ecb306c
MD5 f37e11f76a7b020f08b063b170309576
BLAKE2b-256 159b985c31f5aa3d57c8fb42c48477d39eca1be709d6bbed45917b413d0af6a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page