Skip to content

Conversation

@CHRISCARLON
Copy link
Contributor

@CHRISCARLON CHRISCARLON commented Dec 31, 2025

I often write a lot of custom async code to interact with the OS Datahub APIs.

A few projects are on my todo list in the future where I'll need async functionality (both personal and at work at GeoPlace).

Rather than write my own async library, I thought that I would start a rough async implementation of the osdatahub NGD module - as I have colleagues that use this too.

I do have some ideas for the other modules as well though - like downloading things from the DownloadsAPI in parallel.

Please let me know what you think!

I've not strayed too far from the current ngd_api in terms of the overall structure - let me know if you think I have.

I've added:

  • A generic AsyncAPI client + rate limiter
  • An async implementation of the NGD module
  • Suggested a new FeatureCollection return type in models.py for the NGD module
  • Slightly tweaked the _merge_all_geojsons function in the async implementation as I wasn't too sure about calling .copy() each time.

I'll mark this ready for review once I've added a few more unit tests and done some trial runs with it - as it's a first pass for now.

TODO:

  • Add more unit tests
  • Conduct trial runs locally
  • Add in calls to osdatahub.get_proxies() (I store the proxies once on client creation instead of calling get_proxies() for every request).

Chris

@mhill-os
Copy link

mhill-os commented Dec 31, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mhill-os
Copy link

mhill-os commented Dec 31, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@CHRISCARLON CHRISCARLON changed the title First commit for async ngd client New Feature: Async Client Dec 31, 2025
@CHRISCARLON CHRISCARLON marked this pull request as ready for review January 1, 2026 22:29
@jmbraybrook
Copy link
Collaborator

Hi @CHRISCARLON ,

Just passing my thanks for contributing this and to acknowledge I've seen this.
Will take a look over the coming days and if all is well aim to get this feature incorporated.

Kind Regards
Joseph

@CHRISCARLON
Copy link
Contributor Author

Hi @CHRISCARLON ,

Just passing my thanks for contributing this and to acknowledge I've seen this. Will take a look over the coming days and if all is well aim to get this feature incorporated.

Kind Regards Joseph

Hi @jmbraybrook,

No worries!

I added a couple of dependencies to the requirements.txt file as that seemed to be why the tests were failing in the action: https://github.com/OrdnanceSurvey/osdatahub/actions/runs/20646710797

Chris

@jmbraybrook jmbraybrook changed the base branch from master to async_new_feature_request January 12, 2026 13:52
@jmbraybrook jmbraybrook changed the base branch from async_new_feature_request to async_ngd_client January 12, 2026 13:57
@jmbraybrook jmbraybrook merged commit 8f7c63f into OrdnanceSurvey:async_ngd_client Jan 12, 2026
4 checks passed
@jmbraybrook
Copy link
Collaborator

Hi @CHRISCARLON , can confirm we will be including this feature - will be merging onto its own branch so I can run the required tests and checks but should be good to proceed from there. Will CC you into a subsequent pull request once that's done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants