{"id":28665320,"url":"https://github.com/dgac/nawalny","last_synced_at":"2025-06-13T13:38:26.035Z","repository":{"id":296164261,"uuid":"991839452","full_name":"DGAC/nawalny","owner":"DGAC","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-29T08:16:05.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-29T09:28:36.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DGAC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T08:18:43.000Z","updated_at":"2025-05-29T08:16:08.000Z","dependencies_parsed_at":"2025-06-03T01:47:46.559Z","dependency_job_id":null,"html_url":"https://github.com/DGAC/nawalny","commit_stats":null,"previous_names":["dgac/nawalny"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DGAC/nawalny","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DGAC%2Fnawalny","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DGAC%2Fnawalny/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DGAC%2Fnawalny/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DGAC%2Fnawalny/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DGAC","download_url":"https://codeload.github.com/DGAC/nawalny/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DGAC%2Fnawalny/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259654297,"owners_count":22890989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-13T13:38:23.076Z","updated_at":"2025-06-13T13:38:26.022Z","avatar_url":"https://github.com/DGAC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next AWesome Access Library to NMB2B in pYthon \n\nIn the aviation world, Eurocontrol is a European pluri-state organization with more than 6 decades of expertise in the field of securing, organizing, optimizing civile aviation operations. \n\nThe Network Management Operation Centre is one of the key elements to smooth trafic flows, manage congestion in finding alternative paths in cooperatiion with Air Navigation Service Providers. \nFor 15 years, NMOC has developped NMB2B, a business-to-business online data service. \nIt is strongly advised to learn what NMB2B is all about. \nIt is required to have an account and an access via a certificate to this set of services, \nbefore diving into the use of Nawalny. \n\nSee [www.eurocontrol.int/service/network-manager-business-business-b2b-web-services](https://www.eurocontrol.int/service/network-manager-business-business-b2b-web-services)\n\n# Intend \n\nNawalny is a python framework easing the access to NMB2B api in Soap/Xml - synchronous request/reply mode , and Amqp1.0 - publish / subscribe.  It aims at :\n\n* delivering an easy access to required resources as authentication, via X509 certificate, in all the situation: testing access, connection, request, download of file, coupling r/r and p/s principles ...\n* easing the forging of input parameters to the different set of requests, \n* addressing expert features as requesting alternative backend to the two \"preops\" and \"ops\" environment. \n\n# Prerequisite \n\nThe user will have to obtain a X509 certificate with \"preops\" access to begin with and dipose of \nAPI definition file proposed by Eurocontrol.\nCommonServices_27.0.0.xsd  GeneralinformationServices_27.0.0.xsd GeneralinformationServices_PREOPS_27.0.0.wsdl  in \"27\" are the minimum set of file to bootstrap the mecanism. \nSee (file:INSTALL.txt) to learn how to install nawalny library. \n\n# High level principles \n\nThe Nawalny library takes advantage of Python idioms to be elegant and readable-by-human as far as possible. As a simplistic example this sequence showcases the access to request / reply service.  \nMore than 190 named requests are available through the 6 definitions of interface, so a lot of data services exposed, and to be explored ! \n\n``` \n# create a main object and configure it with wsdl location,version, choice preops/ops, an app name\n# it supposes that you populate a python dict dmconf with your info ... \nonmaccess = NawalnyAccess(\n           dmconf['swsdlpath'], \"myappname\", dmconf['nmapiindex'], dmconf['nmcontext']) \n# configure with credential (X509 cert): cert_key bundled, cert/key, cert/key_cyphered/password\nonmaccess.set_credential(dmconf['nmcertpath'],dmconf['nmkeypath'],dmconf['nmpassword'])\n\n# mount a set of services eg. \"FlightServices\"            \noflightservs =  onmaccess.get_asetofservice(\"FlightServices\") \n\n# fire a Soap/Request with input parameters and get the results  \ndsetofflight = oflightservs('FlightManagementService','queryFlightsByAerodrome',\n                            **dnawalnyparam(suserdef)) \n                            \n``` \nA Facade class - NawalnyPSService - proposes the different methods required to manage Publish/Subscribe \nsubscriptions: create,update,retrieve,delete,pause,resume, ...\n2 methods are devoted to register an object of abstract class NAHandler and then trigger the listening \nprinciple and the callback to the handler. The app - the caller - should subclass NAHandler and create a real instance doing what is intended by the app. \n\n``` \n# create an object NawalnyPSService pointing on an NawalnyAccess object (in charge of credential) \nonmpsservice = NawalnyPSService(onmaccess,\"myappname\")\n\n# create a subscription \ndsubscription =  {'subscription': {\n    'topic' : \"FLIGHT_DATA\",\n    'onBehalfOfUnit' : \"FMPLFFF\",\n    'description' : \"fmplff all\",\n    'messageFilter' : {\n        'includeProposalFlights': True, \n        'flightSet': {\n           'item': [\n               { 'anuIds': { 'item': ['FMPLFFF'] }                 } ] } },\n    'payloadConfiguration':{\n        'concernedUnits': True, \n        'flightFields': {\n            'item': []  #meaning all fields\n            } } } }\ndnmsub1 =  onmpsservice.create(**dsubscription) \nsnmsub1uuid = dnmsub1['data']['subscription']['summary']['uuid'] \nsnmsub1queueName = dnmsub1['data']['subscription']['summary']['queueName'] \n\n# subclass NAHandler \nclass MyHandler(NAHandler):\n    ''' the client class doing something useful with the message '''\n    def on_message(self, event):\n        squeuename = event.link.name\n        if  event.message.content_encoding == 'gzip' :\n            try:\n                smsg = gzip.decompress(event.message.body)\n            except:\n                smsg = \"***error decompressing message ***\"\n        else:\n            smsg = event.message.body \n        print(\"[%s]: %s\" % (squeuename, smsg ))\n\n# new Nawalny handler  \nomyhandler = MyHandler(onmpsservice,sapp,[snmsub1queueName])\nonmpsservice.amqpregister(omyhandler)\n\n# resuming one queue which is now supposed ACTIVE\nlactivequeue = onmpsservice.resume(snmsub1uuid) \n\n# listening incoming messages (forever) and do what the app must do \nonmpsservice.amqprun()\n\n``` \n\n# Other projects \n\nSeveral projects have addressed this topic, especially in Python; we can mention:\n\n*  [nmb2b-soapy] (https://github.com/DGAC/nmb2b-soapy) ;\n*  [pyb2b] (https://github.com/xoolive/pyb2b) ; \n\nBrowsing https://github.com/DGAC/ you will discover software doing the same job in other languages, Php, Javascript, Cobol (no, just kidding) ... \n\n# About the name \n\nNawalnoy was a tiny village near Verdun which was completly devastated during WWI. Its inhabitants, brave and fullish have tried to rebuilt it but without success.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgac%2Fnawalny","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgac%2Fnawalny","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgac%2Fnawalny/lists"}