Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/content/docs/advanced/rate-limiting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FeedbackForm from '@components/FeedbackForm.astro'
The OpenAQ Python SDK tracks rate limit state automatically using headers
returned by the API. By default, when the rate limit is exhausted the client
will call `time.sleep()` and block until the limit resets before continuing.
This behaviour is controlled by the `auto_wait` parameter on the `OpenAQ` client.
This behavior is controlled by the `auto_wait` parameter on the `OpenAQ` client.

## Automatic rate limiting

Expand All @@ -23,7 +23,7 @@ with OpenAQ(api_key="your-api-key") as client:

## Manual rate limiting

Setting `auto_wait=False` disables the automatic wait behaviour. The client will
Setting `auto_wait=False` disables the automatic wait behavior. The client will
instead raise a `RateLimitError` when the rate limit is exhausted, allowing you
to handle it yourself.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/geospatial-queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import radiusGeoJson from '@data/radius.json';

While the various categorical arguments in the `.list()` method of the Locations
resource allow for diverse filtering options for locating air monitoring
stations (e.g. by country, providers, etc), categorical filtering sometimes fail
stations (e.g. by country, providers, etc), categorical filtering sometimes fails
to capture stations of lower-level administrative groupings, such as city or
district. To address that, the `.list()` method also contains 2 sets of
geospatial features you can use to query for locations spatially:
Expand All @@ -24,7 +24,7 @@ To query for locations within the radius of a point, you will need the
coordinates in WGS84 format (EPSG:4326) of the center point and the radius (in
meters) within which you want to search. The query below is an example of how
you can query locations that are within 10,000 meters from Accra's city center.
The API only support query radius up to 25,0000 meters (25 km.).
The API only supports query radii up to 25,0000 meters (25 km.).

<Map
latitude={5.5583456}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/guides/paging-results.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ A large results set often comes from MeasurementsResponse where the amount of
data is often too large for an exact records count to return reliably within a
short time. In this case, `meta.found` returns the string `'>1000'`. If no
filtering can be done to narrow down the results, the code below can paginate
through the entire results set until there is no more records found. The code
through the entire results set until there are no more records found. The code
can also handle the case above where an exact count of records is available.

```py
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/introduction/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: About

The OpenAQ Python SDK is the official Python client for interacting with OpenAQ API.

The OpenAQ Python SDK is compatible with Python versions >=3.10. We encourage
the use of our SDK over other Python tools to interact with OpenAQ API as it is
designed with best practices built-in our API while
The SDK is compatible with Python versions >=3.10. We encourage
the use of it over other Python tools to interact with OpenAQ API as it is
designed with best practices built-in while
offering many built-in features to easily query for data, such as:
- **Comprehensive type annotations** - type hinting with inline documentation and autocomplete.
- **Deserialized response classes** - Python object for attribute access, with options for json and dictionary representations.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/resources/locations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ list(
| bbox | `tuple[float, float, float, float] \| None` The rectangular area within which locations are searched for and returned | Must be in WGS84 (EPSG:4326) and (minX, minY, maxX, maxY) format with maximum 4 decimals precision. Cannot be used at the same time as `coordinates` or `radius` |
| providers_id | `int \| list[int] \| None` Filter by the ID of the data provider | Must be OpenAQ unique ID for the provider that facilitates data sharing |
| countries_id | `int \| list[int] \| None` Filter by the country or territory where the location operates | Must be OpenAQ unique ID for the country or territory. Cannot be used at the same time as `iso` |
| parameters_id | `int \| list[int] \| None` Filter by a pollutant or meteorological parameter | Must be OpenAQ unique ID for the pollutant or meteorlogical parameter |
| parameters_id | `int \| list[int] \| None` Filter by a pollutant or meteorological parameter | Must be OpenAQ unique ID for the pollutant or meteorological parameter |
| licenses_id | `int \| list[int] \| None` Filter by the license that governs the usage and sharing of data at the location | Must be OpenAQ unique ID for the license |
| instruments_id | `int \| list[int] \| None` Filter by the instrument or equipment that gathers data at the location | Must be OpenAQ unique ID for the instrument |
| manufacturers_id | `int \| list[int] \| None` Filter by the company or organization that produces the air quality monitoring instruments at the location | Must be OpenAQ unique ID for the manufacturer |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/resources/manufacturers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ organizations that produce the air quality monitoring instruments. You can use
it to learn about their different instruments or equipments that output
pollutant concentrations and meteorological readings.

In the cases this information is not availale from the data providers, `OpenAQ
In the cases this information is not available from the data providers, `OpenAQ
admin` with ID 1 will be used as a placeholder.

