Skip to content
forked from xoolive/pyb2b

Python API to EUROCONTROL NM B2B services

License

Notifications You must be signed in to change notification settings

bryelandt/pyb2b

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python API to EUROCONTROL NM B2B services

Installation

poetry install

Get started

Important

You have to own a B2B certificate granted by EUROCONTROL to get access to this data.

You must provide a config file with your key and password to use pyb2b.

[global]
pkcs12_filename = path/to/your/p12/file
pkcs12_password = your_password
mode = OPS/PREOPS
version = 26.0.0

This file must be placed in the user_config_dir.

  • on linux: ~/.config/b2b/b2b.conf
  • on mac: ~/Library/Application Support/b2b/b2b.conf
  • on windows: C:\\Users\\<username>\\AppData\\Local\\<AppAuthor>\\<AppName>

Then you may run a text-user interface:

poetry run b2b

Python interface

The client is also available programmatically (Python):

from pyb2b import b2b

Warning

Documentation is still very limited:

  • Functions are self documented, listed through autocompletion
  • Most functions return a structure with a JSON object fully typed (for autocompletion in modern editors)
  • All functions have an asynchronous version (with the async_ prefix)

Asynchronous functions take a httpx.AsyncClient as a first argument, to be called as follows:

import httpx

from pyb2b import b2b

async with httpx.AsyncClient(verify=b2b.context) as client:
    result = await b2b.async_...(
        client, # and extra arguments
    )

About

Python API to EUROCONTROL NM B2B services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%