osdatahub


Nameosdatahub JSON
Version 1.2.10 PyPI version JSON
download
home_pagehttps://github.com/OrdnanceSurvey/osdatahub
Summaryosdatahub is Ordnance Survey's (OS) Python API wrapper, designed to make data from the OS Data Hub APIs readily accessible to developers.
upload_time2024-04-23 11:17:44
maintainerNone
docs_urlNone
authorOS Rapid Prototyping
requires_python>=3.7
licenseOGL
keywords ordnance-survey gis united-kingdom
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # osdatahub <!-- omit in toc -->


> ⚠ **Important Notice**:
> 
> - This Python package is no longer actively maintained and will not receive updates.
> - It may become incompatible with future [OS Data Hub APIs](https://osdatahub.os.uk/).


[![GitHub issues](https://img.shields.io/github/issues/OrdnanceSurvey/osdatahub)](https://github.com/OrdnanceSurvey/osdatahub/issues)
[![Python package](https://github.com/OrdnanceSurvey/osdatahub/actions/workflows/python-package.yml/badge.svg)](https://github.com/OrdnanceSurvey/osdatahub/actions/workflows/python-package.yml)
<a href="https://codeclimate.com/github/dchirst/osdatahub/maintainability"><img src="https://api.codeclimate.com/v1/badges/471fd53dbb22e9e28546/maintainability" /></a>


`osdatahub` is a python package from Ordnance Survey (OS) that makes it easier to interact with OS data via
the [OS Data Hub APIs](https://osdatahub.os.uk/).

OS is the national mapping agency for Great Britain and produces a large variety of mapping
and geospatial products. Much of OS's data is available via the [OS Data Hub](https://osdatahub.os.uk/), a platform
that hosts both free and premium data products. `osdatahub` provides a user-friendly way to interact with these data
products
in Python. To see what data is available, you can use
the [OS Data Hub Explorer](https://labs.os.uk/public/data-hub-explorer/).

![The OS Logo](https://github.com/OrdnanceSurvey/osdatahub/blob/master/media/os-logo.png)

## Features <!-- omit in toc -->

- Get access to Ordnance Survey data in as few as 2-3 lines of code
- Easily query geographic extents using bounding boxes, radii and ONS geographies
- Request as much data as you need with automatic API paging
- Supports the OS Features, Places, Names, Linked Identifiers, and Downloads APIs

## Links <!-- omit in toc -->

- GitHub repo: https://github.com/OrdnanceSurvey/osdatahub
- Documentation: https://osdatahub.readthedocs.io/en/latest/
- PyPI: https://pypi.org/project/osdatahub/
- conda-forge:  https://anaconda.org/conda-forge/osdatahub
- Data Hub Explorer: https://labs.os.uk/prototyping/data-hub-explorer/
- Free Software: Open Government License

## Contents <!-- omit in toc -->

- [Setup](#setup)
- [Quick Start](#quick-start)
  - [NGD API](#ngd-api)
  - [Features API](#features-api)
  - [Places API](#places-api)
  - [Names API](#names-api)
  - [Linked Identifiers API](#linked-identifiers-api)
  - [Downloads API](#downloads-api)
- [Tutorials](#tutorials)
- [Proxies](#proxies)
- [Contribute](#contribute)
  - [Support](#support)


# Setup

`osdatahub` is available on [PyPI](https://pypi.org/project/osdatahub/). To install `osdatahub`, run this command in
your terminal:

```bash
pip install osdatahub
```

The library is also available to download via [conda](https://anaconda.org/conda-forge/osdatahub):

```bash
conda install -c conda-forge osdatahub
```

You'll also need to sign-up for an account on the [OS Data Hub](https://osdatahub.os.uk/) and get an API key. If you've
setup you're account and need help getting a key, try the
following steps:

1. Navigate to the **API Dashboard** located on the top navigation bar
2. Go to **My Projects**
3. Click **Create a new project**, give your project a name, then click **Create project**
4. Select **Add an API to this project**
5. Choose the APIs you would like to use and click **Done** (Note: osdatahub supports 
   the OS Features, Places, Names, Linked Identifiers, and Downloads APIs)


# Quick Start
## NGD API

Ordnance Survey's newest API replaces the Features API with extra functionality, better error handling, and an
OGC-compliant
GeoJSON return type. Currently, the NGD supports topographic features, with Places being added soon.

We can use the NGD API by importing the **NGD** class (which helps us run queries):

```python
from osdatahub import NGD
```

Then we need to get our [OS API key](https://osdatahub.os.uk/) and store it as a variable ([find out how to
do this securely with environment variables](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Setting%20up%20an%20API%20key.ipynb)):

```python
key = "[YOUR KEY GOES HERE]"
```

Next, we must decide which NGD Collection we are interested in. We can discover the available collection ids in 2 ways:

1. Browse the [OS Data Hub Technical Documentation](https://osdatahub.os.uk/docs/ofa/technicalSpecification)
2. Run the `get_collections()` function:

```python
NGD.get_collections()
```

Then we can instantiate the NGD class, ready for us to query:

```python
collection = "bld-fts-buildingline"
ngd = NGD(key, collection)
results = ngd.query(max_results=50)
```

The `query()` function supports many different options and filters, such as various output CRS', CQL filters, and
start and end times for temporal features.

The data stored in the results variable will be in geojson format, limited to
50 features. To save the query results as a geojson file, you need to import
the [geojson module](https://github.com/jazzband/geojson) and use the `.dump() `
function:

```python
import geojson

geojson.dump(results, open("FILENAME.geojson", "w"))
```

If you have the ID of a specific feature you would like to query, you can use the `query_feature()` function instead:

```python
feature_id = "0000013e-5fed-447d-a627-dae6fb215138"
feature = ngd.query_feature(feature_id)
```

## Features API

Data can be queried within a geographical extent in just a few simple steps!

First, we need to import the **FeaturesAPI** class (which helps us runs queries) and 
the **Extent** class (which helps us to define a target region):

```python
from osdatahub import FeaturesAPI, Extent
```

Then we need to get our [OS API key](https://osdatahub.os.uk/) and store it as a variable ([find out how to 
do this securely with environment variables](https://github.com/OrdnanceSurvey/osdatahub/blob/modify-links/Examples/Setting%20up%20an%20API%20key.ipynb)):

```python
key = "[YOUR KEY GOES HERE]"
```

Next, we define our geographic extent. For this example we're going use a 
bounding box, but it is also possible to specify radial extents, ONS 
geographies and custom polygons.

These bounding box coordinates are BNG coordinates in the order 
(West, South, East, North):

```python
extent = Extent.from_bbox((600000, 310200, 600900, 310900), "EPSG:27700")
```

And now we can run our query! We just have to assemble the parts and decide 
which OS Features product we want to explore. In this case, we're going to 
choose "zoomstack_local_buildings" — an open data set of Great Britain's 
local buildings:

```python
product = "zoomstack_local_buildings"
features = FeaturesAPI(key, product, extent)
results = features.query(limit=50)
```

The data stored in the results variable will be in geojson format, limited to 
50 features. To save the query results as a geojson file, you need to import 
the [geojson module](https://github.com/jazzband/geojson) and use the .dump() 
function:

```python
import geojson

geojson.dump(results, open("FILENAME.geojson", "w"))
```

Putting this all together, we get:

```python
from osdatahub import FeaturesAPI, Extent
import geojson

key = "[YOUR KEY GOES HERE]"
extent = Extent.from_bbox((600000, 310200, 600900, 310900), "EPSG:27700")
product = "zoomstack_local_buildings"
features = FeaturesAPI(key, product, extent)
results = features.query(limit=50)

geojson.dump(results, open("FILENAME.geojson", "w"))
```
## Places API

To run a similar query using the OS Places API, we just need to make two changes. 
First, we no longer need to decide on a product — the Places API is always 
going to give us addresses! Secondly, the **PlacesAPI** class does not require 
an extent (because there are other, non-geographic, queries available). 
Therefore, our bounding box extent does not need to be passed in until the 
query is run.

The final result looks like this:

```python
from osdatahub import PlacesAPI, Extent
import geojson

key = "[YOUR KEY GOES HERE]"
extent = Extent.from_bbox((600000, 310200, 600900, 310900), "EPSG:27700")
places = PlacesAPI(key) # No extent or product is given to PlacesAPI
results = places.query(extent, limit=50) # Extent is passed directly into the .query() function

geojson.dump(results, open("FILENAME.geojson", "w"))
```
Note: The PlacesAPI requires a *premium* API key!


## Names API

The OS Data Hub also contains the OS Names API, which is a geographic directory containing basic information about 
identifiable places. The API allows us to identify places by their address/place name and can find the nearest 
address to a given point. 

The **NamesAPI** class is very similar to **PlacesAPI** as it needs only a (**premium**) API key. We can then query
the object with a place name to get more information:

```python
from osdatahub import NamesAPI

key = "[YOUR KEY GOES HERE]"

names = NamesAPI(key) # only a premium key is required to create a NamesAPI object
results = names.find("Buckingham Palace", limit=5)

geojson.dump(results, open("FILENAME.geojson", "w"))
```

Note: The NamesAPI requires a *premium* API key!

## Linked Identifiers API

The [OS Linked Identifiers API](https://osdatahub.os.uk/docs/linkedIdentifiers/overview) allows you to access the valuable relationships between properties, streets and OS MasterMap identifiers for free. It's as easy as providing the identifier you are interested in and the API will return the related feature identifiers. This allows you to find what addresses exist on a given street, or the UPRN for a building on a map, or the USRN for a road and more.

You can access the Linked Identifiers API via the **LinkedIdentifiersAPI** class. 
In it's simplest form, queries can be made using just an API key and an identifier:

```python
from osdatahub import LinkedIdentifiersAPI

key = "[YOUR KEY GOES HERE]"
linked_ids = LinkedIdentifiersAPI(key)
results = linked_ids.query(200001025758)
```

## Downloads API

If you'd like to download an entire dataset instead of querying the API on demand, the OS Data Hub has the 
[Downloads API](https://osdatahub.os.uk/docs/downloads/technicalSpecification). This API allows you to search,m explore, and download both [Open Data Products](https://osdatahub.os.uk/downloads/open) (e.g. OS Open Rivers, Boundary-Line, and a 1:250,000 scale 
colour raster of Great Britain) and Premium Data Packages using Python.

It is possible to download Open Data products without an API key, but the Premium Data Packages require you to have
a premium API key and order the package you want to download on the [OS Data Hub website](https://osdatahub.os.uk/downloads/).

The first step to download data is to discover which products are available. You can see the available datasets on the
[OS Data Hub website](https://osdatahub.os.uk/downloads/) or using the following snippet of code:

```python
from osdatahub import OpenDataDownload

OpenDataDownload.all_products()
```

You can also see all Premium Data Packages available to download using your premium API key:

```python
from osdatahub import DataPackageDownload

key = "[YOUR KEY GOES HERE]"
DataPackageDownload.all_products(key)
```
Note: For Premium Data Packages, this query will only return datasets if you have previously *ordered* the dataset on the OS Data Hub
Website.

Once you have found a package you'd like to download, you can get a list of the different products you can download:

```python
greenspace = OpenDataDownload("OpenGreenspace")
greenspace.product_list()
```

Once you know the dataset and specific product you'd like to download, you can download the dataset locally:

```python
greenspace.download(file_name='opgrsp_essh_nj.zip')
```


# Tutorials

Example notebooks, demonstrating various `osdatahub` features can be found in 
the Examples folder. Here is a list of the available content:

- [Setting up an API Key](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Setting%20up%20an%20API%20key.ipynb)
- [Defining Extents](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Defining%20Extents%20for%20API%20Queries.ipynb)
- [Filtering Attributes](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Filtering%20Attributes%20for%20API%20Queries.ipynb)
- [Plotting Query Results - GeoPandas, Matplotlib, Contextily](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Plotting%20API%20Results%20-%20GeoPandas%2C%20Matplotlib%20and%20Contextily.ipynb)
- [Interactive Plotting for Query Results](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Interactive%20Plotting%20for%20API%20Results%20-%20Folium.ipynb)
- [Converting Query Results into Common Formats](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Converting%20API%20Results%20into%20Common%20Data%20Formats.ipynb)
- [Post Processing Query Results](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Post%20Processing%20API%20Queries.ipynb)
- [Common CRS Pitfalls](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/CRS%20pitfalls.ipynb)


# Proxies

To set proxies, use the `set_proxies` method from `osdatahub`. This should look something like:

```python
import osdatahub

osdatahub.set_proxies({"http": "http://ip:port", "https": "https://ip:port"})
```

and will apply to all the osdatahub api requests.


# Contribute

This package is still under active developement and we welcome contributions from the community via issues and pull requests.

To install osdatahub, along with the tools you need to develop and run tests, 
run the following in your environment:

```bash
pip install -e .[dev]
```

## Support

For any kind of issues or suggestions please see the [**documentation**](https://osdatahub.readthedocs.io/en/latest/), open a **[github issue](https://github.com/OrdnanceSurvey/osdatahub/issues)** or contact us via Email **[rapidprototyping@os.uk](mailto:rapidprototyping@os.uk)**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OrdnanceSurvey/osdatahub",
    "name": "osdatahub",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "Ordnance-Survey, GIS, united-kingdom",
    "author": "OS Rapid Prototyping",
    "author_email": "rapidprototyping@os.uk",
    "download_url": "https://files.pythonhosted.org/packages/06/ed/7eaa7cc8d3af595ae522e19aacedf686fd6afa3a96a2232bb920d89df20e/osdatahub-1.2.10.tar.gz",
    "platform": null,
    "description": "# osdatahub <!-- omit in toc -->\n\n\n> \u26a0 **Important Notice**:\n> \n> - This Python package is no longer actively maintained and will not receive updates.\n> - It may become incompatible with future [OS Data Hub APIs](https://osdatahub.os.uk/).\n\n\n[![GitHub issues](https://img.shields.io/github/issues/OrdnanceSurvey/osdatahub)](https://github.com/OrdnanceSurvey/osdatahub/issues)\n[![Python package](https://github.com/OrdnanceSurvey/osdatahub/actions/workflows/python-package.yml/badge.svg)](https://github.com/OrdnanceSurvey/osdatahub/actions/workflows/python-package.yml)\n<a href=\"https://codeclimate.com/github/dchirst/osdatahub/maintainability\"><img src=\"https://api.codeclimate.com/v1/badges/471fd53dbb22e9e28546/maintainability\" /></a>\n\n\n`osdatahub` is a python package from Ordnance Survey (OS) that makes it easier to interact with OS data via\nthe [OS Data Hub APIs](https://osdatahub.os.uk/).\n\nOS is the national mapping agency for Great Britain and produces a large variety of mapping\nand geospatial products. Much of OS's data is available via the [OS Data Hub](https://osdatahub.os.uk/), a platform\nthat hosts both free and premium data products. `osdatahub` provides a user-friendly way to interact with these data\nproducts\nin Python. To see what data is available, you can use\nthe [OS Data Hub Explorer](https://labs.os.uk/public/data-hub-explorer/).\n\n![The OS Logo](https://github.com/OrdnanceSurvey/osdatahub/blob/master/media/os-logo.png)\n\n## Features <!-- omit in toc -->\n\n- Get access to Ordnance Survey data in as few as 2-3 lines of code\n- Easily query geographic extents using bounding boxes, radii and ONS geographies\n- Request as much data as you need with automatic API paging\n- Supports the OS Features, Places, Names, Linked Identifiers, and Downloads APIs\n\n## Links <!-- omit in toc -->\n\n- GitHub repo: https://github.com/OrdnanceSurvey/osdatahub\n- Documentation: https://osdatahub.readthedocs.io/en/latest/\n- PyPI: https://pypi.org/project/osdatahub/\n- conda-forge:  https://anaconda.org/conda-forge/osdatahub\n- Data Hub Explorer: https://labs.os.uk/prototyping/data-hub-explorer/\n- Free Software: Open Government License\n\n## Contents <!-- omit in toc -->\n\n- [Setup](#setup)\n- [Quick Start](#quick-start)\n  - [NGD API](#ngd-api)\n  - [Features API](#features-api)\n  - [Places API](#places-api)\n  - [Names API](#names-api)\n  - [Linked Identifiers API](#linked-identifiers-api)\n  - [Downloads API](#downloads-api)\n- [Tutorials](#tutorials)\n- [Proxies](#proxies)\n- [Contribute](#contribute)\n  - [Support](#support)\n\n\n# Setup\n\n`osdatahub` is available on [PyPI](https://pypi.org/project/osdatahub/). To install `osdatahub`, run this command in\nyour terminal:\n\n```bash\npip install osdatahub\n```\n\nThe library is also available to download via [conda](https://anaconda.org/conda-forge/osdatahub):\n\n```bash\nconda install -c conda-forge osdatahub\n```\n\nYou'll also need to sign-up for an account on the [OS Data Hub](https://osdatahub.os.uk/) and get an API key. If you've\nsetup you're account and need help getting a key, try the\nfollowing steps:\n\n1. Navigate to the **API Dashboard** located on the top navigation bar\n2. Go to **My Projects**\n3. Click **Create a new project**, give your project a name, then click **Create project**\n4. Select **Add an API to this project**\n5. Choose the APIs you would like to use and click **Done** (Note: osdatahub supports \n   the OS Features, Places, Names, Linked Identifiers, and Downloads APIs)\n\n\n# Quick Start\n## NGD API\n\nOrdnance Survey's newest API replaces the Features API with extra functionality, better error handling, and an\nOGC-compliant\nGeoJSON return type. Currently, the NGD supports topographic features, with Places being added soon.\n\nWe can use the NGD API by importing the **NGD** class (which helps us run queries):\n\n```python\nfrom osdatahub import NGD\n```\n\nThen we need to get our [OS API key](https://osdatahub.os.uk/) and store it as a variable ([find out how to\ndo this securely with environment variables](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Setting%20up%20an%20API%20key.ipynb)):\n\n```python\nkey = \"[YOUR KEY GOES HERE]\"\n```\n\nNext, we must decide which NGD Collection we are interested in. We can discover the available collection ids in 2 ways:\n\n1. Browse the [OS Data Hub Technical Documentation](https://osdatahub.os.uk/docs/ofa/technicalSpecification)\n2. Run the `get_collections()` function:\n\n```python\nNGD.get_collections()\n```\n\nThen we can instantiate the NGD class, ready for us to query:\n\n```python\ncollection = \"bld-fts-buildingline\"\nngd = NGD(key, collection)\nresults = ngd.query(max_results=50)\n```\n\nThe `query()` function supports many different options and filters, such as various output CRS', CQL filters, and\nstart and end times for temporal features.\n\nThe data stored in the results variable will be in geojson format, limited to\n50 features. To save the query results as a geojson file, you need to import\nthe [geojson module](https://github.com/jazzband/geojson) and use the `.dump() `\nfunction:\n\n```python\nimport geojson\n\ngeojson.dump(results, open(\"FILENAME.geojson\", \"w\"))\n```\n\nIf you have the ID of a specific feature you would like to query, you can use the `query_feature()` function instead:\n\n```python\nfeature_id = \"0000013e-5fed-447d-a627-dae6fb215138\"\nfeature = ngd.query_feature(feature_id)\n```\n\n## Features API\n\nData can be queried within a geographical extent in just a few simple steps!\n\nFirst, we need to import the **FeaturesAPI** class (which helps us runs queries) and \nthe **Extent** class (which helps us to define a target region):\n\n```python\nfrom osdatahub import FeaturesAPI, Extent\n```\n\nThen we need to get our [OS API key](https://osdatahub.os.uk/) and store it as a variable ([find out how to \ndo this securely with environment variables](https://github.com/OrdnanceSurvey/osdatahub/blob/modify-links/Examples/Setting%20up%20an%20API%20key.ipynb)):\n\n```python\nkey = \"[YOUR KEY GOES HERE]\"\n```\n\nNext, we define our geographic extent. For this example we're going use a \nbounding box, but it is also possible to specify radial extents, ONS \ngeographies and custom polygons.\n\nThese bounding box coordinates are BNG coordinates in the order \n(West, South, East, North):\n\n```python\nextent = Extent.from_bbox((600000, 310200, 600900, 310900), \"EPSG:27700\")\n```\n\nAnd now we can run our query! We just have to assemble the parts and decide \nwhich OS Features product we want to explore. In this case, we're going to \nchoose \"zoomstack_local_buildings\" \u2014 an open data set of Great Britain's \nlocal buildings:\n\n```python\nproduct = \"zoomstack_local_buildings\"\nfeatures = FeaturesAPI(key, product, extent)\nresults = features.query(limit=50)\n```\n\nThe data stored in the results variable will be in geojson format, limited to \n50 features. To save the query results as a geojson file, you need to import \nthe [geojson module](https://github.com/jazzband/geojson) and use the .dump() \nfunction:\n\n```python\nimport geojson\n\ngeojson.dump(results, open(\"FILENAME.geojson\", \"w\"))\n```\n\nPutting this all together, we get:\n\n```python\nfrom osdatahub import FeaturesAPI, Extent\nimport geojson\n\nkey = \"[YOUR KEY GOES HERE]\"\nextent = Extent.from_bbox((600000, 310200, 600900, 310900), \"EPSG:27700\")\nproduct = \"zoomstack_local_buildings\"\nfeatures = FeaturesAPI(key, product, extent)\nresults = features.query(limit=50)\n\ngeojson.dump(results, open(\"FILENAME.geojson\", \"w\"))\n```\n## Places API\n\nTo run a similar query using the OS Places API, we just need to make two changes. \nFirst, we no longer need to decide on a product \u2014 the Places API is always \ngoing to give us addresses! Secondly, the **PlacesAPI** class does not require \nan extent (because there are other, non-geographic, queries available). \nTherefore, our bounding box extent does not need to be passed in until the \nquery is run.\n\nThe final result looks like this:\n\n```python\nfrom osdatahub import PlacesAPI, Extent\nimport geojson\n\nkey = \"[YOUR KEY GOES HERE]\"\nextent = Extent.from_bbox((600000, 310200, 600900, 310900), \"EPSG:27700\")\nplaces = PlacesAPI(key) # No extent or product is given to PlacesAPI\nresults = places.query(extent, limit=50) # Extent is passed directly into the .query() function\n\ngeojson.dump(results, open(\"FILENAME.geojson\", \"w\"))\n```\nNote: The PlacesAPI requires a *premium* API key!\n\n\n## Names API\n\nThe OS Data Hub also contains the OS Names API, which is a geographic directory containing basic information about \nidentifiable places. The API allows us to identify places by their address/place name and can find the nearest \naddress to a given point. \n\nThe **NamesAPI** class is very similar to **PlacesAPI** as it needs only a (**premium**) API key. We can then query\nthe object with a place name to get more information:\n\n```python\nfrom osdatahub import NamesAPI\n\nkey = \"[YOUR KEY GOES HERE]\"\n\nnames = NamesAPI(key) # only a premium key is required to create a NamesAPI object\nresults = names.find(\"Buckingham Palace\", limit=5)\n\ngeojson.dump(results, open(\"FILENAME.geojson\", \"w\"))\n```\n\nNote: The NamesAPI requires a *premium* API key!\n\n## Linked Identifiers API\n\nThe [OS Linked Identifiers API](https://osdatahub.os.uk/docs/linkedIdentifiers/overview) allows you to access the valuable relationships between properties, streets and OS MasterMap identifiers for free. It's as easy as providing the identifier you are interested in and the API will return the related feature identifiers. This allows you to find what addresses exist on a given street, or the UPRN for a building on a map, or the USRN for a road and more.\n\nYou can access the Linked Identifiers API via the **LinkedIdentifiersAPI** class. \nIn it's simplest form, queries can be made using just an API key and an identifier:\n\n```python\nfrom osdatahub import LinkedIdentifiersAPI\n\nkey = \"[YOUR KEY GOES HERE]\"\nlinked_ids = LinkedIdentifiersAPI(key)\nresults = linked_ids.query(200001025758)\n```\n\n## Downloads API\n\nIf you'd like to download an entire dataset instead of querying the API on demand, the OS Data Hub has the \n[Downloads API](https://osdatahub.os.uk/docs/downloads/technicalSpecification). This API allows you to search,m explore, and download both [Open Data Products](https://osdatahub.os.uk/downloads/open) (e.g. OS Open Rivers, Boundary-Line, and a 1:250,000 scale \ncolour raster of Great Britain) and Premium Data Packages using Python.\n\nIt is possible to download Open Data products without an API key, but the Premium Data Packages require you to have\na premium API key and order the package you want to download on the [OS Data Hub website](https://osdatahub.os.uk/downloads/).\n\nThe first step to download data is to discover which products are available. You can see the available datasets on the\n[OS Data Hub website](https://osdatahub.os.uk/downloads/) or using the following snippet of code:\n\n```python\nfrom osdatahub import OpenDataDownload\n\nOpenDataDownload.all_products()\n```\n\nYou can also see all Premium Data Packages available to download using your premium API key:\n\n```python\nfrom osdatahub import DataPackageDownload\n\nkey = \"[YOUR KEY GOES HERE]\"\nDataPackageDownload.all_products(key)\n```\nNote: For Premium Data Packages, this query will only return datasets if you have previously *ordered* the dataset on the OS Data Hub\nWebsite.\n\nOnce you have found a package you'd like to download, you can get a list of the different products you can download:\n\n```python\ngreenspace = OpenDataDownload(\"OpenGreenspace\")\ngreenspace.product_list()\n```\n\nOnce you know the dataset and specific product you'd like to download, you can download the dataset locally:\n\n```python\ngreenspace.download(file_name='opgrsp_essh_nj.zip')\n```\n\n\n# Tutorials\n\nExample notebooks, demonstrating various `osdatahub` features can be found in \nthe Examples folder. Here is a list of the available content:\n\n- [Setting up an API Key](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Setting%20up%20an%20API%20key.ipynb)\n- [Defining Extents](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Defining%20Extents%20for%20API%20Queries.ipynb)\n- [Filtering Attributes](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Filtering%20Attributes%20for%20API%20Queries.ipynb)\n- [Plotting Query Results - GeoPandas, Matplotlib, Contextily](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Plotting%20API%20Results%20-%20GeoPandas%2C%20Matplotlib%20and%20Contextily.ipynb)\n- [Interactive Plotting for Query Results](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Interactive%20Plotting%20for%20API%20Results%20-%20Folium.ipynb)\n- [Converting Query Results into Common Formats](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Converting%20API%20Results%20into%20Common%20Data%20Formats.ipynb)\n- [Post Processing Query Results](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/Post%20Processing%20API%20Queries.ipynb)\n- [Common CRS Pitfalls](https://github.com/OrdnanceSurvey/osdatahub/blob/master/Examples/CRS%20pitfalls.ipynb)\n\n\n# Proxies\n\nTo set proxies, use the `set_proxies` method from `osdatahub`. This should look something like:\n\n```python\nimport osdatahub\n\nosdatahub.set_proxies({\"http\": \"http://ip:port\", \"https\": \"https://ip:port\"})\n```\n\nand will apply to all the osdatahub api requests.\n\n\n# Contribute\n\nThis package is still under active developement and we welcome contributions from the community via issues and pull requests.\n\nTo install osdatahub, along with the tools you need to develop and run tests, \nrun the following in your environment:\n\n```bash\npip install -e .[dev]\n```\n\n## Support\n\nFor any kind of issues or suggestions please see the [**documentation**](https://osdatahub.readthedocs.io/en/latest/), open a **[github issue](https://github.com/OrdnanceSurvey/osdatahub/issues)** or contact us via Email **[rapidprototyping@os.uk](mailto:rapidprototyping@os.uk)**\n",
    "bugtrack_url": null,
    "license": "OGL",
    "summary": "osdatahub is Ordnance Survey's (OS) Python API wrapper, designed to make data from the OS Data Hub APIs readily accessible to developers.",
    "version": "1.2.10",
    "project_urls": {
        "Code": "https://github.com/OrdnanceSurvey/osdatahub",
        "Documentation": "https://osdatahub.readthedocs.io/en/latest/",
        "Download": "https://pypi.org/project/osdatahub/",
        "Homepage": "https://github.com/OrdnanceSurvey/osdatahub",
        "Issues": "https://github.com/OrdnanceSurvey/osdatahub/issues"
    },
    "split_keywords": [
        "ordnance-survey",
        " gis",
        " united-kingdom"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0b30ab1a4895af3cf80d28f804ecb081730553a3e5df25ba1d4428448a09920",
                "md5": "8610d08ae74a7135268489e0f2acf33b",
                "sha256": "07d4a1d07cbf86212bdc8918330ec072bfdd4d3c3e7617c4b3d97ec865c24d61"
            },
            "downloads": -1,
            "filename": "osdatahub-1.2.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8610d08ae74a7135268489e0f2acf33b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 50886,
            "upload_time": "2024-04-23T11:17:42",
            "upload_time_iso_8601": "2024-04-23T11:17:42.180094Z",
            "url": "https://files.pythonhosted.org/packages/b0/b3/0ab1a4895af3cf80d28f804ecb081730553a3e5df25ba1d4428448a09920/osdatahub-1.2.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06ed7eaa7cc8d3af595ae522e19aacedf686fd6afa3a96a2232bb920d89df20e",
                "md5": "e7e4b2206d42ad71a0434f0daf2634d9",
                "sha256": "f18d20408eb78235bc8f11c091eaaefa188e80c795abd68c9720f8d0abbedb38"
            },
            "downloads": -1,
            "filename": "osdatahub-1.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "e7e4b2206d42ad71a0434f0daf2634d9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8572718,
            "upload_time": "2024-04-23T11:17:44",
            "upload_time_iso_8601": "2024-04-23T11:17:44.425929Z",
            "url": "https://files.pythonhosted.org/packages/06/ed/7eaa7cc8d3af595ae522e19aacedf686fd6afa3a96a2232bb920d89df20e/osdatahub-1.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-23 11:17:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OrdnanceSurvey",
    "github_project": "osdatahub",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "osdatahub"
}
        
Elapsed time: 0.26871s