Skip to main content

files-2-db

Uploading data from files to database made easy!

Background

Importing a file from your local machine into a database which is in a remote server is painful process. The exact same process can be done through a command now.

Current implementation

  • File formats supported - .csv
  • Database engines supported - mysql

Usage

The tool can be used in two ways.

  • Through command line, where you do not even need a python script to be created.

    usage: file2db [-h] --host HOST [--port PORT] --user USER --password PASSWORD
                --database DATABASE --table TABLE [--seperator SEPERATOR]
                [--ignore_errors IGNORE_ERRORS] [--n_rows N_ROWS]
                Source-file Target-database
    
    
    file2db - Transfer of data from your local file to Database, made simple.
    
    positional arguments:
    Source-file           Absolute path of the file to be uploaded, with suffix
    Target-database       Target database where the file has to be uploaded
    
    options:
    -h, --help            show this help message and exit
    --host HOST           URL or IP address representation of database host
    --port PORT           Port number to connect to the database
    --user USER           Username for database authentication
    --password PASSWORD   Password for database authentication
    --database DATABASE   Target database
    --table TABLE         Target table to insert the data
    --seperator SEPERATOR
                            Column seperator in the file
    --ignore_errors IGNORE_ERRORS
                            Try to keep reading lines if some lines yield errors. default
                            value -> False
    --n_rows N_ROWS       Number of rows from the file to be inserted to database.
                            Default -> all
    
  • Otherwise, you can access the ingest_data_from_file API of the module. It takes the same set of parameters to the API in the below format,

    def ingest_data_from_file(
        file_path: str,
        target_database: str,
        db_host: str,
        db_port: int,
        db_user: str,
        db_password: str,
        data_db: str,
        data_table: str,
        file_seperator: str,
        ignore_file_errors: bool,
        n_rows_to_insert: int,
    ) -> None:
        ...
    

Roadmap

In upcoming versions, files2db will support commonly used file formats like, .json, .parquet, .tsv, .xlsx, .arrow and the databases, not limited to, postgresql, sqlite, MSSQL and what not.

Metadata

Release files for files2db 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for files2db 0.1.1
File Size Uploaded Provenance Actions
files2db-0.1.1.tar.gz 9.2 kB Without provenance Details for files2db-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for files2db 0.1.1
File Interpreter ABI Platform Actions
files2db-0.1.1-py3-none-any.whl Python 3 none any Details for files2db-0.1.1-py3-none-any.whl

Total release size: 21.8 kB

Release files / files2db-0.1.1.tar.gz

Download URL files2db-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c951024b663e584fcaf451b56c27624c7bb7c3b312d0b0a96762c27650e9152a
BLAKE2b-256 checksum
How to use checksums
664f2546a6a267921f76eac4e9b6dadb6222b2bd4fd662b962bb552240ab3652
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / files2db-0.1.1-py3-none-any.whl

Download URL files2db-0.1.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24c79420f4241436b70b21e34f07e55111a3c99608776aeb2edb6e5b3770d36d
BLAKE2b-256 checksum
How to use checksums
c35678ce24f5e8496ce8ff462d990ab5bb0135e56cbd35a3e92920aaaaa80de3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for files2db 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page