## Methods
Expand Down
18 changes: 9 additions & 9 deletions docs/src/content/docs/resources/measurements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: Measurements

import { Tabs, TabItem } from '@astrojs/starlight/components';

The Measurements resources provide measurements data from sensors. OpenAQ
ingests raw measurements at the hourly interval at the very least, but also
hosts data at a much higher frequency (e.g. 5 minutes interval). In addition to
providing raw measurement values as reported by providers, we also provides
The Measurements resources provide measurements data from sensors. OpenAQ
attempts to ingest raw measurements at least hourly, but also
hosts data at a much higher frequency (e.g. five minute interval). In addition to
providing raw measurement values as reported by providers, we also provide
options for accessing the data at different levels of aggregation.

## Methods
Expand Down Expand Up @@ -48,8 +48,8 @@ list(
| sensors_id | `int` OpenAQ's unique ID for the sensor from which measurements should be retrieved. | Required |
| data | `str` The base measurement unit to query. | Required, must be one of: `measurements`, `hours`, `days`, `years` |
| rollup | `str \| None` The period by which to roll up the base measurement data. | Must be one of: `hourly`, `daily`, `monthly`, `yearly`, `hourofday`, `dayofweek`, `monthofyear` |
| datetime_from | `datetime.datetime \| str \| None` Starting datetime to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted datetime string i.e. `YYYY-MM-DDTHH:mm:ss`. Can only be used when `data` is either `measurements` or `hours`. Cannot be used with `date_form` or `date_to` |
| datetime_to | `datetime.datetime \| str \| None` Ending datetime to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted datetime string i.e. `YYYY-MM-DDTHH:mm:ss`. Can only be used when `data` is either `measurements` or `hours`. Cannot be used with `date_form` or `date_to` |
| datetime_from | `datetime.datetime \| str \| None` Starting datetime to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted datetime string i.e. `YYYY-MM-DDTHH:mm:ss`. Can only be used when `data` is either `measurements` or `hours`. Cannot be used with `date_from` or `date_to` |
| datetime_to | `datetime.datetime \| str \| None` Ending datetime to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted datetime string i.e. `YYYY-MM-DDTHH:mm:ss`. Can only be used when `data` is either `measurements` or `hours`. Cannot be used with `date_from` or `date_to` |
| date_from | `datetime.date \| str \| None` Starting date to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted date string i.e. `YYYY-MM-DD`. Can only be used when `data` is either `days` or `years`. Cannot be used with `datetime_from` or `datetime_to` |
| date_to | `datetime.date \| str \| None` Ending date to retrieve measurements. Defaults to local time unless timezone information is included. | If not a datetime object then must be a ISO-8601 formatted date string i.e. `YYYY-MM-DD`. Can only be used when `data` is either `days` or `years`. Cannot be used with `datetime_from` or `datetime_to` |
| page | `int` The page number to retrieve, defaults to 1 | Must be greater than zero |
Expand All @@ -71,8 +71,8 @@ with OpenAQ() as client:

### Data and Rollup

Understanding data and rollups concepts is the key to using the Measurements
resource effectively. While `data` gives you the benefits of speed as it fetches
Understanding data and rollup concepts is the key to using the Measurements
resource effectively. While `data` gives you the benefit of speed as it fetches
pre-computed measurements data, it is limited in the level of aggregation
(covering only `measurements`, `hours`, `days`, and `years` data) and the base
measurement from which data is aggregated (i.e. the hourly average values).
Expand All @@ -83,7 +83,7 @@ in `data`. However, because rollups are computed on the fly, it will be slower
and more resources-consuming than simply using `data`, especially when rolling
up from `data`="measurements". As such, prioritize `data` where you can and if you
need to use `rollup` for a customized aggregation:
- double check to see if it's a query that could be done with just using `data`
- double check to see if it's a query that could be done just using `data`
- limit your queries to smaller time periods

#### Possible combinations
Expand Down
Loading