Is there any way we can transfer data from python to front-end file in pyramid framework - pyramid

What I want to achieve is send some variables from back end to front end where I have a template files to create the front end. Is there any suggestions where I can find an answer for that.

Related

A Study on the Modification of PDF in nodejs

Project Environment
The environment we are currently developing is using Windows 10. nodejs 10.16.0, express web framework. The actual environment being deployed is the Linux Ubuntu server and the rest is the same.
What technology do you want to implement?
The technology that I want to implement is the information that I entered when I joined the membership. For example, I want to automatically put it in the input text box using my name, age, address, phone number, etc. so that the user only needs to fill in the remaining information in the PDF. (PDF is on some of the webpages.)
If all the information is entered, the PDF is saved and the document is sent to another vendor, which is the end.
Current Problems
We looked at about four days for PDFs, and we tried to create PDFs when we implemented the outline, structure, and code, just like it was on this site at https://web.archive.org/web/20141010035745/http://gnupdf.org/Introduction_to_PDF
However, most PDFs seem to be compressed into flatDecode rather than this simple. So I also looked at Data extraction from /Filter /FlateDecode PDF stream in PHP and tried to decompress it using QPDF.
Unzip it for now.Well, I thought it would be easy to find out the difference compared to the PDF without Kim after putting it in the first name.
However, there is too much difference even though only three characters are added... And the PDF structure itself is more difficult and complex to proceed with.
Note : https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf (PDF official document in English)
Is there a way to solve the problem now?
It sounds like you want to create a PDF from scratch and possibly extract data from it and you are finding this a more difficult prospect than you first imagined.
Check out my answer here on why PDF creation and reading is non-trivial and why you should reach for a tool you help you do this:
https://stackoverflow.com/a/53357682/1669243

Bulk exporting google docs as .zipped html files

I'm basically wanting the same output as I would get for exporting a single file as html, zipped; but for a folder full of files.
Ideally there's some built-in function I don't know about. I looked through the gdocs python api, but I didn't see anything that really looked like a solution to what I'm trying to accomplish.

Responding queries in Nodejs when data stored in csv file

THis is my first time doing web apps after a few months working in desktop applications, so i a little bit lost with this issues. Im developing a microservice in nodejs with swagger. This microservice receive request for the users with 3 parameters and these parameters allows the microservice to find a value in a excel file and return it to the user. In order to do that i have a controller called Rates who receives the request and sends to the user the selected value in the csv file.
For do that, i need to load the csv in a data structure when the server starts like a javascript Map(key,value):
The first value of each row will be the key of the pair.
The rest of the row will be the value of the pair, stored like an array.
I don't not experience working with nodejs, so i dont know what is the best way to do that... I have some questions:
It's a good solution to use a class with a global map (mapData i. e.) with two static methods, one to load the data when the server starts and another one for respond users queries searching in the dictionary the value?
How i can structure that in the skeleton of the project? Should I create a helper with the functions and call the load function in the app.js file using to initialize the http server and call the search function from the Rates controller?
Thank you for your help.
Yes it's a good solution, you should absolutely read your excel file once and store it in memory with an easy-to-search format
You can do pretty much what you want, what I would do is the following:
services/CSVService.js: expose your 2 methods to read & search into the csv file
api/controllers: declare your controllers and call your CSVService.search() inside a controller
api/routes: declare your routes (referencing controllers)
server.js: launch the server and require the api, call the CSVService.read() once it's started

Using DataTables with Python

I'm a beginner at website programming and want to understand some basics.
I've created a Python 3 script which fetches some data from a website and makes some calculations. Result is then about 20 rows with 7 columns.
What is the easiest way to make them available on my website? When refreshing my website, the Python script should fetch the data from the 3rd party website and this data should then be displayed in a simple table with sorting option.
I've discovered the jQuery plugin DataTables with Ajax JSON source. I would create a PHP script which executes the Python script which writes data to a DB like MariaDB. PHP then creates a JSON for Ajax.
Is this the right way or are there easier ways? Maybe using a framework etc.?
Thanks!
It's easier than I thought, there is no need for PHP and MariaDB.
When using nginx, you need uswgi and uswgi-plugin-cgi to let nginx know that the Python script is a script and not data. Point to the Python script in the Ajax parameter of the DataTable JS code, make it executable and print the array with JSON function in the Python script, and include cgi/json header strings. The array should look like that in the example of Datatables Website (Ajax source).
It's all running in the memory now.

How to log in and auto fill values into a 'drupal form' from an 'excel file'?

So, there is this website where I have to log in and insert values in the add content->person roles and I have to take values from an excel file. I tried entering the values in the database directly but got nowhere. The database is too randomly generated.
I want to know- how to go by this problem? I think python would be the best way but I am more comfortable with java. The images bellow will help understand the situation better-
The log in from:
The form to be filled:
Try using feeds module:
https://www.drupal.org/project/feeds
Install it on you site first of course. Or look for some similar import module. Maybe this one:
https://www.drupal.org/project/datasources
If nothing succeeds then try making import script on your own. You have to parse document (would be much easier to open it from excel and export as CSV if possible http://php.net/manual/en/function.fgetcsv.php) and have some loop to write content into Drupal system. Use Drupal's functions for that, do not directly write to database. It's not hard as it looks like:
https://www.drupal.org/node/1388922

Resources