Metadata-Version: 2.4
Name: simple_bcp
Version: 2.3.2
Summary: A Simple yet powerful bcp wrapper
License: MIT
License-File: LICENSE
Author: Noam Fisher
Author-email: noam9997@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: annotated-types (>=0.7.0,<0.8.0)
Requires-Dist: packaging (>=25.0,<26.0)
Requires-Dist: pydantic (>=2.11,<3.0)
Project-URL: Homepage, https://gitlab.com/noamfisher/simple_bcp
Project-URL: changelog, https://gitlab.com/noamfisher/simple_bcp/-/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# Simple BCP

[![Python](https://img.shields.io/pypi/pyversions/simple-bcp)](https://pypi.org/project/simple-bcp)
[![pipeline status](https://gitlab.com/noamfisher/simple_bcp/badges/main/pipeline.svg)](https://gitlab.com/noamfisher/simple_bcp/-/commits/main)
[![coverage report](https://gitlab.com/noamfisher/simple_bcp/badges/main/coverage.svg)](https://gitlab.com/noamfisher/simple_bcp/-/jobs?name=test)
[![Latest Release](https://badge.fury.io/py/simple-bcp.svg)](https://pypi.org/project/simple-bcp)
[![Downloads](https://static.pepy.tech/personalized-badge/simple-bcp)](https://pypi.org/project/simple-bcp)
[![tested-on-mssql](https://img.shields.io/badge/tested%20on%20mssql-2017%20%7C%202019%20%7C%202022%20%7C%202025-a)](https://gitlab.com/noamfisher/simple_bcp/-/jobs?name=test)

A Simple yet powerful Python bcp wrapper.  
`bcp` (**b**ulk **c**opy **p**rogram) is a command line tool that copies data from / into  MSSQL.  
You can read more about bcp [here](https://learn.microsoft.com/en-us/sql/tools/bcp-utility)

## Installation

Install the package using pip:

```bash
pip install simple_bcp
```

## Usage

```python
import simple_bcp

bcp = simple_bcp.BCP()
database_parameters = simple_bcp.MsSqlDatabaseParameters(
    server_hostname="your-sql-server-hostname",
    username="user",
    password="pass"
)
output_file_path = bcp.download_table(table_name="your_table_name", 
                                      database_parameters=database_parameters)
print("downloaded table data is now available at ", output_file_path)
bcp.upload_into_table(table_name="dest_table_name",
                      database_parameters=database_parameters,
                      data_file_path=output_file_path)
print("the data is now copied to dest_table_name")
```

## Requirements

- Python >= 3.10
- `bcp` installed on your machine. [How to install bcp](https://learn.microsoft.com/en-us/sql/tools/bcp-utility#download-the-latest-version-of-the-bcp-utility)

## Repo & Author

Developed by [Noam Fisher](https://gitlab.com/noamfisher),
You can see the project at https://gitlab.com/noamfisher/simple_bcp

## Contributing

We welcome contributions! Please follow these guidelines:

### Merge Requests

1. Fork the repository
2. Create a feature branch from `main`
3. Make your changes
4. Submit a merge request to the `main` branch

### Commit Message Format

This project uses [Conventional Commits](https://www.conventionalcommits.org/) – Your commits must follow this format.
This project uses [semantic-release](https://python-semantic-release.readthedocs.io/) for automated versioning.

