Product verification using QRCODES - python

I am working on a project that scan qrcodes on a product e.g Cup, and verify whether the product is the database or not, I have built the scanning app using Flutter, now my problem is creating QRCODES each having a unique identity or a specified URL that is linked to the database.
I have tried to search on the internet how I can do this but I am not finding useful answers any provided on this will be highly appreciated thanks in advance!

If you want to use Phyton, I can recommend this library for QR Code creation and rendering.
I'm not sure if you can connect Firebase with a Phyton app, it would probably easier to write a pure Angular/React/Vue web app.
Regarding the unique IDs. I'm not sure who is scanning the items. It might be a good idea to generate a URL QR Code, so if people scan the code with a different app, they get redirected to your website (maybe displaying help information how to scan the code).
For example: https://example.com/help/product-scan?pid=<the actual product id>
You can use any ID that can be stored in a database, e.g.:
A human-readable string identifier, e.g. octocat_cup
Numeric value, like an autogenerated key from a SQL database
UUID v4 (great for distributed systems and offline usage)

Related

Need more context for the Grafanalib Python3 library

I'm building a project using python and grafana where I'd like to generate a certain number of copies of certain grafana dashboards based on certain criteria. I've downloaded the grafanalib library to help me out with that, and I've read through the Generating Dashboards From Code section of the grafanalib website, but I feel like I still need more context to understand how to use this library.
So my first question is, how do I convert a grafana dashboard JSON model into a python friendly format? What method of organization do I use? I saw the dashboard generation function written in the grafanalib documentation, but it looked quite a bit different from how my JSON data is organized. I'd just like some further description of how to do the conversion.
My second question is, once I've converted my grafana JSON into a python format, how do I then get the proper information to send that generated dashboard to my grafana server? I see in the grafanalib documentation the "upload_to_grafana" function used to send the information and it takes in the three parameters (json, server, api_key), and I understand where its getting the json parameter from, but I dont get where the server information or API key are coming from or where that information is found to be input.
This is all being developed on a raspberry pi 4 just to put that out there. I'm working on a personal smart agriculture project as a way to develop my coding abilities further, as I'm self taught. Any help that can be provided to help me in my understanding is most appreciated. Thank you.
create an API key in Grafana configuration ..The secret key that u get while creating is the API key ..Server is localhost:3000 in case of installed grafana

How to get all statuses from a workflow of a project in JIRA via python?

The closest I've gotten is via the rest API call.
https://{HOST}/rest/api/2/project/{Project Key}/statuses
But I need the same call via Python. But I'm unable to find an adequate way.
The closest I've gotten in Python is
jiraInstance.statuses() but this returns all possible statuses for our Jira site.
I need to narrow it down to the workflows for a specific project.
Any help would be appreciated.
Background
This is for a reporting tool where we create a table with all the defects for the specific project in question. In python I can currently retrieve all the statuses/priorities for the Bugs/Bug-task issues but that only returns statuses for the existing bugs. I require a way to retrieve all the statuses from a workflow of the specific project.
This will list all project keys in a given project with their respective status...
issues = jira.search_issues('project=projectname')
for issue in issues:
print (issue.key, 'Status: ',issue.fields.status)

Use django to expose python functions on the web

I have not worked with Django seriously and my only experience is the tutorials on their site.
I am trying to write my own application now, and what I want is to have some sort of API. My idea is that I will later be able to use it with a client written in any other language.
I have the simplest of all apps, a model that has a name and surname field.
So the idea is that I can now write an app lets say in c++ that will send two strings to my Django app so they can be saved in the database as name, surname respectively.
What I know until now is to create a form so a user can enter that information, or have the information in the url, and of curse adding them myself from the admin menu.
What I want though is some other better way, maybe creating a packet that contains that data. Later my client sends this data to my Django webpage and it will extract the info and save it as needed. But I do not know how to do this.
If my suggested method is a good idea, then I would like an example of how this is done. If not the I would like suggestions for possible things I could try out.
Typically, as stated by #DanielRoseman, you certainly want to:
Create a REST API to get data from another web site
Get data, typically in JSON or XML, that will contain all the required data (name and surname)
In the REST controller, Convert this data to the Model and save the Model to the database
Send an answer.
More information here: http://www.django-rest-framework.org/

How I can get user input from browser using python

I am in the middle of my personal website development and I am using python to create a "Comment section" which my visitors could leave comments at there in public (which means, everybody can see it, so don't worry about the user name registration things). I already set up the sql database to store those data but only thing I haven't figured out yet was how to get the user input (their comments) from the browser. So, is there any modules in python could do that? (Like, the "Charfield" things in django, but unfortunately I don't use django)
For that you would need a web framework like Bottle or Flask. Bottle is a simple WSGI based web framework for Python.
Using either of these you may write simple REST based APIs, one for set and other for get. The "set" one could accept data from your client side and store it on your database where as your "get" api should return the data by reading it from your DB.
Hope it helps.

Need help in designing a phone book application on python running on google app engine

Hi I want some help in building a Phone book application on python and put it on google app engine. I am running a huge db of 2 million user lists and their contacts in phonebook. I want to upload all that data from my servers directly onto the google servers and then use a UI to retrieve the phone book contacts of each user based on his name.
I am using MS SQL sever 2005 as my DB.
Please help in putting together this application.
Your inputs are much appreciated.
For building your UI, AppEngine has it's own web framework called webapp that is pretty easy to get working. I've also had a good experience using the Jinja2 templating engine, which you can include in your source, or package as a zip file (example shows Django, you can do the same type of thing for Jinja).
As for loading all of your data into the DataStore, you should take a look at the bulk uploader documentation.
I think you're going to need to be more specific as to what problem you're having. As far as bulk loading goes, there's lots of bulkloader documentation around; or are you asking about model design? If so, we need to know more about how you plan to search for users. Do you need partial string matches? Sorting? Fuzzy matching?

Categories