Giter Club home page Giter Club logo

pyload's Introduction

Python CDR Loader

  • Create a python virtual environment python -m venv venv
  • Activate the venv venv\Scripts\activate.bat for windows
  • Install the dependencies pip install -r requirements.txt
  • Loaded the cdrs in the cdrs/postauth directory for example
  • Create a .env file in the root directory and copy the content from .env.local and populate the variable accordingly
  • Now run the script python main.py

Note: The cdrs/loaded folder is for the loaded cdrs populated automatically by the script

pyload's People

Contributors

emmanuelobua avatar

Watchers

 avatar

Forkers

ushergodwin

pyload's Issues

Incompatible string formator for python versions below 3.12

Incompatible string formator for Python versions below 3.12

  • Line 124 in loader.py uses an f string formator with a character escape sequence not supported by python versions below 3.12
 command = f"mysql --local-infile -h {env['MYSQL_HOST']} -u {env['MYSQL_USER_NAME']} -p -D {env['MYSQL_DATABASE']} -e \"LOAD DATA LOCAL INFILE '{cleaned_file_path.replace('\\', '\\\\')}' INTO TABLE {table_name} FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n';\""

  • The below fix works for version < 3.12, tested on python version 3.11.5
    cleaned_file_path = cleaned_file_path.replace('\\', '\\\\')
    command = f"mysql --local-infile -h {env['MYSQL_HOST']} -u {env['MYSQL_USER_NAME']} -p -D {env['MYSQL_DATABASE']} -e \"LOAD DATA LOCAL INFILE '{cleaned_file_path}' INTO TABLE {table_name} FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n';\""

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.