Does anyone know a source from which to download vector UK Ordnance Survey grids at varying resolutions? Or failing that, a tool that can create an OS grid at a specified resolution? There are plenty of ways to generate a vector grid, but I've found no way of populating the attributes with OS grid references.
The 'National Grid Shape file' can be downloaded at: https://github.com/charlesroper/OSGB_Grids
Using this for a OS grid at a specific resolution would take some aggregation based on the TILE field, or by using the SCALE field.
One alternative may be to populate the attributes yourself?
Provided that your generated grids are polygons rather than lines, you could use Easting and Northing figures to populate a field for each object.
There will obviously be some conversion of the numeric grid references to the OS Grid Ref, however there are plenty of example scripts out there to work from: