Create multiple PDF's with python Reportlabs and 1 CSV - python

Im new to python, and would be really grateful if some one could offer some advice or point me in the right direction. I have 1 large CSV file, with many order numbers and order lines. (1 order many have many order lines, but the file consists of all orders from last 24 hours)
Im trying to create multiple PDF's which has been grouped by the order number showing the lines. (one pdf for each order)
I found a great tutorial on Utube to show me how to add the group / create multiple files (mark2741-generate certificates) It looks great because i have added order address and a logo to the canvas. But i cant add a table to the canvas based on the group to show the order lines.
any ideas?
ps, Im using ReportLabs
Thanks in advance

Related

Combining all Elements with PYPDF (like one big image)

I wrote a code in python, which creates music notation based on a user input. It generates a PDF and everything works fine.
The only problem I have is that the notation consists of 100's of small images and I wanted to ask if there is a possibility to merge them all together into one big image. I don't want them to be selectable or anything. Basically I want the PDF to be like one big picture per page.
Is that possible using PyPDF2?
Thanks in advance and have a great weekend!

How can I change accidentally wrong written date into the previous number form?

enter image description here---->Currently I am working on a data which has more than 26 million rows and 2 columns. I managed to seperate it into equal sized - 1 million csv files. The problem here is - I need to open this file in Python and plot the graph of the data. But some rows of the data was accidentally written in date format. (For example-It was desired to write 11.1118 celsius but instead excel got 11/11/2018)There are too many rows that I need to fix and I can't do it one by one. Is there any solution to this or..?
Given above is the part of my data and there are hundreds of same mistakes in the upcoming rows
If the image you posted is representative for the whole problem you have, I think you do not have any problem, because only the left column is corrupted and as far as I can see this column shows nothing but an equidistant list of numbers with step 0.5. If you need this as an x-value of a diagram you can simply create it separately and import only the data of the right column.

Selecting a specific row entry in excel and printing the entire row if condition is satisfied

I have csv file in excel that looks like this (sorry cant place pictures in the post yet)
RAW DATA
Here is what i want to do:
1) I want python to read through column B and find the phrase RCOM (highlighted)
2) Once it find that phrase, i want it to show me the date entry and the corresponding amounts which i have made bold and are in the red color.
3) hopefully making it read something like this:
30-08-2018 273585.8
27-09-2018 275701.4
25-10-2018 276780
*If possible putting the entries on seperate lines would be great, but if not thats fine too.
4) I will then store these in a variable of my choice and print it out as needed.
I know the column where the word RCOM is located, and i know the column where the amounts i want are located (B and K respectively)
I am very new to coding, any help will be appreciated. Im just trying to automate the boring stuff :)
Thanks
you can generate a data frame using read_csv function from pandas library. Once you have the data in data frame format, you can reach to data mentioned in your question by filtering the data according your requirements. I know this answer is very generic and does not provide a code suggestion but I believe that all information you need can be found in following page https://pandas.pydata.org/pandas-docs/stable/10min.html
For importing data Getting Data In/Out section will be helpful and for filtering (masking) the data Selection section will help.

Python - Perceptually detect the same object on two images - and selecting them

I have some challenge and I try find any information, tips, examples which help me do that. First I looking many times google, and this forum with different ask but I don't found any this same task, algorithm. I try many commercial program to compare images, to find diffrent and common parts but all is don't do that good and smart.
I have some website with many different boxes, modules, elements etc. Now I do do first printscreen, save this image as web1.png.
Next step I change some boxes, elements on this website, for example I remove some block, add new elements, move one of some module/part of website into another places.
Now I do next printscreen this website after last change and save as web2.png
And now it's the most important think what I want to get, do do.
I put this two images (web1.png and web2.png) for examples to some scripts on Python or another technology where smart algorithm to compare this two file and show, marked different or maybe only the first the same element on this two files.
I think is the most big problem is defined what is exactly separated some block, module, many different elements on printscreen website and then find this same block on this next page and how marked this or maybe create next result png with this same element. I don't sure is possible to do that, whether there is a smart
algorithm or way to do that. Thank you in advance for all the help and guidance.
Here is images examples

How to reformat dataframe in Pandas using Python?

I'm pretty new to Pandas and Python, but have solid coding background. I've decided to pick this up because it will help me automate certain financial reports at work..
To give you a basic background of my issue, I'm taking a PDF and using Tabula to reformat it into a CSV file, which is working fine but giving me certain formatting issues. The reports come in about 60 page PDF files, which I am exporting to a CSV and then trying to manipulate the data in Python using Pandas.
The issue: when I reformat the data, I get a CSV file that looks something like this -
The issue here is that certain tables are shifting and I think it is due to the amount of pages and multiple headings within those.
Would it be possible for me to reformat this data using Pandas, and basically create a set of rules for how it gets reformatted?
Basically, I would like to shift the rows that are misplaced back into their respective places based on something like blank spaces.
Is it possible for me to delete rows with certain strings - deleting extra/unnecessary headers.
Can I somehow save the 'Total' data at the bottom by searching for the row with 'Total' and placing it somewhere else?
In essence, is there a way to partition this data by a set of commands (without specifying row numbers - because this changes daily) and then reposition it accordingly so that I can manipulate the data however necessary?

Categories

Resources