View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Getting data with the API using Python - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Getting data with the API using Python

More
28 Fév 2022 11:49 #1 by bgenolini
Hello,
I have tetsed a simple way to get data from the API with Python.
I'm working under Windows 10, with Anaconda, Python 3.9.7
This is quick and dirty code I have validated after validating the settings of the server with a colleague of mine.

Cheers

import requests
import pandas as pd

SERVER="your.server.here"
URL=f"http://{SERVER}/api"
MY_AUTH = ('user', 'password')

def GetData(req):
    # Returns a dictionnary structure form the request "req"
    return requests.get(f"{URL}/{req}", auth = MY_AUTH).json()

def GetDataPd(req):
   # Converts into a panda DataFrame
    return pd.DataFrame.from_dict(GetData(req))

if __name__ == '__main__':
   # Get the list of projects and print the names and parent's name of non closed projects
    projs = GetDataPd("Project/all")
    print(projs[projs != 'closed']'name', 'nameProject')
 

Bernard

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.039 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.