Web API for Git - python

I am looking for web API (not HTML web interface) for Git written in Perl, Python, Ruby, or may be Erlang. I need read-only access to the repository for logs and commits info. Does anybody know about it?
What does web API mean? Web API is web service as described in Wikipedia. I want to send a request via SOAP, XML-RPC, JSON-RPC, or any other protocol, and receive back data only.

Not sure what you are referring to by "web API", but there are bindings for many languages for libgit2 at http://libgit2.github.com/. Also, if you're trying to access information on GitHub repositories, check out http://developer.github.com/.

Related

Keycloak UserStorageProvider Python Implementation

As per Keycloak documentation to connect to an existing external database with user information we will need to implement the UserStorageProvider interface:
https://www.keycloak.org/docs/latest/server_development/index.html#_user-storage-spi
I couldn't find the same within the latest version of python keycloak package:
https://pypi.org/project/python-keycloak/
How can i connect to an external database like postgres from my python application if the UserStorageProvider class is not present in the supported keycloak library for python?.
Couldn't find this information on any other forum so any help regarding this would be much appreciated
How can i connect to an external database like postgres from my python
application if the UserStorageProvider class is not present in the
supported keycloak library for python?.
This library:
https://pypi.org/project/python-keycloak/
is just a library for the client side to communicate with the Keycloak server via Rest API calls. From that project you can read
python-keycloak is a Python package providing access to the Keycloak
API.
It is not officially maintained by the Keycloak project; but even if that was the case, it is just a wrap around the Keycloak Rest API. You would not be able to implement your custom UserStorageProvider using it anyway.
When the Keycloak documentation states:
You can use the User Storage SPI to write extensions to Keycloak to
connect to external user databases and credential stores.
is referring to extending the code of the Keycloak server, which is writing in Java not in python. You have to look at this documentation to understand the interfaces provided. To extend the Keycloak server code via Service Provider Interfaces (SPI) check the official documentation. It will tell you how to create your custom user storage provider using SPI.

How to setup python flask web project with react on glitch?

I want to build a static web page based on python as server side and React for frontend on glitch online programming environment but unable to do .
I tried to implement by using CDN link but unable to use efficiently . Apart from this, I also wanted to use MATERIAL UI but according to there website it says
Using this approach in production is discouraged though - the client has to download the entire library, regardless of which components are actually used, affecting performance and bandwidth utilization.
Please elaborate steps to do the same.
Im sorry if that's too simple, but I managed to do it reading this article:
https://towardsdatascience.com/build-deploy-a-react-flask-app-47a89a5d17d9
I use the framework Flask, but if you are using Django the process must be similar.
But I recomend building a API with python and communicate with the front-end through the fecth API from javascript, or axios on react. You'll even be able to work on the frontend and backend in two different servers if you want.

How to use Firebase with a linux based client app for bidirectional messages communication with server

I've seen Google's documentation and a lot of examples over the internet about how to use Firebase within Android / iOS applications, but I want to develop a client Firebase application which runs on a linux machine.
My requirements are:
Client runs on linux environment (either writtern in C++ or python).
Server is written in Javascript (NodeJS).
Server and client should have bi-directional communication between them using firebase realtime database.
I've seen also the firebase REST api, but I assume that is not good enough for me since I haven't seen a client listener api that listens on a something like onValueChanged.
Question:
How can I implement a linux-based app in C++ or python that listens to messages from server (data changes) using a listener, without having to call some get function each and every few seconds (just like NodeJS have the ref.on("child_changed",...) or ref.on("value",...)?
Help is much appreciated!
Unfortunately there is not official library for Realtime Database in Python but there are some third party wrappers around REST API.
Specifically I would look at Pyrebase library which also supports listening to live changes https://github.com/thisbejim/Pyrebase#streaming
For more information, libraries or other languages look at this page https://firebase.google.com/docs/database/rest/start
Google offers a C++ SDK you can download it here.
There is also a tutorial on the bottom of the page, but if you really want to dig into some code, here is the quickstart code on github from google with examples for each category on Firebase.
Google has also implemented a Game for demonstration purposes in C++ for Desktop OSs. here There you can find more advanced features and code samples.
I have only tried it with an XCode project on Mac OS X, and it works fine. I have no code for real time database but you should find the sample project in the github repo. https://github.com/firebase/quickstart-cpp
I hope this helps!
Greetings.
Haven't you try to use a Realtime Database triggers for C++ (that's is currently on beta) that allows you to simulate the same workflow as on JS?
From my point of view, it is the best way to get it to work as you want.
https://firebase.google.com/docs/functions/database-events

What Google app engine Auth to use to only expose my "intranet" site only to my GSuite users?

I am pretty new Google app engine, and though I have hacked around with alot of languages, I am finding the google documentation a little overwhelming. I have successfully launched a static site, and successfully run some python code from the console. But I have not run any python from my static site.
I am a Small company trying to setup a google app engine static/dynamic website that I only want to expose to my Gsuite users.
I have some python code I want to run on my app engine, which will download a file from gdrive/teamdrive, process the file, create a new file from the results and then upload the resulting file to the same folder.
I may also at a later date have this static/dynamic website also interfacing with Cloud SQL(mysql) or an external database.
my Questions
What authentication method to use to only expose this website to my gsuite users?
Though I have worked through some of the GDrive api examples whats the best and easiest method of passing GDrive text files to my python code? (though I have hacked around with python lots in the past, the html and python combination perplexes me)
Thanks!
You would use OAuth2.0 to acquire a token which you can then use to interact with that user's files through the GDrive API (see "About Authorization" as well as this quickstart Python example).

Command line user interface instead of web-based interface for django?

I have built a web platform with Django. Users with Staff status can log into Django-admin through their web browsers and add, remove or alter different objects, upload files, etc.
Now I want to build a command line tool to enable users to do these tasks via command line. The users need to authenticate in command line, and then use different commands to perform their target operation.
Think a command line git client to github.
Of course it's possible to authenticate and send form data using request or cURL. But is there any standard, better way of doing this? Is there any utility/library for this, maybe a Django/python one?
This looks like a '2-component' thing.
API
You will have to expose the desired functionality via an (RESTful) API.
Two common and very good libraries are tastypie and Django REST Framework.
They help you building APIs in a fast and flexible way - think about it as 'Django admin' for APIs.
Client
For request handling I would suggest to have a look at the python-requests library.
PS:
If you're interested - we did build a (quick, ugly, dirty & buggy) python client that interacts with our Django based service platform. You can find it on GitHub

Categories