Questions tagged [petl]

petl is a general-purpose ETL package (extract, transform, load) for Python.

petl supports extracting data from XML, HTML, JSON, CSV and text files, databases, Excel, as well as Python objects, arrays, Pandas DataFrames, pickle files and other sources.

It offers various ways of transforming and combining extracted data.

38 questions
8
votes
4 answers

Maketrans not working for petl with python3.4

I am using petl package which i have installed using pip in virtulaenv with python 3.4. when i tried to test that whether the petl package is installed properly or not in the python shell I have done this to check $ python Python 3.4.0 (default,…
Mukesh'python-php
  • 143
  • 1
  • 2
  • 7
2
votes
1 answer

Group by multiple fields with python using petl

I am trying to group by multiple fields a table that has already been read in using petl (that is, it's a petl type). I am trying with the following piece of code: import petl as etl from collections import OrderedDict csv_ea_flood_def =…
Pitrako Junior
  • 143
  • 1
  • 7
2
votes
1 answer

Unicode error with python 3 and sqlite on LInux

I have a Python program that generates reports from data in SQL database. For CI pipeline tests I create an in memory sqlite3 database using the following command: from sqlaclhemy import create_engine eng = create_engine("sqlite:///") con =…
jfp
  • 73
  • 7
2
votes
1 answer

ETL table selection by Variable

I'm trying to select rows within a table and create a new table with the information from the original table using PETL. My code right now is: import petl as etl table_all = ( etl.fromcsv("practice_locations.csv") …
JackDG
  • 49
  • 1
  • 8
2
votes
1 answer

Parse XML with PETL

I'm trying to parse the following XML code in Python using the PETL package
George Rodman
  • 289
  • 7
  • 19
2
votes
4 answers

Boolean equivalent of pandas to_numeric()

I am searching for the boolean equivalent of pandas to_numeric() I want the function to convert a column to True/False/nan if at all possible, and if not throw an error. My motivation is that I need to auto recognize and convert boolean columns in a…
Selah
  • 7,728
  • 9
  • 48
  • 60
1
vote
1 answer

WARNING: Error parsing requirements for numpy: [Errno 2] No such file or directory:

I am struggling with library installations. I have not received this error before though. I get a WARNING: Error parsing requirements for numpy: [Errno 2] No such file or directory: This error occurs whether I use Jupyter notebook or…
Jeffrey
  • 23
  • 1
  • 4
1
vote
1 answer

Error when move data from database to another

Error on ETL code on python I managed to learn some lines of code on python to perform ETL processes in MS SQL environment. the initial script was for PostgreSQL environment. I want to use mine for MS SQL. I tried editing the code however I got an…
AKP
  • 89
  • 1
  • 1
  • 14
1
vote
1 answer

Insert a value into a row with petl?

I'm using petl and trying to figure out how to insert a value into a specific row. I have a table that looks like this: +----------------+---------+------------+ | Cambridge Data | IRR | Price List | +================+=========+============+ |…
user7496931
1
vote
0 answers

petl convert data from duplicate entries

Am trying to use petl library to build an ETL process that copied data between two tables. The table contain a unique slug field on the destination. For that, I wrote my script so It would identify duplicate slugs and convert them with by appending…
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
1
vote
1 answer

How to convert values in table using petl

I am having a weird issue with converting multiple values in a table. I have a table of data like so: +-------------+--------------+-------------+ | id | name | category_id | +=============+==============+=============+ | 1…
jeffci
  • 2,537
  • 6
  • 37
  • 59
1
vote
2 answers

petl - how to replace empty values with zeros

For a petl table, how do I replace empty values with zeros? I would expect something like the following: tb_probii = etl.fromcsv("data.csv").fill("score", "", 0) Looked for a similar function…
Selah
  • 7,728
  • 9
  • 48
  • 60
1
vote
3 answers

Convert string to tuple using petl

This is my first question on StackOverflow, so suggestions on how to make the question clearer are always welcome. I have a CSV of point data structured as shown below: OBJECTID,CART_ID,SHAPE 1,ABC,"(1.2, -4.5)" 2,ABD,"(3.8, 9.1)" Using the petl…
user6273610
0
votes
1 answer

Petl to export data to a mongodb collection in docker

I want to ingest data from a csv file into a mongodb collection ruining in a docker container by using just python. Do you have any idea how can I do so?
0
votes
0 answers

"Connection is busy" error message using petl with pyodbc connection

With python, I am trying to read a table from SQL Server, populate one field and load the resulting table back to SQL Server as a new table. I'm using "petl". I can read the table with no problems, I populate the field successfully, but then I get…
Pitrako Junior
  • 143
  • 1
  • 7
1
2 3