Index
+ + +A
+D
+E
+
|
+
G
++ | + |
I
+
|
+
|
+
L
+
|
+
M
+
|
+
|
+
P
+
|
+
|
+
Q
+S
+T
++ |
|
+
U
+
|
+
|
+
' + + '' + + _("Hide Search Matches") + + "
" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html new file mode 100644 index 0000000..476d95a --- /dev/null +++ b/docs/_build/html/genindex.html @@ -0,0 +1,772 @@ + + + + + + + +
|
+
+ | + |
|
+
|
+
|
+
|
+
|
+
|
+
|
+
+ |
|
+
|
+
|
+
Note
+This software/application was developed by the U.S. Environmental +Protection Agency (USEPA). No warranty expressed or implied is made +regarding the accuracy or utility of the system, nor shall the act of +distribution constitute any such warranty. The USEPA has relinquished +control of the information and no longer has responsibility to protect +the integrity, confidentiality or availability of the information. Any +reference to specific commercial products, processes, or services by +service mark, trademark, manufacturer, or otherwise, does not constitute +or imply their endorsement, recommendation or favoring by the USEPA. The +USEPA seal and logo shall not be used in any manner to imply endorsement +of any commercial product or activity by the USEPA or the United States +Government.
+Warning
+US EPA’s AQS Data Mart API V2 is currently in beta phase of development, +the API interface has not been finalized. This means that certain +functionality of the API may change or be removed without notice. As a +result, this package is also currently marked as beta and may also change +to reflect any changes made to the Data Mart API or in respect to +improvements in the design, functionality, quality and documentation of +this package. The authors assume no liability for any problems that may +occur as a result of using this package, the Data Mart service, any +software, service, hardware, or user accounts that may utilize this +package.
+The pyaqsapi package for the python 3 programming environment allows a python 3 +programming environment to connect to and retrieve data from the United States +Environmental Protection Agency’s (US EPA) Air Quality System (AQS) Data Mart +API v2 (Air Quality System) interface directly. +This package enables the data user to omit legacy challenges including coercing +data from a JSON object to a usable python 3 object, retrieving multiple years +of data, formatting API requests, retrieving results, handling credentials, +requesting multiple pollutant data and rate limiting data requests. +All the basic functionality of the API have been implemented that are available +from the AQS API Data Mart server. The library connects to AQS Data Mart API +via Hypertext Transfer Protocol (HTTP) so there is no need to install external +ODBC drivers, configure ODBC connections or deal with the security +vulnerabilities associated with them. Most functions have a parameter, +return_header which by default is set to FALSE. If the user decides to +set return_header to TRUE, then that function will return a python 3 +AQSAPI_V2 object. An AQSAPI_V2 object has instance methods for retrieving the +data requested, header information, and other metadata related to the API call. +After each call to the API a five second stall is invoked to help prevent +overloading the Data Mart API server and to serve as a simple rate limit.
+EPA’s AQS Datamart API, the service that pyaqsapi retrieves data from, does not +host real time (collected now/today) data. If real time data is needed, please +use the AirNow API and direct all questions toward real time data there. +pyaqsapi does not work with AirNow and cannot retrieve real time data. For more +details see section 7.1 of the About AQS Data page .
+To install pyaqsapi first clone the pyaqsapi repository.
+git clone https://github.com/USEPA/pyaqsapi.git
+
Next, in the project’s root directory use pip to install the proper +dependencies that are required to build +and install pyaqsapi.
+pip install -r requirements.txt
+
While still in the project’s root directory use setuptools to build and pip +to install the package.
+python -m build .
+python -m pip install .
+
Like any other python package make sure that you are loading pyaqsapi in the +same virtual environment where pyaqsapi was installed. Load pyaqsapi in the +same any other python package is loaded.
+import pyaqsapi as aqs
+
For those who are already familiar with using +RAQSAPI then the pyaqsapi API should feel familiar with a few minor differences +regarding how the data is returned.
+By default data is returned as a pandas Data Frames . +Exported functions from pyaqsapi have a parameter RETURN_HEADER, by default +this parameter is False. When False functions simply return the requested +data as a pandas Data Frame. If RETURN_HEADER is manually set to True a list of +AQSAPI_V2 python 3 objects are returned. Use the get_data() class method to +retrieve the data and the get_header() class method to retrieve header +information.
+If you have not already done so you will need to sign up with AQS Data Mart +using aqs_sign_up function, this function takes one input, “email,” which +is a python 3 character object, that represents the email address that you want +to use as a user credential to the AQS Data Mart service. After a successful +call to aqs_sign_up an email message will be sent to the email address provided +with a new Data Mart key which will be used as a credential key to access the +Data Mart API. The aqs_sign_up function can also be used to regenerate a new +key for an existing user, to generate a new key simply call the aqs_sign_up +function with the parameter “email” set to an existing account. A new key will +be e-mailed to the account given.
+The credentials used to access the Data Mart API service are stored in as a +python global variable that needs to be set every time the pyaqsapi module is +loaded or the key is changed. Without valid credentials, the Data Mart server +will reject any request sent to it. The key used with Data Mart is a key and is +not a password, so the pyaqsapi package does not treat the key as a password; +this means that the key is stored in plain text and there are no attempts to +encrypt Data Mart credentials as would be done for a username and password +combination. The key that is supplied to use with Data Mart is not intended for +authentication but only account monitoring. Each time pyaqsapi is loaded and +before using any of it’s functions use the aqs_credentials function to enter in +the user credentials so that pyaqsapi can access the AQS Data Mart server.
+Both pyaqsapi and RAQSAPI use the US Environmental Protection Agency’s Air +Quality Service DataMart to retrieve data. The same credentials can be used for +access to either project. Note however, that AQS and AQS DataMart are similar +and related data sources, however the credentials used to access AQS are not the +same as those used to access AQS DataMart.
+Note
+The credentials used to access AQS Data Mart API are not the same as the +credentials used to access AQS. AQS users who do not have access to the +AQS Data Mart will need to create new credentials. However, you may use the +same credentials used in RAQSAPI in pyaqsapi since RAQSAPI ewes the the same +AQS Data Mart API as pyaqsapi.
+This section contains suggestions for completing certain data related tasks.
+Determine if or how much data exists for a time-parameter-geography +combination:
++++
+- +
Retrieve data using the annualdata service.
- +
If no records are returned, we do not have the data.
- +
If records are returned, use the observation count to determine the +temporal and geographic distribution of the data.
Monthly averages:
++++
+- +
AQS does not routinely calculate monthly aggregate statistics.
- +
If you need these, you must calculate them yourself.
- +
These can be calculated from the sample data or the daily data without +loss of fidelity.
Determine a single value for a site with collocated monitors:
++++
+- +
Many sites will have collocated monitors - monitors collecting the same +parameter at the same time.
- +
The API currently provides only monitor level values. (site-level values +will be added in the future.)
- +
For some criteria pollutants (PM2.5, ozone, lead, and NO2), the +regulations define procedures for defining a single site-level value.
- +
For other pollutants, determining a single site-level value is left to +the investigator.
Please adhere to the following when using the AQS Data Mart API:
++++
+- +
+
+- Limit the size of queries. The AQS Data Mart contains billions of
- +
values and you may request more than you intend. If you are unsure of +the amount of data, start small and work your way up. Please limit +queries to 1,000,000 rows of data each. You can use the +“observation count” field on the annualdata service to determine how +much data exists for a time-parameter-geography combination.
+- +
+
+- Limit the frequency of queries. The AQS Data Mart can process a limited
- +
load. Please wait for one request to complete before submitting another +and do not make more than 10 requests per minute.
+- +
Be advised that RAQSAPI is capable of retrieving results for multiple +pollutants, this can result in the amount of data being returned being +multiplied by the number of pollutants being requested.
- +
Be advised that the AQS Data Mart API limits certain data requests to +one year of data at a time with the exception of the Monitor service. +In order to retrieve multiple years of data for these functions the +RAQSAPI library conveniently sends multiple API requests to the Data Mart +API server, one request for each year, this can result in the amount of +data being returned being multiplied by the number of years of data being +requested.
The AQS Data Mart administrators may disable accounts without notice for +failure to adhere to these terms (Though they will contact the offending +user via the email address provided)
+The pyaqsapi package includes the following submodules which are not +loaded by default:
+* pyaqsapi.bysite
+* pyaqsapi.bycounty
+* pyaqsapi.bycounty
+* pyaqsapi.bycbsa
+* pyaqsapi.bybox
+* pyaqsapi.byma
+* pyaqsapi.ma
+
With these submodules loaded the entire list of functions exported by the +pyaqsapi package includes:
+* pyaqsapi.aqs_cbsas,
+* pyaqsapi.aqs_classes,
+* pyaqsapi.aqs_counties_by_state,
+* pyaqsapi.aqs_credentials,
+* pyaqsapi.aqs_credentials,
+* pyaqsapi.aqs_fields_by_service,
+* pyaqsapi.aqs_fields_by_service,
+* pyaqsapi.aqs_isavailable,
+* pyaqsapi.aqs_isavailable,
+* pyaqsapi.aqs_knownissues,
+* pyaqsapi.aqs_knownissues,
+* pyaqsapi.aqs_mas,
+* pyaqsapi.aqs_parameters_by_class,
+* pyaqsapi.aqs_pqaos,
+* pyaqsapi.aqs_removeheader,
+* pyaqsapi.aqs_revisionhistory,
+* pyaqsapi.aqs_revisionhistory,
+* pyaqsapi.aqs_sampledurations,
+* pyaqsapi.aqs_sign_up,
+* pyaqsapi.aqs_sign_up,
+* pyaqsapi.aqs_sites_by_county,
+* pyaqsapi.aqs_states,
+* pyaqsapi.bybox.annualsummary,
+* pyaqsapi.bybox.dailysummary,
+* pyaqsapi.bybox.helperfunctions,
+* pyaqsapi.bybox.monitors,
+* pyaqsapi.bybox.quarterlysummary,
+* pyaqsapi.bybox.sampledata,
+* pyaqsapi.bycbsa.annualsummary,
+* pyaqsapi.bycbsa.dailysummary,
+* pyaqsapi.bycbsa.helperfunctions,
+* pyaqsapi.bycbsa.monitors,
+* pyaqsapi.bycbsa.quarterlysummary,
+* pyaqsapi.bycbsa.sampledata,
+* pyaqsapi.bycounty.annualsummary,
+* pyaqsapi.bycounty.dailysummary,
+* pyaqsapi.bycounty.helperfunctions,
+* pyaqsapi.bycounty.monitors,
+* pyaqsapi.bycounty.qa_annualperformanceeval,
+* pyaqsapi.bycounty.qa_annualperformanceevaltransaction,
+* pyaqsapi.bycounty.qa_blanks,
+* pyaqsapi.bycounty.qa_collocated_assessments,
+* pyaqsapi.bycounty.qa_flowrateaudit,
+* pyaqsapi.bycounty.qa_flowrateverification,
+* pyaqsapi.bycounty.qa_one_point_qc,
+* pyaqsapi.bycounty.qa_pep_audit,
+* pyaqsapi.bycounty.quarterlysummary,
+* pyaqsapi.bycounty.sampledata,
+* pyaqsapi.bycounty.transactionsample,
+* pyaqsapi.byma.qa_annualpeferomanceeval,
+* pyaqsapi.byma.qa_annualperformanceevaltransaction,
+* pyaqsapi.byma.qa_blanks,
+* pyaqsapi.byma.qa_collocated_assessments,
+* pyaqsapi.byma.qa_flowrateaudit,
+* pyaqsapi.byma.qa_flowrateverification,
+* pyaqsapi.byma.qa_one_point_qc,
+* pyaqsapi.byma.qa_pep_audit,
+* pyaqsapi.byma.transactionsample,
+* pyaqsapi.bypqao.qa_annualperformanceeval,
+* pyaqsapi.bypqao.qa_annualperformanceevaltransaction,
+* pyaqsapi.bypqao.qa_blanks,
+* pyaqsapi.bypqao.qa_collocated_assessments,
+* pyaqsapi.bypqao.qa_flowrateaudit,
+* pyaqsapi.bypqao.qa_flowrateverification,
+* pyaqsapi.bypqao.qa_one_point_qc,
+* pyaqsapi.bypqao.qa_pep_audit,
+* pyaqsapi.bysite.annualsummary,
+* pyaqsapi.bysite.dailysummary,
+* pyaqsapi.bysite.helperfunctions,
+* pyaqsapi.bysite.monitors,
+* pyaqsapi.bysite.qa_annualpeferomanceeval,
+* pyaqsapi.bysite.qa_annualperformanceevaltransaction,
+* pyaqsapi.bysite.qa_blanks,
+* pyaqsapi.bysite.qa_collocated_assessments,
+* pyaqsapi.bysite.qa_flowrateaudit,
+* pyaqsapi.bysite.qa_flowrateverification,
+* pyaqsapi.bysite.qa_one_point_qc,
+* pyaqsapi.bysite.qa_pep_audit,
+* pyaqsapi.bysite.quarterlysummary,
+* pyaqsapi.bysite.sampledata,
+* pyaqsapi.bysite.transactionsample,
+* pyaqsapi.bystate.annualsummary,
+* pyaqsapi.bystate.dailysummary,
+* pyaqsapi.bystate.helperfunctions,
+* pyaqsapi.bystate.monitors,
+* pyaqsapi.bystate.qa_annualperformanceeval,
+* pyaqsapi.bystate.qa_annualperformanceevaltransaction,
+* pyaqsapi.bystate.qa_blanks,
+* pyaqsapi.bystate.qa_collocated_assessments,
+* pyaqsapi.bystate.qa_flowrateaudit,
+* pyaqsapi.bystate.qa_flowrateverification,
+* pyaqsapi.bystate.qa_one_point_qc,
+* pyaqsapi.bystate.qa_pep_audit,
+* pyaqsapi.bystate.quarterlysummary,
+* pyaqsapi.bystate.sampledata,
+* pyaqsapi.bystate.transactionsample
+
pyaqsapi functions are named according to the service and filter variables that +are available by the AQS Data Mart API. Refer to Air Quality System (AQS) API for full details of the +AQS DataMart API.
+These are all the available variables that can be used with various functions +exported from the pyaqsapi library listed alphabetically. Not all of these +variables are used with every function, and not all of these parameters are +required. See the :ref: pyaqsapi functional families section to +see which parameters are used with each function.
+an object of type AQSAPI_V2 that is returned from pyaqsapi +aggregate functions wheen return_header is True.
+a date object which represents the begin date of the data selection. +Only data on or after this date will be returned.
+a date object which represents the “beginning date of last change” that +indicates when the data was last updated. cbdate is used to filter data +based on the change date. Only data that changed on or after this +date will be returned. This is an optional variable which defaults to None.
+a date object which represents the “end date of last change” that indicates +when the data was last updated. cedate is used to filter data based on the +change date. Only data that changed on or before this date will be +returned. This is an optional variable which defaults to None.
+a character object which represents the 3 digit state FIPS code for the +county being requested (with leading zero(s)). Refer to +aqs_counties_by_state() for a table of available county codes for each +state.
+a character string that represents the parameter duration code that limits +returned data to a specific sample duration. The default value of None +will result in no filtering based on duration code. Valid durations +include actual sample durations and not calculated durations such as 8 hour +CO or O3rolling averages, 3/6 day PM averages or Pb 3 month +rolling averages. Refer to aqs_sampledurations() for a table of all +available duration codes.
+a date object which represents the end date of the data selection. Only +data on or before this date will be returned.
+a character object which represents the email account that will be used to +register with the AQS API or change an existing user’s key. A verification +email will be sent to the account specified.
+a character object which represents the key used in conjunction with the +username given to connect to AQS Data Mart.
+a character object which represents the 4 digit AQS Monitoring Agency code +(with leading zeroes).
+a character object which represents the maximum latitude of a geographic +box. Decimal latitude with north begin positive. Only data south of this +latitude will be returned.
+a character object which represents the maximum longitude of a +geographic box. Decimal longitude with east being positive. Only +data west of this longitude will be returned. Note that -80 is less +than -70.
+a character object which represents the minimum latitude of a +geographic box. Decimal latitude with north being positive. +Only data north of this latitude will be returned.
+a character object which represents the minimum longitude of a +geographic box. Decimal longitude with east begin positive. Only +data east of this longitude will be returned.
+a character list or single character object which represents the parameter +code of the air pollutant related to the data being requested.
+If False (default) only returns data requested as a pandas DataFrame. If +True returns a AQSAPI_V2 object.
+a string which represents the services provided by the AQS API. For a list +of available services refer to +<https://aqs.epa.gov/aqsweb/documents/data_api.html#services>_ +for the complete listing of services available through the EPA +AQS Datamart API
+a character object which represents the 4 digit site number (with +leading zeros) within the county and state being requested.
+a character object which represents the 2 digit state FIPS code +(with leading zero) for the state being requested.
+a character object which represents the 4 digit AQS Primary Quality +Assurance Organization code (with leading zeroes).
+a character object which represents the email account that will be used to +connect to the AQS API.
+The functions included in this family of functions are:
+* aqs_credentials
+* aqs_sign_up
+
information to use with pyaqsapi. The aqs_sign_up function takes +one parameter:
+email:
The aqs_credentials function takes two parameters:
+username:
key:
The functions included in this family of functions are:
+* aqs_isavailable
+* aqs_knownissues
+* aqs_fields_by_service
+* aqs_revisionhistory
+
These functions return Data Mart meta data
+++The aqs_isavailable function takes no parameters and returns a +table which details the status of the AQS API.
+The aqs_fields_by_service function takes one parameter, service, +which is a character object which represents the services provided by +the AQS API. For a list of available services see +Air Quality System (AQS) API - Services Overview
+The aqs_knownissues function takes no parameters and Returns a +table of any known issues with system functionality or the data. These are +usually issues that have been identified internally and will require some +time to correct in Data Mart or the API. This function implements a direct +API call to Data Mart and returns data directly from the API. Issues +returned via this function do not include any issues from the pyaqsapi +package.
+The aqs_revisionhistory function is used to query Data Mart for the +change history to the API.
+
The functions included in this family of functions are:
+* aqs_cbsas,
+* aqs_classes,
+* aqs_counties_by_state,
+* aqs_fields_by_service,
+* aqs_isavailable,
+* aqs_knownissues,
+* aqs_mas,
+* aqs_parameters_by_class,
+* aqs_pqaos,
+* aqs_revisionhistory,
+* aqs_sampledurations,
+* aqs_sites_by_county,
+* aqs_states
+
++List functions return the API status, API options or groupings that can be +used in conjunction with other API calls. By default each function in this +category returns results as a DataTable. If return_header parameter is set +to True a AQSAPI_v2 object is returned instead.
+aqs_cbsas returns a table of all available Core Based Statistical +Areas (cbsas) and their respective cbsa codes.
+aqs_states takes no arguments and returns a table of the available +states and their respective state FIPS codes.
+aqs_sampledurations() +aqs_sampledurations takes no arguments and returns a table of the +available sample duration code used to construct other requests.
+aqs_classes takes no arguments and returns a table of parameter +classes (groups of parameters, i.e. “criteria” or “all”).
+aqs_counties_by_state() +aqs_counties_by_state takes one parameter, stateFIPS, which is a two +digit state FIPS code for the state being requested represented as a +character object and returns a table of counties and their +respective FIPS code for the state requested. Use aqs_states to +receive a table of valid state FIPS codes.
+aqs_sites_by_county takes two parameters, stateFIPS, which is a +two digit state FIPS code for the state being requested and county_code +which is a three digit county FIPS code for the county being requested, +both stateFIPS and county_code should be encoded as a character object. +This function returns a table of all air monitoring sites with the +requested state and county FIPS code combination.
+aqs_pqaos takes no parameters and returns an AQSAPI_V2 +object containing a table of primary quality assurance +organizations (pqaos).
+aqs_mas takes no parameters and returns an AQSAPI_V2 +object containing a table of monitoring agencies (MA).
+
Note
+AQS Data Mart API restricts the maximum amount of monitoring data to one +full year of data per API call. These functions are able to return multiple +years of data by making repeated calls to the API. Each call to the Data +Mart API will take time to complete. The more years of data being requested +the longer pyaqsapi will take to return the results.
+These functions retrieve aggregated data from the Data Mart API and are +grouped by how each function aggregates the data. There are 5 different +families of related aggregate functions. These families are arranged by how +the Data Mart API groups the returned data, bysite, bycounty, bystate, +by<latitude/longitude bounding box> (bybox) and +by<core based statistical area> (bycbsa). Within each family +of aggregated data functions there are functions that call on the 10 +different services that the Data Mart API provides. All Aggregate +functions return a pandas DataFrame by default. If the return_Header +parameter is set to True an AQSAPI_V2 object is returned instead.
+These fourteen services are:
+Returns operational information about the samplers (monitors) +used to collect the data. Includes identifying information, +operational dates, operating organizations, etc. Functions +using this service contain monitors in the function name.
+Returns sample data - the most fine grain data reported to +EPA. Usually hourly, sometimes 5-minute, 12-hour, etc. +This service is available in several geographic selections +based on geography: site, county, state, cbsa (core based +statistical area, a grouping of counties), or +by latitude/longitude bounding box. Functions using this +service contain sampledata in the function name. +All Sample Data functions accept two additional, optional +parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last +change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be +returned. This is an optional variable which defaults to +None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is +used to filter data based on the change date. Only data +that changed on or before this date will be returned. This +is an optional variable which defaults to None.
+- +
+
+- duration:
- +
an optional character string that represents the parameter +duration code that limits returned data to a specific sample +duration. The default value of None results in no filtering +based on duration code. Valid durations include actual sample +durations and not calculated durations such as 8 hour +CO or $O_3$ rolling averages, 3/6 day PM averages or +Pb 3 month rolling averages. Refer to +aqs_sampledurations() for a list of all available +duration codes.
+
Returns data summarized at the daily level. All daily +summaries are calculated on midnight to midnight basis in local time. +Variables returned include date, mean value, maximum value, etc. Functions +using this service contain Dailysummary in the function name. All Daily +Summary Data functions accept two additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last change” +that indicates when the data was last updated. cbdate is used to +filter data based on the change date. Only data that changed on or +after this date will be returned. This is an optional variable which +defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is +used to filter data based on the change date. Only data +that changed on or before this date will be returned. This +is an optional variable which defaults to None.
+
Returns data summarized at the yearly level. Variables include mean value, +maxima, percentiles, etc. Functions using this service contain annualdata +in the function name. All Annual Summary Data functions accept two +additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last +change” that indicates when the data was last updated. cbdate +is used to filter data based on the change date. Only data +that changed on or after this date will be returned. This is +an optional variable which defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is used +to filter data based on the change date. Only data that +changed on or before this date will be returned. This is an +optional variable which defaults to None.
+
Returns data summarized at the quarterly level. Variables include mean +value, maxima, percentiles, etc. Functions using this service +contain quarterlydata in the function name. All Annual Summary Data +functions accept two additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last change” that +indicates when the data was last updated. cbdate is used to filter +data based on the change date. Only data that changed on or after +this date will be returned. This is an optional variable which +defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is used +to filter data based on the change date. Only data that +changed on or before this date will be returned. This is an +optional variable which defaults to None.
+
Quality assurance data - blanks samples. Blanks are unexposed sample +collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Functions using this service contain +qa_blanks in the function name.
+Quality assurance data - collocated assessments. Collocated assessments +are pairs of samples collected by different samplers at the same time +and place. (These are “operational” samplers, assessments with +independently calibrated samplers are called “audits”.). Functions using +this service contain qa_collocated_assessments in the function name.
+Quality assurance data - flow rate verifications. Several times per year, +each PM monitor must have it’s (fixed) flow rate verified by an operator +taking a measurement of the flow rate. Functions using this service contain +qa_flowrateverification in the function name.
+Quality assurance data - flow rate audits. At least twice year, each PM +monitor must have it’s flow rate measurement audited by an expert using a +different method than is used for flow rate verifications. Functions using +this service contain qa_flowrateaudit in the function name.
+Quality assurance data - one point quality control check raw data. +At least every two weeks, certain gaseous monitors must be challenged with +a known concentration to determine monitor performance. Functions using +this service contain qa_one_point_qc in the function name.
+Quality assurance data - performance evaluation program (pep) audits. +Pep audits are independent assessments used to estimate total measurement +system bias with a primary quality assurance organization. Functions +using this service contain qa_pep_audit in the function name.
+Transaction sample data - The raw transaction sample data uploaded to AQS +by the agency responsible for data submissions in RD format. Functions +using this service contain transactionsample in the function name. +Transaction sample data is only available aggregated by site, county, +state or monitoring agency.
+Quality assurance data - Annual performance evaluations. A performance +evaluation must be conducted on each primary monitor once per year. The +percent differences between known and measured concentrations at several +levels are used to assess the quality of the monitoring data. Functions +using this service contain aqs_qa_annualperformanceeval in the function +name. Annual performance in transaction format are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization. Annual performance evaluations are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization.
+format (RD): +Quality assurance data - The raw transaction annual performance +evaluations data in RD format. Functions using this service contain +aqs_qa_annualperformanceevaltransaction in the function name. Annual +performance evaluations in transaction format are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization.
+The bysite submodule exports the following functions:
+* bysite.annualsummary,
+* bysite.dailysummary,
+* bysite.helperfunctions,
+* bysite.monitors,
+* bysite.qa_annualpeferomanceeval,
+* bysite.qa_annualperformanceevaltransaction,
+* bysite.qa_blanks,
+* bysite.qa_collocated_assessments,
+* bysite.qa_flowrateaudit,
+* bysite.qa_flowrateverification,
+* bysite.qa_one_point_qc,
+* bysite.qa_pep_audit,
+* bysite.quarterlysummary,
+* bysite.sampledata,
+* bysite.transactionsample
+
bysite functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
sitenum:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bycounty submodule exports the following functions:
+* bycounty.annualsummary,
+* bycounty.dailysummary,
+* bycounty.helperfunctions,
+* bycounty.monitors,
+* bycounty.qa_annualperformanceeval,
+* bycounty.qa_annualperformanceevaltransaction,
+* bycounty.qa_blanks,
+* bycounty.qa_collocated_assessments,
+* bycounty.qa_flowrateaudit,
+* bycounty.qa_flowrateverification,
+* bycounty.qa_one_point_qc,
+* bycounty.qa_pep_audit,
+* bycounty.quarterlysummary,
+* bycounty.sampledata,
+* bycounty.transactionsample
+
level. All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bystate submodule exports the following functions:
+* bystate.annualsummary,
+* bystate.dailysummary,
+* bystate.helperfunctions,
+* bystate.monitors,
+* bystate.qa_annualperformanceeval,
+* bystate.qa_annualperformanceevaltransaction,
+* bystate.qa_blanks,
+* bystate.qa_collocated_assessments,
+* bystate.qa_flowrateaudit,
+* bystate.qa_flowrateverification,
+* bystate.qa_one_point_qc,
+* bystate.qa_pep_audit,
+* bystate.quarterlysummary,
+* bystate.sampledata,
+* bystate.transactionsample
+
All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The byma submodule exports the following functions:
+* byma.qa_annualpeferomanceeval,
+* byma.qa_annualperformanceevaltransaction,
+* byma.qa_blanks,
+* byma.qa_collocated_assessments,
+* byma.qa_flowrateaudit,
+* byma.qa_flowrateverification,
+* byma.qa_one_point_qc,
+* byma.qa_pep_audit,
+* byma.transactionsample
+
All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+Monitoring Agency (MA) level. All functions accept the following variables:
+parameter:
bdate:
edate:
MA_code:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bycbsa submodule exports the following functions:
+* bycbsa.annualsummary,
+* bycbsa.dailysummary,
+* bycbsa.helperfunctions,
+* bycbsa.monitors,
+* bycbsa.quarterlysummary,
+* bycbsa.sampledata
+
Statistical Area (cbsa, as defined by the US Census Bureau) level. +All functions accept the following variables:
+parameter:
bdate:
edate:
cbsa_code:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bypqao submodule exports the following functions:
+* bypqao.qa_annualperformanceeval,
+* bypqao.qa_annualperformanceevaltransaction,
+* bypqao.qa_blanks,
+* bypqao.qa_collocated_assessments,
+* bypqao.qa_flowrateaudit,
+* bypqao.qa_flowrateverification,
+* bypqao.qa_one_point_qc,
+* bypqao.qa_pep_audit
+
Primary Quality Assurance Organization (pqao) level. All functions accept +the following variables:
+parameter:
bdate:
edate:
pqao_code:
return_header (optional): set to False by default.
The bybox submodule exports the following functions:
+* bybox.annualsummary,
+* bybox.dailysummary,
+* bybox.helperfunctions,
+* bybox.monitors,
+* bybox.quarterlysummary,
+* bybox.sampledata
+
latitude/longitude bounding box (bybox) level. All functions accept the +following variables:
+parameter:
bdate:
edate:
minlat:
minlon:
maxlon:
maxlat:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+These are miscellaneous functions exported by pyaqsapi.
+aqs_removeheader is the function that the pyaqsapi library +uses internally to coerce an AQSAPI_V2 object into a pandas DataFrame. +This is useful if the user saves the output from another pyaqsapi function +with return_header = True set but later decides that they want just a +simple pandas DataFrame object. This function takes only one variable:
+AQSobject:
Parameters must be supplied exactly as they are specified, for example the +stateFIPS for Alabama is “01”, entering a value of “1” for the stateFIPS +may lead to unexpected results. Do not omit leading zeros in parameters that +expect them.
+pyaqsapi is a port of to the +python 3 programming environment. For anyone that is familiar with RAQSAPI, +the pyaqsapi API will feel familiar to you, most of the functions are similar +and the parameters sent to each functions are the same. pyaqsapi aims to have +feature parity with RAQSAPI and neither project will have features that the +other project does not - other than programming language environment or +language preference there is no benefit to using one package over the other.
+genindex
AQS DataMart welcome. August 2018. URL: https://aqs.epa.gov/aqsweb/documents/data_mart_welcome.html.
About AQS data. May 2019. Version 1.1. URL: https://aqs.epa.gov/aqsweb/documents/about_aqs_data.html.
Pandas DataFrame. January 2024. URL: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html.
Clinton Mccrowey. A R extension to retrieve ambient air monitoring data from the United States Environmental Protection Agency's (US EPA) Air Quality System (AQS) DataMart API V2 interface. 2022. URL: https://github.com/USEPA/RAQSAPI.
Note
+This software/application was developed by the U.S. Environmental +Protection Agency (USEPA). No warranty expressed or implied is made +regarding the accuracy or utility of the system, nor shall the act of +distribution constitute any such warranty. The USEPA has relinquished +control of the information and no longer has responsibility to protect +the integrity, confidentiality or availability of the information. Any +reference to specific commercial products, processes, or services by +service mark, trademark, manufacturer, or otherwise, does not constitute +or imply their endorsement, recommendation or favoring by the USEPA. The +USEPA seal and logo shall not be used in any manner to imply endorsement +of any commercial product or activity by the USEPA or the United States +Government.
+Warning
+US EPA’s AQS Data Mart API V2 is currently in beta phase of development, +the API interface has not been finalized. This means that certain +functionality of the API may change or be removed without notice. As a +result, this package is also currently marked as beta and may also change +to reflect any changes made to the Data Mart API or in respect to +improvements in the design, functionality, quality and documentation of +this package. The authors assume no liability for any problems that may +occur as a result of using this package, the Data Mart service, any +software, service, hardware, or user accounts that may utilize this +package.
+To install pyaqsapi first clone the pyaqsapi repository.
+git clone https://github.com/USEPA/pyaqsapi.git
+
Next, in the project’s root directory use pip to install the proper +dependencies that are required to build +and install pyaqsapi.
+pip install -r requirements.txt
+
While still in the project’s root directory use setuptools to build and pip +to install the package.
+python -m build .
+python -m pip install .
+
The pyaqsapi package for the python 3 programming environment allows a python 3 +programming environment to connect to and retrieve data from the United States +Environmental Protection Agency’s (US EPA) Air Quality System (AQS) Data Mart +API v2 (Air Quality System) interface directly. +This package enables the data user to omit legacy challenges including coercing +data from a JSON object to a usable python 3 object, retrieving multiple years +of data, formatting API requests, retrieving results, handling credentials, +requesting multiple pollutant data and rate limiting data requests. +All the basic functionality of the API have been implemented that are available +from the AQS API Data Mart server. The library connects to AQS Data Mart API +via Hypertext Transfer Protocol (HTTP) so there is no need to install external +ODBC drivers, configure ODBC connections or deal with the security +vulnerabilities associated with them. Most functions have a parameter, +return_header which by default is set to FALSE. If the user decides to +set return_header to TRUE, then that function will return a python 3 +AQSAPI_V2 object. An AQSAPI_V2 object has instance methods for retrieving the +data requested, header information, and other metadata related to the API call. +After each call to the API a five second stall is invoked to help prevent +overloading the Data Mart API server and to serve as a simple rate limit.
+Like any other python package make sure that you are loading pyaqsapi in the +same virtual environment where pyaqsapi was installed. Load pyaqsapi in the +same any other python package is loaded.
+import pyaqsapi as aqs
+
pyaqsapi is a port of to the +python 3 programming environment. For anyone that is familiar with RAQSAPI, +the pyaqsapi API will feel familiar to you, most of the functions are similar +and the parameters sent to each functions are the same. pyaqsapi aims to have +feature parity with RAQSAPI and neither project will have features that the +other project does not - other than programming language environment or +language preference there is no benefit to using one package over the other.
+EPA’s AQS Datamart API, the service that pyaqsapi retrieves data from, does not +host real time (collected now/today) data. If real time data is needed, please +use the AirNow API and direct all questions toward real time data there. +pyaqsapi does not work with AirNow and cannot retrieve real time data. For more +details see section 7.1 of the About AQS Data page .
+Parameters must be supplied exactly as they are specified, for example the +stateFIPS for Alabama is “01”, entering a value of “1” for the stateFIPS +may lead to unexpected results. Do not omit leading zeros in parameters that +expect them.
+For those who are already familiar with using +RAQSAPI then the pyaqsapi API should feel familiar with a few minor differences +regarding how the data is returned.
+By default data is returned as a pandas Data Frames . +Exported functions from pyaqsapi have a parameter RETURN_HEADER, by default +this parameter is False. When False functions simply return the requested +data as a pandas Data Frame. If RETURN_HEADER is manually set to True a list of +AQSAPI_V2 python 3 objects are returned. Use the get_data() class method to +retrieve the data and the get_header() class method to retrieve header +information.
+If you have not already done so you will need to sign up with AQS Data Mart +using aqs_sign_up function, this function takes one input, “email,” which +is a python 3 character object, that represents the email address that you want +to use as a user credential to the AQS Data Mart service. After a successful +call to aqs_sign_up an email message will be sent to the email address provided +with a new Data Mart key which will be used as a credential key to access the +Data Mart API. The aqs_sign_up function can also be used to regenerate a new +key for an existing user, to generate a new key simply call the aqs_sign_up +function with the parameter “email” set to an existing account. A new key will +be e-mailed to the account given.
+The credentials used to access the Data Mart API service are stored in as a +python global variable that needs to be set every time the pyaqsapi module is +loaded or the key is changed. Without valid credentials, the Data Mart server +will reject any request sent to it. The key used with Data Mart is a key and is +not a password, so the pyaqsapi package does not treat the key as a password; +this means that the key is stored in plain text and there are no attempts to +encrypt Data Mart credentials as would be done for a username and password +combination. The key that is supplied to use with Data Mart is not intended for +authentication but only account monitoring. Each time pyaqsapi is loaded and +before using any of it’s functions use the aqs_credentials function to enter in +the user credentials so that pyaqsapi can access the AQS Data Mart server.
+Both pyaqsapi and RAQSAPI use the US Environmental Protection Agency’s Air +Quality Service DataMart to retrieve data. The same credentials can be used for +access to either project. Note however, that AQS and AQS DataMart are similar +and related data sources, however the credentials used to access AQS are not the +same as those used to access AQS DataMart.
+Note
+The credentials used to access AQS Data Mart API are not the same as the +credentials used to access AQS. AQS users who do not have access to the +AQS Data Mart will need to create new credentials. However, you may use the +same credentials used in RAQSAPI in pyaqsapi since RAQSAPI ewes the the same +AQS Data Mart API as pyaqsapi.
+Note
+AQS Data Mart API restricts the maximum amount of monitoring data to one +full year of data per API call. These functions are able to return multiple +years of data by making repeated calls to the API. Each call to the Data +Mart API will take time to complete. The more years of data being requested +the longer pyaqsapi will take to return the results.
+These functions retrieve aggregated data from the Data Mart API and are grouped +by how each function aggregates the data. There are 7 different families of +related aggregate functions in which the AQS Data Mart API groups data.
+These seven families are:
++++
+- +
by site (aqs.bysite)
- +
by county (aqs.bycounty)
- +
by state (aqs.bystate)
- +
by latitude/longitude bounding box (aqs.bybox)
- +
by monitoring agency (aqs.byma)
- +
by Primary Quality Assurance Organization (aqs.bypqao)
- +
by core based statistical area (as defined by the US census Bureau) +(aqs.bycbsa).
Within these families of aggregated data functions there are functions that +call on the 13 different aggregate services that the Data Mart API provides. +Note that not all aggregations are available for each service.
+These thirteen services are:
++++
+- +
Monitors (monitors)
- +
Sample Data (sampledata)
- +
Daily Summary Data (dailydata)
- +
Annual Summary Data (annualdata)
- +
Quality Assurance - Blanks Data (qa_blanks)
- +
Quality Assurance - Collocated Assessments +(qa_collocated_assessments)
- +
Quality Assurance - Flow Rate Verifications (qa_flowrateverification)
- +
Quality Assurance - Flow Rate Audits (aqs_qa_flowrateaudit)
- +
Quality Assurance - One Point Quality Control Raw Data +(qa_one_point_qc)
- +
Quality Assurance - PEP Audits (qa_pep_audit)
- +
Transaction Sample - AQS Submission data in transaction Format (RD) +(transactionsample)
- +
Quality Assurance - Annual Performance Evaluations +(qa_annualperformanceeval)
- +
Quality Assurance - Annual Performance Evaluations in the AQS +Submission transaction format (RD) (qa_annualperformanceevaltransaction)
Aggregate functions are named aqs.<aggregation>.<service>() where <service> +is one of the 13 services listed above and <aggregation> is either +“bysite“, ”bycounty“, ”bystate“, ”bybox“, ”bycbsa”, “byma” or “bypqao”.
+The pyaqsapi package includes the following submodules which are not +loaded by default:
+* pyaqsapi.bysite
+* pyaqsapi.bycounty
+* pyaqsapi.bycounty
+* pyaqsapi.bycbsa
+* pyaqsapi.bybox
+* pyaqsapi.byma
+* pyaqsapi.ma
+
With these submodules loaded the entire list of functions exported by the +pyaqsapi package includes:
+* pyaqsapi.aqs_cbsas,
+* pyaqsapi.aqs_classes,
+* pyaqsapi.aqs_counties_by_state,
+* pyaqsapi.aqs_credentials,
+* pyaqsapi.aqs_credentials,
+* pyaqsapi.aqs_fields_by_service,
+* pyaqsapi.aqs_fields_by_service,
+* pyaqsapi.aqs_isavailable,
+* pyaqsapi.aqs_isavailable,
+* pyaqsapi.aqs_knownissues,
+* pyaqsapi.aqs_knownissues,
+* pyaqsapi.aqs_mas,
+* pyaqsapi.aqs_parameters_by_class,
+* pyaqsapi.aqs_pqaos,
+* pyaqsapi.aqs_removeheader,
+* pyaqsapi.aqs_revisionhistory,
+* pyaqsapi.aqs_revisionhistory,
+* pyaqsapi.aqs_sampledurations,
+* pyaqsapi.aqs_sign_up,
+* pyaqsapi.aqs_sign_up,
+* pyaqsapi.aqs_sites_by_county,
+* pyaqsapi.aqs_states,
+* pyaqsapi.bybox.annualsummary,
+* pyaqsapi.bybox.dailysummary,
+* pyaqsapi.bybox.helperfunctions,
+* pyaqsapi.bybox.monitors,
+* pyaqsapi.bybox.quarterlysummary,
+* pyaqsapi.bybox.sampledata,
+* pyaqsapi.bycbsa.annualsummary,
+* pyaqsapi.bycbsa.dailysummary,
+* pyaqsapi.bycbsa.helperfunctions,
+* pyaqsapi.bycbsa.monitors,
+* pyaqsapi.bycbsa.quarterlysummary,
+* pyaqsapi.bycbsa.sampledata,
+* pyaqsapi.bycounty.annualsummary,
+* pyaqsapi.bycounty.dailysummary,
+* pyaqsapi.bycounty.helperfunctions,
+* pyaqsapi.bycounty.monitors,
+* pyaqsapi.bycounty.qa_annualperformanceeval,
+* pyaqsapi.bycounty.qa_annualperformanceevaltransaction,
+* pyaqsapi.bycounty.qa_blanks,
+* pyaqsapi.bycounty.qa_collocated_assessments,
+* pyaqsapi.bycounty.qa_flowrateaudit,
+* pyaqsapi.bycounty.qa_flowrateverification,
+* pyaqsapi.bycounty.qa_one_point_qc,
+* pyaqsapi.bycounty.qa_pep_audit,
+* pyaqsapi.bycounty.quarterlysummary,
+* pyaqsapi.bycounty.sampledata,
+* pyaqsapi.bycounty.transactionsample,
+* pyaqsapi.byma.qa_annualpeferomanceeval,
+* pyaqsapi.byma.qa_annualperformanceevaltransaction,
+* pyaqsapi.byma.qa_blanks,
+* pyaqsapi.byma.qa_collocated_assessments,
+* pyaqsapi.byma.qa_flowrateaudit,
+* pyaqsapi.byma.qa_flowrateverification,
+* pyaqsapi.byma.qa_one_point_qc,
+* pyaqsapi.byma.qa_pep_audit,
+* pyaqsapi.byma.transactionsample,
+* pyaqsapi.bypqao.qa_annualperformanceeval,
+* pyaqsapi.bypqao.qa_annualperformanceevaltransaction,
+* pyaqsapi.bypqao.qa_blanks,
+* pyaqsapi.bypqao.qa_collocated_assessments,
+* pyaqsapi.bypqao.qa_flowrateaudit,
+* pyaqsapi.bypqao.qa_flowrateverification,
+* pyaqsapi.bypqao.qa_one_point_qc,
+* pyaqsapi.bypqao.qa_pep_audit,
+* pyaqsapi.bysite.annualsummary,
+* pyaqsapi.bysite.dailysummary,
+* pyaqsapi.bysite.helperfunctions,
+* pyaqsapi.bysite.monitors,
+* pyaqsapi.bysite.qa_annualpeferomanceeval,
+* pyaqsapi.bysite.qa_annualperformanceevaltransaction,
+* pyaqsapi.bysite.qa_blanks,
+* pyaqsapi.bysite.qa_collocated_assessments,
+* pyaqsapi.bysite.qa_flowrateaudit,
+* pyaqsapi.bysite.qa_flowrateverification,
+* pyaqsapi.bysite.qa_one_point_qc,
+* pyaqsapi.bysite.qa_pep_audit,
+* pyaqsapi.bysite.quarterlysummary,
+* pyaqsapi.bysite.sampledata,
+* pyaqsapi.bysite.transactionsample,
+* pyaqsapi.bystate.annualsummary,
+* pyaqsapi.bystate.dailysummary,
+* pyaqsapi.bystate.helperfunctions,
+* pyaqsapi.bystate.monitors,
+* pyaqsapi.bystate.qa_annualperformanceeval,
+* pyaqsapi.bystate.qa_annualperformanceevaltransaction,
+* pyaqsapi.bystate.qa_blanks,
+* pyaqsapi.bystate.qa_collocated_assessments,
+* pyaqsapi.bystate.qa_flowrateaudit,
+* pyaqsapi.bystate.qa_flowrateverification,
+* pyaqsapi.bystate.qa_one_point_qc,
+* pyaqsapi.bystate.qa_pep_audit,
+* pyaqsapi.bystate.quarterlysummary,
+* pyaqsapi.bystate.sampledata,
+* pyaqsapi.bystate.transactionsample
+
pyaqsapi functions are named according to the service and filter variables that +are available by the AQS Data Mart API. Refer to Air Quality System (AQS) API for full details of the +AQS DataMart API.
+These are all the available variables that can be used with various functions +exported from the pyaqsapi library listed alphabetically. Not all of these +variables are used with every function, and not all of these parameters are +required. See the :ref: pyaqsapi functional families section to +see which parameters are used with each function.
+an object of type AQSAPI_V2 that is returned from pyaqsapi +aggregate functions wheen return_header is True.
+a date object which represents the begin date of the data selection. +Only data on or after this date will be returned.
+a date object which represents the “beginning date of last change” that +indicates when the data was last updated. cbdate is used to filter data +based on the change date. Only data that changed on or after this +date will be returned. This is an optional variable which defaults to None.
+a date object which represents the “end date of last change” that indicates +when the data was last updated. cedate is used to filter data based on the +change date. Only data that changed on or before this date will be +returned. This is an optional variable which defaults to None.
+a character object which represents the 3 digit state FIPS code for the +county being requested (with leading zero(s)). Refer to +aqs_counties_by_state() for a table of available county codes for each +state.
+a character string that represents the parameter duration code that limits +returned data to a specific sample duration. The default value of None +will result in no filtering based on duration code. Valid durations +include actual sample durations and not calculated durations such as 8 hour +CO or O3rolling averages, 3/6 day PM averages or Pb 3 month +rolling averages. Refer to aqs_sampledurations() for a table of all +available duration codes.
+a date object which represents the end date of the data selection. Only +data on or before this date will be returned.
+a character object which represents the email account that will be used to +register with the AQS API or change an existing user’s key. A verification +email will be sent to the account specified.
+a character object which represents the key used in conjunction with the +username given to connect to AQS Data Mart.
+a character object which represents the 4 digit AQS Monitoring Agency code +(with leading zeroes).
+a character object which represents the maximum latitude of a geographic +box. Decimal latitude with north begin positive. Only data south of this +latitude will be returned.
+a character object which represents the maximum longitude of a +geographic box. Decimal longitude with east being positive. Only +data west of this longitude will be returned. Note that -80 is less +than -70.
+a character object which represents the minimum latitude of a +geographic box. Decimal latitude with north being positive. +Only data north of this latitude will be returned.
+a character object which represents the minimum longitude of a +geographic box. Decimal longitude with east begin positive. Only +data east of this longitude will be returned.
+a character list or single character object which represents the parameter +code of the air pollutant related to the data being requested.
+If False (default) only returns data requested as a pandas DataFrame. If +True returns a AQSAPI_V2 object.
+a string which represents the services provided by the AQS API. For a list +of available services refer to +<https://aqs.epa.gov/aqsweb/documents/data_api.html#services>_ +for the complete listing of services available through the EPA +AQS Datamart API
+a character object which represents the 4 digit site number (with +leading zeros) within the county and state being requested.
+a character object which represents the 2 digit state FIPS code +(with leading zero) for the state being requested.
+a character object which represents the 4 digit AQS Primary Quality +Assurance Organization code (with leading zeroes).
+a character object which represents the email account that will be used to +connect to the AQS API.
+The functions included in this family of functions are:
+* aqs_credentials
+* aqs_sign_up
+
information to use with pyaqsapi. The aqs_sign_up function takes +one parameter:
+email:
The aqs_credentials function takes two parameters:
+username:
key:
The functions included in this family of functions are:
+* aqs_isavailable
+* aqs_knownissues
+* aqs_fields_by_service
+* aqs_revisionhistory
+
These functions return Data Mart meta data
+++The aqs_isavailable function takes no parameters and returns a +table which details the status of the AQS API.
+The aqs_fields_by_service function takes one parameter, service, +which is a character object which represents the services provided by +the AQS API. For a list of available services see +Air Quality System (AQS) API - Services Overview
+The aqs_knownissues function takes no parameters and Returns a +table of any known issues with system functionality or the data. These are +usually issues that have been identified internally and will require some +time to correct in Data Mart or the API. This function implements a direct +API call to Data Mart and returns data directly from the API. Issues +returned via this function do not include any issues from the pyaqsapi +package.
+The aqs_revisionhistory function is used to query Data Mart for the +change history to the API.
+
The functions included in this family of functions are:
+* aqs_cbsas,
+* aqs_classes,
+* aqs_counties_by_state,
+* aqs_fields_by_service,
+* aqs_isavailable,
+* aqs_knownissues,
+* aqs_mas,
+* aqs_parameters_by_class,
+* aqs_pqaos,
+* aqs_revisionhistory,
+* aqs_sampledurations,
+* aqs_sites_by_county,
+* aqs_states
+
++List functions return the API status, API options or groupings that can be +used in conjunction with other API calls. By default each function in this +category returns results as a DataTable. If return_header parameter is set +to True a AQSAPI_v2 object is returned instead.
+aqs_cbsas returns a table of all available Core Based Statistical +Areas (cbsas) and their respective cbsa codes.
+aqs_states takes no arguments and returns a table of the available +states and their respective state FIPS codes.
+aqs_sampledurations() +aqs_sampledurations takes no arguments and returns a table of the +available sample duration code used to construct other requests.
+aqs_classes takes no arguments and returns a table of parameter +classes (groups of parameters, i.e. “criteria” or “all”).
+aqs_counties_by_state() +aqs_counties_by_state takes one parameter, stateFIPS, which is a two +digit state FIPS code for the state being requested represented as a +character object and returns a table of counties and their +respective FIPS code for the state requested. Use aqs_states to +receive a table of valid state FIPS codes.
+aqs_sites_by_county takes two parameters, stateFIPS, which is a +two digit state FIPS code for the state being requested and county_code +which is a three digit county FIPS code for the county being requested, +both stateFIPS and county_code should be encoded as a character object. +This function returns a table of all air monitoring sites with the +requested state and county FIPS code combination.
+aqs_pqaos takes no parameters and returns an AQSAPI_V2 +object containing a table of primary quality assurance +organizations (pqaos).
+aqs_mas takes no parameters and returns an AQSAPI_V2 +object containing a table of monitoring agencies (MA).
+
Note
+AQS Data Mart API restricts the maximum amount of monitoring data to one +full year of data per API call. These functions are able to return multiple +years of data by making repeated calls to the API. Each call to the Data +Mart API will take time to complete. The more years of data being requested +the longer pyaqsapi will take to return the results.
+These functions retrieve aggregated data from the Data Mart API and are +grouped by how each function aggregates the data. There are 5 different +families of related aggregate functions. These families are arranged by how +the Data Mart API groups the returned data, bysite, bycounty, bystate, +by<latitude/longitude bounding box> (bybox) and +by<core based statistical area> (bycbsa). Within each family +of aggregated data functions there are functions that call on the 10 +different services that the Data Mart API provides. All Aggregate +functions return a pandas DataFrame by default. If the return_Header +parameter is set to True an AQSAPI_V2 object is returned instead.
+These fourteen services are:
+Returns operational information about the samplers (monitors) +used to collect the data. Includes identifying information, +operational dates, operating organizations, etc. Functions +using this service contain monitors in the function name.
+Returns sample data - the most fine grain data reported to +EPA. Usually hourly, sometimes 5-minute, 12-hour, etc. +This service is available in several geographic selections +based on geography: site, county, state, cbsa (core based +statistical area, a grouping of counties), or +by latitude/longitude bounding box. Functions using this +service contain sampledata in the function name. +All Sample Data functions accept two additional, optional +parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last +change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be +returned. This is an optional variable which defaults to +None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is +used to filter data based on the change date. Only data +that changed on or before this date will be returned. This +is an optional variable which defaults to None.
+- +
+
+- duration:
- +
an optional character string that represents the parameter +duration code that limits returned data to a specific sample +duration. The default value of None results in no filtering +based on duration code. Valid durations include actual sample +durations and not calculated durations such as 8 hour +CO or $O_3$ rolling averages, 3/6 day PM averages or +Pb 3 month rolling averages. Refer to +aqs_sampledurations() for a list of all available +duration codes.
+
Returns data summarized at the daily level. All daily +summaries are calculated on midnight to midnight basis in local time. +Variables returned include date, mean value, maximum value, etc. Functions +using this service contain Dailysummary in the function name. All Daily +Summary Data functions accept two additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last change” +that indicates when the data was last updated. cbdate is used to +filter data based on the change date. Only data that changed on or +after this date will be returned. This is an optional variable which +defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is +used to filter data based on the change date. Only data +that changed on or before this date will be returned. This +is an optional variable which defaults to None.
+
Returns data summarized at the yearly level. Variables include mean value, +maxima, percentiles, etc. Functions using this service contain annualdata +in the function name. All Annual Summary Data functions accept two +additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last +change” that indicates when the data was last updated. cbdate +is used to filter data based on the change date. Only data +that changed on or after this date will be returned. This is +an optional variable which defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is used +to filter data based on the change date. Only data that +changed on or before this date will be returned. This is an +optional variable which defaults to None.
+
Returns data summarized at the quarterly level. Variables include mean +value, maxima, percentiles, etc. Functions using this service +contain quarterlydata in the function name. All Annual Summary Data +functions accept two additional parameters; cbdate and cedate.
++++
+- +
+
+- cbdate:
- +
a date object which represents a “beginning date of last change” that +indicates when the data was last updated. cbdate is used to filter +data based on the change date. Only data that changed on or after +this date will be returned. This is an optional variable which +defaults to None.
+- +
+
+- cedate:
- +
a date object which represents an “end date of last change” +that indicates when the data was last updated. cedate is used +to filter data based on the change date. Only data that +changed on or before this date will be returned. This is an +optional variable which defaults to None.
+
Quality assurance data - blanks samples. Blanks are unexposed sample +collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Functions using this service contain +qa_blanks in the function name.
+Quality assurance data - collocated assessments. Collocated assessments +are pairs of samples collected by different samplers at the same time +and place. (These are “operational” samplers, assessments with +independently calibrated samplers are called “audits”.). Functions using +this service contain qa_collocated_assessments in the function name.
+Quality assurance data - flow rate verifications. Several times per year, +each PM monitor must have it’s (fixed) flow rate verified by an operator +taking a measurement of the flow rate. Functions using this service contain +qa_flowrateverification in the function name.
+Quality assurance data - flow rate audits. At least twice year, each PM +monitor must have it’s flow rate measurement audited by an expert using a +different method than is used for flow rate verifications. Functions using +this service contain qa_flowrateaudit in the function name.
+Quality assurance data - one point quality control check raw data. +At least every two weeks, certain gaseous monitors must be challenged with +a known concentration to determine monitor performance. Functions using +this service contain qa_one_point_qc in the function name.
+Quality assurance data - performance evaluation program (pep) audits. +Pep audits are independent assessments used to estimate total measurement +system bias with a primary quality assurance organization. Functions +using this service contain qa_pep_audit in the function name.
+Transaction sample data - The raw transaction sample data uploaded to AQS +by the agency responsible for data submissions in RD format. Functions +using this service contain transactionsample in the function name. +Transaction sample data is only available aggregated by site, county, +state or monitoring agency.
+Quality assurance data - Annual performance evaluations. A performance +evaluation must be conducted on each primary monitor once per year. The +percent differences between known and measured concentrations at several +levels are used to assess the quality of the monitoring data. Functions +using this service contain aqs_qa_annualperformanceeval in the function +name. Annual performance in transaction format are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization. Annual performance evaluations are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization.
+format (RD): +Quality assurance data - The raw transaction annual performance +evaluations data in RD format. Functions using this service contain +aqs_qa_annualperformanceevaltransaction in the function name. Annual +performance evaluations in transaction format are only available +aggregated by site, county, state, monitoring agency, and primary quality +assurance organization.
+The bysite submodule exports the following functions:
+* bysite.annualsummary,
+* bysite.dailysummary,
+* bysite.helperfunctions,
+* bysite.monitors,
+* bysite.qa_annualpeferomanceeval,
+* bysite.qa_annualperformanceevaltransaction,
+* bysite.qa_blanks,
+* bysite.qa_collocated_assessments,
+* bysite.qa_flowrateaudit,
+* bysite.qa_flowrateverification,
+* bysite.qa_one_point_qc,
+* bysite.qa_pep_audit,
+* bysite.quarterlysummary,
+* bysite.sampledata,
+* bysite.transactionsample
+
bysite functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
sitenum:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bycounty submodule exports the following functions:
+* bycounty.annualsummary,
+* bycounty.dailysummary,
+* bycounty.helperfunctions,
+* bycounty.monitors,
+* bycounty.qa_annualperformanceeval,
+* bycounty.qa_annualperformanceevaltransaction,
+* bycounty.qa_blanks,
+* bycounty.qa_collocated_assessments,
+* bycounty.qa_flowrateaudit,
+* bycounty.qa_flowrateverification,
+* bycounty.qa_one_point_qc,
+* bycounty.qa_pep_audit,
+* bycounty.quarterlysummary,
+* bycounty.sampledata,
+* bycounty.transactionsample
+
level. All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bystate submodule exports the following functions:
+* bystate.annualsummary,
+* bystate.dailysummary,
+* bystate.helperfunctions,
+* bystate.monitors,
+* bystate.qa_annualperformanceeval,
+* bystate.qa_annualperformanceevaltransaction,
+* bystate.qa_blanks,
+* bystate.qa_collocated_assessments,
+* bystate.qa_flowrateaudit,
+* bystate.qa_flowrateverification,
+* bystate.qa_one_point_qc,
+* bystate.qa_pep_audit,
+* bystate.quarterlysummary,
+* bystate.sampledata,
+* bystate.transactionsample
+
All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
countycode:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The byma submodule exports the following functions:
+* byma.qa_annualpeferomanceeval,
+* byma.qa_annualperformanceevaltransaction,
+* byma.qa_blanks,
+* byma.qa_collocated_assessments,
+* byma.qa_flowrateaudit,
+* byma.qa_flowrateverification,
+* byma.qa_one_point_qc,
+* byma.qa_pep_audit,
+* byma.transactionsample
+
All functions accept the following variables:
+parameter:
bdate:
edate:
stateFIPS:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata functions and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+Monitoring Agency (MA) level. All functions accept the following variables:
+parameter:
bdate:
edate:
MA_code:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bycbsa submodule exports the following functions:
+* bycbsa.annualsummary,
+* bycbsa.dailysummary,
+* bycbsa.helperfunctions,
+* bycbsa.monitors,
+* bycbsa.quarterlysummary,
+* bycbsa.sampledata
+
Statistical Area (cbsa, as defined by the US Census Bureau) level. +All functions accept the following variables:
+parameter:
bdate:
edate:
cbsa_code:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+The bypqao submodule exports the following functions:
+* bypqao.qa_annualperformanceeval,
+* bypqao.qa_annualperformanceevaltransaction,
+* bypqao.qa_blanks,
+* bypqao.qa_collocated_assessments,
+* bypqao.qa_flowrateaudit,
+* bypqao.qa_flowrateverification,
+* bypqao.qa_one_point_qc,
+* bypqao.qa_pep_audit
+
Primary Quality Assurance Organization (pqao) level. All functions accept +the following variables:
+parameter:
bdate:
edate:
pqao_code:
return_header (optional): set to False by default.
The bybox submodule exports the following functions:
+* bybox.annualsummary,
+* bybox.dailysummary,
+* bybox.helperfunctions,
+* bybox.monitors,
+* bybox.quarterlysummary,
+* bybox.sampledata
+
latitude/longitude bounding box (bybox) level. All functions accept the +following variables:
+parameter:
bdate:
edate:
minlat:
minlon:
maxlon:
maxlat:
(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+(This parameter is only used in conjunction with sampledata, dailysummary, +annualdata and quarterlysummary functions).
+set to False by default.
+(This parameter is only used in conjunction with sampledata functions).
+These are miscellaneous functions exported by pyaqsapi.
+aqs_removeheader is the function that the pyaqsapi library +uses internally to coerce an AQSAPI_V2 object into a pandas DataFrame. +This is useful if the user saves the output from another pyaqsapi function +with return_header = True set but later decides that they want just a +simple pandas DataFrame object. This function takes only one variable:
+AQSobject:
This section contains suggestions for completing certain data related tasks.
+Determine if or how much data exists for a time-parameter-geography +combination:
++++
+- +
Retrieve data using the annualdata service.
- +
If no records are returned, we do not have the data.
- +
If records are returned, use the observation count to determine the +temporal and geographic distribution of the data.
Monthly averages:
++++
+- +
AQS does not routinely calculate monthly aggregate statistics.
- +
If you need these, you must calculate them yourself.
- +
These can be calculated from the sample data or the daily data without +loss of fidelity.
Determine a single value for a site with collocated monitors:
++++
+- +
Many sites will have collocated monitors - monitors collecting the same +parameter at the same time.
- +
The API currently provides only monitor level values. (site-level values +will be added in the future.)
- +
For some criteria pollutants (PM2.5, ozone, lead, and NO2), the +regulations define procedures for defining a single site-level value.
- +
For other pollutants, determining a single site-level value is left to +the investigator.
Please adhere to the following when using the AQS Data Mart API:
++++
+- +
+
+- Limit the size of queries. The AQS Data Mart contains billions of
- +
values and you may request more than you intend. If you are unsure of +the amount of data, start small and work your way up. Please limit +queries to 1,000,000 rows of data each. You can use the +“observation count” field on the annualdata service to determine how +much data exists for a time-parameter-geography combination.
+- +
+
+- Limit the frequency of queries. The AQS Data Mart can process a limited
- +
load. Please wait for one request to complete before submitting another +and do not make more than 10 requests per minute.
+- +
Be advised that RAQSAPI is capable of retrieving results for multiple +pollutants, this can result in the amount of data being returned being +multiplied by the number of pollutants being requested.
- +
Be advised that the AQS Data Mart API limits certain data requests to +one year of data at a time with the exception of the Monitor service. +In order to retrieve multiple years of data for these functions the +RAQSAPI library conveniently sends multiple API requests to the Data Mart +API server, one request for each year, this can result in the amount of +data being returned being multiplied by the number of years of data being +requested.
The AQS Data Mart administrators may disable accounts without notice for +failure to adhere to these terms (Though they will contact the offending +user via the email address provided)
+annualsummary()
dailysummary()
monitors()
qa_annualperformanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
annualsummary()
dailysummary()
monitors()
qa_annualpeferomanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
annualsummary()
dailysummary()
monitors()
qa_annualperformanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
+ p | ||
+ |
+ pyaqsapi | + |
+ |
+ pyaqsapi.bybox | + |
+ |
+ pyaqsapi.bybox.bybox | + |
+ |
+ pyaqsapi.bycbsa | + |
+ |
+ pyaqsapi.bycbsa.bycbsa | + |
+ |
+ pyaqsapi.bycounty | + |
+ |
+ pyaqsapi.bycounty.bycounty | + |
+ |
+ pyaqsapi.byma | + |
+ |
+ pyaqsapi.byma.byma | + |
+ |
+ pyaqsapi.bypqao | + |
+ |
+ pyaqsapi.bypqao.bypqao | + |
+ |
+ pyaqsapi.bysite | + |
+ |
+ pyaqsapi.bysite.bysite | + |
+ |
+ pyaqsapi.bystate | + |
+ |
+ pyaqsapi.bystate.bystate | + |
+ |
+ pyaqsapi.helperfunctions | + |
+ |
+ pyaqsapi.listfunctions | + |
+ |
+ pyaqsapi.metadatafunctions | + |
+ |
+ pyaqsapi.setupfunctions | + |
Return a DataFrame of annual data aggregated by latitude/longitude +bounding box (_by_box).
+Annual summary contains a DataFrame matching the input parameter for the +rectangular area area bounded by minlat, maxlat, minlon, maxlon provided +for bdate - edate time frame. Variables returned include mean value, maxima, +percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (str)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing ozone annual summaries in the vicinity of +central Alabama for the first two days of May, 2015.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2015, month=5, day=1), +edate=date(year=2015, month=5, day=2), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Return a DataFrame of daily summary data aggregated by latitude/longitude +bounding box (_by_box).
+Daily summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (None | date)
cedate (None | date)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone daily summaries in the vicinity of +central Alabama for the first two days of May 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bybox.dailysummary(parameter="44201",
+ bdate=date(year=2015, month=5, day=1),
+ edate=date(year=2015, month=5, day=2),
+ minlat="33.3",
+ maxlat="33.6",
+ minlon="-87.0",
+ maxlon="-86.7")
+
Return a table of monitors.
+Return a table of monitors and related metadata sites with the provided +parameter, aggregated by latitude/longitude bounding box (_by_box) for +bdate - edate time frame.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
Examples
+Return a DataFrame of all ozone monitors in the vicinity of +central Alabama that operated in 1995.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=1995, month=1, day=1), +edate=date(year=1995, month=12, day=31), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Return a DataFrame of quarterly data aggregate by latitude/longitude +bounding box (_by_box).
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame containing ozone quarterly summaries +in the vicinity of central Alabama for each quarter in +between 2015 - 2017:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bybox.quarterlysummary(parameter="44201",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2017, month=12, day=31),
+ minlat="33.3",
+ maxlat="33.6",
+ minlon="-87.0",
+ maxlon="-86.7")
+
Return sample data where the data is aggregated by latitude/longitude +bounding box (_by_box).
+If return_header is FALSE (default) this function +returns a single DataFrame with the requested data. If return_header is +TRUE returns a list of AQSAPI_v2 objects
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing all ozone samples in the vicinity of +central Alabama between May 1, 2015 - May 2, 2017.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2015, month=5, day=1), +edate=date(year=2015, month=5, day=2), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Functions that aggregate data by box. +(by latitude/longitude bounding box).
+Return a DataFrame of annual data aggregated by latitude/longitude +bounding box (_by_box).
+Annual summary contains a DataFrame matching the input parameter for the +rectangular area area bounded by minlat, maxlat, minlon, maxlon provided +for bdate - edate time frame. Variables returned include mean value, maxima, +percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (str)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing ozone annual summaries in the vicinity of +central Alabama for the first two days of May, 2015.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2015, month=5, day=1), +edate=date(year=2015, month=5, day=2), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Return a DataFrame of daily summary data aggregated by latitude/longitude +bounding box (_by_box).
+Daily summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (None | date)
cedate (None | date)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone daily summaries in the vicinity of +central Alabama for the first two days of May 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bybox.dailysummary(parameter="44201",
+ bdate=date(year=2015, month=5, day=1),
+ edate=date(year=2015, month=5, day=2),
+ minlat="33.3",
+ maxlat="33.6",
+ minlon="-87.0",
+ maxlon="-86.7")
+
Return a table of monitors.
+Return a table of monitors and related metadata sites with the provided +parameter, aggregated by latitude/longitude bounding box (_by_box) for +bdate - edate time frame.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
Examples
+Return a DataFrame of all ozone monitors in the vicinity of +central Alabama that operated in 1995.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=1995, month=1, day=1), +edate=date(year=1995, month=12, day=31), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Return a DataFrame of quarterly data aggregate by latitude/longitude +bounding box (_by_box).
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame containing ozone quarterly summaries +in the vicinity of central Alabama for each quarter in +between 2015 - 2017:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bybox.quarterlysummary(parameter="44201",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2017, month=12, day=31),
+ minlat="33.3",
+ maxlat="33.6",
+ minlon="-87.0",
+ maxlon="-86.7")
+
Return sample data where the data is aggregated by latitude/longitude +bounding box (_by_box).
+If return_header is FALSE (default) this function +returns a single DataFrame with the requested data. If return_header is +TRUE returns a list of AQSAPI_v2 objects
+air pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data north of this latitude will be returned.
+of a geographic box. Decimal latitude with north begin positive. +Only data south of this latitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data east of this longitude will be returned.
+of a geographic box. Decimal longitude with east begin positive. +Only data west of this longitude will be returned. Note that -80 +is less than -70.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing all ozone samples in the vicinity of +central Alabama between May 1, 2015 - May 2, 2017.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2015, month=5, day=1), +edate=date(year=2015, month=5, day=2), +minlat=”33.3”, +maxlat=”33.6”, +minlon=”-87.0”, +maxlon=”-86.7”)
+Return a DataFrame of annual data aggregated at the Core Based +Statistical Area (cbsa) level.
+Annual summary contains a DataFrame matching the input parameter and +cbsa_code provided for bdate - edate time frame. Variables returned include +mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of annual summary NO2 +data the for Charlotte-Concord-Gastonia, NC cbsa on +January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.annualsummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return a DataFrame of data aggregated by Core Based Statistical Area +(cbsa).
+Daily summary contains a DataFrame matching the input parameter and +cbsa_code provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns a DataFrame of NO2 daily summary +data the for Charlotte-Concord-Gastonia, NC cbsa on +January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.dailysummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return a table of monitors.
+Return a table of monitors at all sites with the provided parameter, +aggregated by Core Based Statistical Area (CBSA) for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of NO2 monitors for the +Charlotte-Concord-Gastonia, NC cbsa that were operating +on January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.monitors(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return quarterly summary data aggregated by Core Based Statistical Area +(cbsa_code).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame of NO2 quarterly summary +data the for Charlotte-Concord-Gastonia, NC cbsa for +each quarter in 2017.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.quarterlysummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return sample data where the data is aggregated at the Core Based +Statistical Area (cbsa) level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a specific +sample duration. The default value of None results in +no filtering based on duration code.Valid durations include +actual sample durations and not calculated durations such as 8 +hour carbon monoxide or ozone rolling averages, 3/6 day PM +averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame which contains NO2 data +for Charlotte-Concord-Gastonia, NC cbsa for +January 1, 2015 - January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.sampledata(parameter="42602",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Functions that aggregate data by cbsa +(by Core Based Statistic Area, as defined by the Census Bureau).
+Return a DataFrame of annual data aggregated at the Core Based +Statistical Area (cbsa) level.
+Annual summary contains a DataFrame matching the input parameter and +cbsa_code provided for bdate - edate time frame. Variables returned include +mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of annual summary NO2 +data the for Charlotte-Concord-Gastonia, NC cbsa on +January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.annualsummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return a DataFrame of data aggregated by Core Based Statistical Area +(cbsa).
+Daily summary contains a DataFrame matching the input parameter and +cbsa_code provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns a DataFrame of NO2 daily summary +data the for Charlotte-Concord-Gastonia, NC cbsa on +January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.dailysummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return a table of monitors.
+Return a table of monitors at all sites with the provided parameter, +aggregated by Core Based Statistical Area (CBSA) for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of NO2 monitors for the +Charlotte-Concord-Gastonia, NC cbsa that were operating +on January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.monitors(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return quarterly summary data aggregated by Core Based Statistical Area +(cbsa_code).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame of NO2 quarterly summary +data the for Charlotte-Concord-Gastonia, NC cbsa for +each quarter in 2017.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.quarterlysummary(parameter="42602",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return sample data where the data is aggregated at the Core Based +Statistical Area (cbsa) level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Based Statistical Area code (the same as the census code, with +leading zeros)
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a specific +sample duration. The default value of None results in +no filtering based on duration code.Valid durations include +actual sample durations and not calculated durations such as 8 +hour carbon monoxide or ozone rolling averages, 3/6 day PM +averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame which contains NO2 data +for Charlotte-Concord-Gastonia, NC cbsa for +January 1, 2015 - January 01, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycbsa.sampledata(parameter="42602",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2017, month=1, day=1),
+ cbsa_code="16740")
+
Return a DataFrame of annual data aggregated at the county level.
+Annual summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns all FRM/FEM PM2.5 data for Wake County, NC between +January 1, 2015 - February 28, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.annualsummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183",
+ return_header=True)
+
Return a DataFrame of data aggregated at the county level.
+Daily summary contains a DataFrame matching the input parameter, stateFIPS +and county_code provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return an aqs S3 object of daily summary FRM/FEM PM2.5 data +for Wake County, NC between January and February 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.dailysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return a table of monitors.
+Return a table of monitors and related metadata at sites with the provided +parameter, stateFIPS and county_code for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return an DataFrame containing all SO2 monitors in +Hawaii County, HI that were operating on May 1, 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.monitors(parameter="42401",
+ bdate=date(year=2015,
+ month=5,
+ day=1),
+ edate=date(year=2015,
+ month=5,
+ day=2),
+ stateFIPS="15",
+ countycode="001")
+
Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, stateFIPS and countycode provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone in Baldwin County, AL for 2017 in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by county for a parameter code aggregated by matching +input parameter, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone in Baldwin County, AL for 2017 in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003")
+
Return a table of blank quality assurance data. +Blanks are unexposed sample collection devices (e.g., +filters) that are transported with the exposed sample devices +to assess if contamination is occurring during the transport +or handling of the samples. Data is aggregated at the county level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with PM2.5 blank data for +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_blanks(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table of collocated assessment data aggregated by matching input +parameter, stateFIPS and county_code provided for bdate - edate time +frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with collocated assessment data +for FRM PM2.5 in Madison County, AL for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="089")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by parameter +code, stateFIPS and countycode for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit data for +Jefferson County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing flow rate Verification data for a parameter code +aggregated matching input parameter, stateFIPS, and county_code, provided +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns a DataFrame of flow rate verification data for +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing flow rate audit data aggregated by parameter +code, stateFIPS and countycode for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit data for +Jefferson County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing quality assurance Performance Evaluation Program +(PEP) audit data aggregated by parameter code, stateFIPS and countycode for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of pep audit data +to be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame with PEP Audit data for FRM +PM2.5 in Madison County, AL for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="089")
+
Return a DataFrame of quarterly data aggregated at the county level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame containing quarterly summaries for +FRM/FEM PM2.5 data for Wake County, NC for each quarter of 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return sample data where the data is aggregated at the county level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+parameter duration code that limits returned data to a specific +sample duration. The default value of None results in +no filtering based on duration code.Valid durations include +actual sample durations and not calculated durations such as 8 +hour carbon monoxide or ozone rolling averages, 3/6 day PM +averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return all FRM/FEM PM2.5 data for Wake County, NC between +January 1, 2015 - February 28, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.sampledata(parameter="88101",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2016, month=2, day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return transactionsample data - aggregated by county in the AQS Submission +Transaction Format (RD) sample (raw) data for a parameter code aggregated +by matching input parameter, stateFIPS and countycode provided for +bdate - edate time frame. Includes data both in submitted and +standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return all FRM/FEM transaction data for +Wake County, NC on February 23, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.transactionsample(parameter="88101",
+ bdate=date(year=2016,
+ month=2,
+ day=28),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Functions that aggregate data by county.
+Return a DataFrame of annual data aggregated at the county level.
+Annual summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns all FRM/FEM PM2.5 data for Wake County, NC between +January 1, 2015 - February 28, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.annualsummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183",
+ return_header=True)
+
Return a DataFrame of data aggregated at the county level.
+Daily summary contains a DataFrame matching the input parameter, stateFIPS +and county_code provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return an aqs S3 object of daily summary FRM/FEM PM2.5 data +for Wake County, NC between January and February 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.dailysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return a table of monitors.
+Return a table of monitors and related metadata at sites with the provided +parameter, stateFIPS and county_code for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return an DataFrame containing all SO2 monitors in +Hawaii County, HI that were operating on May 1, 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.monitors(parameter="42401",
+ bdate=date(year=2015,
+ month=5,
+ day=1),
+ edate=date(year=2015,
+ month=5,
+ day=2),
+ stateFIPS="15",
+ countycode="001")
+
Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, stateFIPS and countycode provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone in Baldwin County, AL for 2017 in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by county for a parameter code aggregated by matching +input parameter, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone in Baldwin County, AL for 2017 in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003")
+
Return a table of blank quality assurance data. +Blanks are unexposed sample collection devices (e.g., +filters) that are transported with the exposed sample devices +to assess if contamination is occurring during the transport +or handling of the samples. Data is aggregated at the county level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with PM2.5 blank data for +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_blanks(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table of collocated assessment data aggregated by matching input +parameter, stateFIPS and county_code provided for bdate - edate time +frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with collocated assessment data +for FRM PM2.5 in Madison County, AL for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="089")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by parameter +code, stateFIPS and countycode for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit data for +Jefferson County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing flow rate Verification data for a parameter code +aggregated matching input parameter, stateFIPS, and county_code, provided +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Returns a DataFrame of flow rate verification data for +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing flow rate audit data aggregated by parameter +code, stateFIPS and countycode for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit data for +Jefferson County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033")
+
Return a table containing quality assurance Performance Evaluation Program +(PEP) audit data aggregated by parameter code, stateFIPS and countycode for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of pep audit data +to be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame with PEP Audit data for FRM +PM2.5 in Madison County, AL for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="089")
+
Return a DataFrame of quarterly data aggregated at the county level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS and county_code provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return a DataFrame containing quarterly summaries for +FRM/FEM PM2.5 data for Wake County, NC for each quarter of 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return sample data where the data is aggregated at the county level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+parameter duration code that limits returned data to a specific +sample duration. The default value of None results in +no filtering based on duration code.Valid durations include +actual sample durations and not calculated durations such as 8 +hour carbon monoxide or ozone rolling averages, 3/6 day PM +averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return all FRM/FEM PM2.5 data for Wake County, NC between +January 1, 2015 - February 28, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.sampledata(parameter="88101",
+ bdate=date(year=2015, month=1, day=1),
+ edate=date(year=2016, month=2, day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return transactionsample data - aggregated by county in the AQS Submission +Transaction Format (RD) sample (raw) data for a parameter code aggregated +by matching input parameter, stateFIPS and countycode provided for +bdate - edate time frame. Includes data both in submitted and +standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return all FRM/FEM transaction data for +Wake County, NC on February 23, 2016:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bycounty.transactionsample(parameter="88101",
+ bdate=date(year=2016,
+ month=2,
+ day=28),
+ edate=date(year=2016,
+ month=2,
+ day=28),
+ stateFIPS="37",
+ countycode="183")
+
Return quality assurance performance evaluation data - aggregated by +by Monitoring agency (MA) for a parameter code aggregated by matching input +parameter and MA_code for the time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone where the monitoring agency is the Alabama Department of +Environmental Management (MA_code 0013).:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_annualpeferomanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ MA_code="0013")
+
Return AQS submissions transaction format (RD) of the annual performance +evaluation data (raw). Includes data pairs for QA - aggregated by +Monitoring agency (MA) for a parameter code aggregated by matching input +parameter and MA_code provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone in where the MA is the Alabama Department of Environmental +Management (MA_code 0013) for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_annualperformanceevaltransactionA(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ MA_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by monitoring +agency code (MA_code).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (str)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing PM2.5 blank data in +January 2018 where the Monitoring Agency is the Alabama +Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_blanks(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ MA_code="0013")
+
Return a table of collocated assessment data aggregated by matching input +parameter, and monitoring agency (MA) code provided for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing collocated assessment +data for FRM PM2.5 January 2013 where the Monitoring Agency is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ MA_code="0013")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by parameter +code and monitoring agency code (_by_MA) for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of flow rate audit data +for FRM PM2.5 January 2016 - January 2018 where the Monitoring Agency is +the Jefferson County, AL Department of Health (agency 0550):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2016, month=1, day=1),
+ edate=date(year=2018, month=12, day=31),
+ MA_code="0550")
+
Return a table containing flow rate Verification data for a parameter code +aggregated by matching input parameter, and monitoring agency (MA) code +provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing collocated assessment +data for FRM PM2.5 January 2013 where the Monitoring Agency is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+qqs.byma.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ MA_code="0013")
+
Return a table one point QC check data aggregated by monitoring agency +code (_by_MA).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone One Point QC data +in January 2018 where the Monitoring Agency is the +Massachusetts Department of Environmental Protection (agency 0660):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ MA_code="0660")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by monitoring agency code (_by_MA) for the time frame between +bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of PEP audit data in June 2017 where the +Monitoring Agency is the Alabama Department +of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=6,
+ day=1),
+ edate=date(year=2017,
+ month=6,
+ day=30),
+ MA_code="0013")
+
Return transactionsample data - aggregated by Monitoring agency (MA) in +the AQS Submission Transaction Format (RD) sample (raw) data for a +parameter code aggregated by matching input parameter, and monitoring +agency (MA) code provided for bdate - edate time frame. Includes data both +in submitted and standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone transaction sample data for all monitors +operated by South Coast Air Quality Management District collected +on May 15, 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.transactionsample(parameter="44201",
+ bdate=date(year=2015, month=5, day=15),
+ edate=date(year=2015, month=5, day=15),
+ MA_code="0972")
+
Functions that aggregate data by ma (By Monitoring Agency).
+Return quality assurance performance evaluation data - aggregated by +by Monitoring agency (MA) for a parameter code aggregated by matching input +parameter and MA_code for the time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone where the monitoring agency is the Alabama Department of +Environmental Management (MA_code 0013).:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_annualpeferomanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ MA_code="0013")
+
Return AQS submissions transaction format (RD) of the annual performance +evaluation data (raw). Includes data pairs for QA - aggregated by +Monitoring agency (MA) for a parameter code aggregated by matching input +parameter and MA_code provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone in where the MA is the Alabama Department of Environmental +Management (MA_code 0013) for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_annualperformanceevaltransactionA(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ MA_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by monitoring +agency code (MA_code).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (str)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing PM2.5 blank data in +January 2018 where the Monitoring Agency is the Alabama +Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_blanks(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ MA_code="0013")
+
Return a table of collocated assessment data aggregated by matching input +parameter, and monitoring agency (MA) code provided for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing collocated assessment +data for FRM PM2.5 January 2013 where the Monitoring Agency is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ MA_code="0013")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by parameter +code and monitoring agency code (_by_MA) for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of flow rate audit data +for FRM PM2.5 January 2016 - January 2018 where the Monitoring Agency is +the Jefferson County, AL Department of Health (agency 0550):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2016, month=1, day=1),
+ edate=date(year=2018, month=12, day=31),
+ MA_code="0550")
+
Return a table containing flow rate Verification data for a parameter code +aggregated by matching input parameter, and monitoring agency (MA) code +provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing collocated assessment +data for FRM PM2.5 January 2013 where the Monitoring Agency is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+qqs.byma.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ MA_code="0013")
+
Return a table one point QC check data aggregated by monitoring agency +code (_by_MA).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone One Point QC data +in January 2018 where the Monitoring Agency is the +Massachusetts Department of Environmental Protection (agency 0660):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ MA_code="0660")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by monitoring agency code (_by_MA) for the time frame between +bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of PEP audit data in June 2017 where the +Monitoring Agency is the Alabama Department +of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=6,
+ day=1),
+ edate=date(year=2017,
+ month=6,
+ day=30),
+ MA_code="0013")
+
Return transactionsample data - aggregated by Monitoring agency (MA) in +the AQS Submission Transaction Format (RD) sample (raw) data for a +parameter code aggregated by matching input parameter, and monitoring +agency (MA) code provided for bdate - edate time frame. Includes data both +in submitted and standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Monitoring Agency code (with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (str)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of ozone transaction sample data for all monitors +operated by South Coast Air Quality Management District collected +on May 15, 2015:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.byma.transactionsample(parameter="44201",
+ bdate=date(year=2015, month=5, day=15),
+ edate=date(year=2015, month=5, day=15),
+ MA_code="0972")
+
Return quality assurance performance evaluation data - aggregated by +Primary Quality Assurance Organization (PQAO) for a parameter +code aggregated by matching input parameter and pqao_code for the +time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data +for ozone where the PQAO is the Alabama Department of +Environmental Management (pqao_code 0013).:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bypqao.qa_annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ pqao_code="0013")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by Primary Quality Assurance Organization (PQAO) +for a parameter code aggregated by matching input parameter and +pqao_code provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone in where the PQAO is the Alabama Department of +Environmental Management (pqao_code 0013) for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ pqao_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by Primary Quality +Assurance Organization (PQAO).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return DataFrame of PM2.5 blank data in January 2018 where the PQAO is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.aqs_qa_blanks(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ pqao_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by Primary Quality +Assurance Organization (PQAO).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Returns a DataFrame of collocated assessment +data for FRM PM2.5 in January 2013 where the PQAO is the Alabama +Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ moth=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ pqao_code="0013")
+
Return Quality assurance flowrate audit data.
+Return quality assurance flow rate audit data aggregated by parameter code +and Primary Quality Assurance Organization (PQAO) code for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of flow rate audit data for January +2018 where the PQAO is the Jefferson County, AL Department Of +Health (agency 0550).:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ pqao_code="0550")
+
Return a table containing flow rate Verification data for a parameter code +aggregated by matching input parameter, and Primary Quality Assurance +Organization (PQAO) code provided for bdate - edate time.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of collocated assessment +data for FRM PM2.5 in January 2013 where the PQAO is the Alabama +Department of Environmental Management (agency 0013):
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bypqao.aqs_qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ pqao_code="0013")
+
Return Quality assurance data - collocated assessment raw data aggregated +by Primary Quality Assurance Organization (PQAO) code.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFramee of flow rate audit data for January 2018 where the +PQAO is the Jefferson County, AL Department of Health (agency 0550):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ pqao_code="0550")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by Primary Quality Assurance Organization (PQAO) code for the +time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of PEP audit data in June 2017 where the pqao is the +Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017, month=6, day=1),
+ edate=date(year=2017, month=6, day=30),
+ pqao_code="0013")
+
Functions that aggregate data by pqao +(By Primary Quality Assurance Organization).
+Return quality assurance performance evaluation data - aggregated by +Primary Quality Assurance Organization (PQAO) for a parameter +code aggregated by matching input parameter and pqao_code for the +time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data +for ozone where the PQAO is the Alabama Department of +Environmental Management (pqao_code 0013).:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bypqao.qa_annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ pqao_code="0013")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by Primary Quality Assurance Organization (PQAO) +for a parameter code aggregated by matching input parameter and +pqao_code provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing annual performance evaluation data for +ozone in where the PQAO is the Alabama Department of +Environmental Management (pqao_code 0013) for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ pqao_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by Primary Quality +Assurance Organization (PQAO).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return DataFrame of PM2.5 blank data in January 2018 where the PQAO is +the Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.aqs_qa_blanks(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ pqao_code="0013")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during the +transport or handling of the samples. Data is aggregated by Primary Quality +Assurance Organization (PQAO).
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Returns a DataFrame of collocated assessment +data for FRM PM2.5 in January 2013 where the PQAO is the Alabama +Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ moth=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ pqao_code="0013")
+
Return Quality assurance flowrate audit data.
+Return quality assurance flow rate audit data aggregated by parameter code +and Primary Quality Assurance Organization (PQAO) code for bdate - edate +time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of flow rate audit data for January +2018 where the PQAO is the Jefferson County, AL Department Of +Health (agency 0550).:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ pqao_code="0550")
+
Return a table containing flow rate Verification data for a parameter code +aggregated by matching input parameter, and Primary Quality Assurance +Organization (PQAO) code provided for bdate - edate time.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of collocated assessment +data for FRM PM2.5 in January 2013 where the PQAO is the Alabama +Department of Environmental Management (agency 0013):
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bypqao.aqs_qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ pqao_code="0013")
+
Return Quality assurance data - collocated assessment raw data aggregated +by Primary Quality Assurance Organization (PQAO) code.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFramee of flow rate audit data for January 2018 where the +PQAO is the Jefferson County, AL Department of Health (agency 0550):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ pqao_code="0550")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by Primary Quality Assurance Organization (PQAO) code for the +time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+Primary Quality Assurance Organization code +(with leading zeroes).
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of PEP audit data in June 2017 where the pqao is the +Alabama Department of Environmental Management (agency 0013):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bypqao.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017, month=6, day=1),
+ edate=date(year=2017, month=6, day=30),
+ pqao_code="0013")
+
Return a DataFrame of annual data aggregated at the site level.
+Annual summary contains a DataFrame matching the input parameter, +stateFIPS, county_code, and sitenum provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of annualsummary data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a table of annual summary ozone data for the Millbrook School +site (#0014) in Wake County, NC for 2017 (Note, for annual data, only +the year portion of the bdate and edate are used and only whole +years of data are returned. For example, bdate = 2017-12-31 and +edate = 2018-01-01 will return full data for 2017 and 2018 ):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.annualsummary(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a DataFrame of data aggregated at the site level.
+Daily summary contains a DataFrame matching the input parameter, stateFIPS, +county_code, and sitenum provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Notes
+The AQS API only allows for a single year of dailysummary data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of daily summary ozone data for the Millbrook School +site (#0014) in Wake County, NC for June 18, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.dailysummary(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of monitors.
+with the provided parameter, stateFIPS, county_code, and sitenum +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+All monitors that operated between the bdate and edate will be returned
+Examples
+Return a table of all SO2 monitors at the Hawaii NP site (#0007) in +Hawaii County, HI that were operating between May 1 2015-2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.monitors(parameter="42401",
+ bdate=date(year=2015,
+ month=5,
+ day=1,),
+ edate=date(year=2019,
+ month=5,
+ day=2),
+ stateFIPS="15",
+ countycode="001",
+ sitenum="0007")
+
Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, sitenum, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quality assurance +Annual Performance Evaluation data to be retrieved at a time. This +function conveniently extracts date information from the bdate and edate +parameters then makes repeated calls to the AQSAPI retrieving a maximum of +one calendar year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return an DataFrame containing annual performance evaluation data for +ozone at the Fairhope site in Baldwin County, AL for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.annualpeferomanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003",
+ sitenum="0010")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by site for a parameter code aggregated by matching +input parameter, sitenum, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quality assurance +Annual Performance Evaluation transaction data to be retrieved at a time. +This function conveniently extracts date information from the bdate and +edate parameters then makes repeated calls to the AQSAPI retrieving a +maximum of one calendar year of data at a time. Each calendar year of data +requires a separate API call so multiple years of data will require +multiple API calls. As the number of years of data being requested +increases so does the length of time that it will take to retrieve results. +There is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone at the Fairhope site in Baldwin County, AL for 2017 +in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_annualperformanceevaltransaction(parameter = "44201",
+ bdate = date(year=2017,
+ month=1,
+ day=1),
+ edate = date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS = "01",
+ countycode = "003",
+ sitenum = "0010")
+
Return a table of blank quality assurance data. +Blanks are unexposed sample collection devices (e.g., +filters) that are transported with the exposed sample devices +to assess if contamination is occurring during the transport +or handling of the samples. Data is aggregated at the site level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of qa_blank data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a table of PM2.5 blank data for the Muscle Shoals site (#0014) in +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_blanks(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033",
+ sitenum="1002")
+
Return a table of collocated assessment data aggregated by matching +input parameter, stateFIPS, county_code, and sitenum provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of collocated assessments +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of collocated assessment data for FRM PM2.5 at the +Huntsville Old Airport site (#0014) in Madison County, AL +for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1,
+ ),
+ edate=date(year=2013,
+ month=1,
+ day=31,
+ ),
+ stateFIPS="01",
+ countycode="089",
+ sitenum="0014")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by +parameter code, stateFIPS, countycode and site number for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate audit data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Returns a table of all SO2 monitors at the Hawaii NP site (#0007) in +Hawaii County, HI that were operating on May 1, 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of containing flow rate verification data aggregated by +matching input parameter, stateFIPS, county_code, and sitenum provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate verifications +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of flow rate verification +data for the Muscle Shoals site (#1002) in Colbert County, AL +for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="25",
+ countycode="001",
+ sitenum="0002")
+
Return a table of one point QC raw data aggregated +by parameter code, stateFIPS, countycode and site number.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate audit data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Returns a One Point QC data for ozone at the Truro National Seashore +site (#0002) in Barnstable County, MA in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="25",
+ countycode="001",
+ sitenum="0002")
+
Return a table of Performance Evaluation Program (PEP) audit +data aggregated by parameter code, stateFIPS, countycode and +site number for the time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of pep audit data +to be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of pep Audit data for FRM PM2.5 +at the Huntsville Old Airport site (#0014) in Madison County, AL +for 2017 - 2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2019,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="089",
+ sitenum="0014")
+
Return a DataFrame of quarterly data aggregated at the site level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS, county_code, and sitenum provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return DataFrame containing quarterly summaries for FRM/FEM PM2.5 data +for Millbrook School in Wake County, NC for each quarter of 2016.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.aqs_quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=1,
+ day=31),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return sample data where the data is aggregated at the site level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of sampledata to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of ozone monitoring data for the +Millbrook School site (/#0014) in Wake County, NC for June 18, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.sampledata(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of Returns transactionsample data aggregated by site +in the AQS Submission Transaction Format (RD) sample (raw) data aggregated +by matching input parameter, stateFIPS, county_code, and sitenum provided +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of transaction data +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return all ozone transaction data for the Millbrook School site (#0014) +in Wake County, NC for June 18, 2017:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bysite.transactionsample(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18,),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
pyaqsapi Functions that aggregate data by site.
+Return a DataFrame of annual data aggregated at the site level.
+Annual summary contains a DataFrame matching the input parameter, +stateFIPS, county_code, and sitenum provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of annualsummary data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a table of annual summary ozone data for the Millbrook School +site (#0014) in Wake County, NC for 2017 (Note, for annual data, only +the year portion of the bdate and edate are used and only whole +years of data are returned. For example, bdate = 2017-12-31 and +edate = 2018-01-01 will return full data for 2017 and 2018 ):
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.annualsummary(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a DataFrame of data aggregated at the site level.
+Daily summary contains a DataFrame matching the input parameter, stateFIPS, +county_code, and sitenum provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Notes
+The AQS API only allows for a single year of dailysummary data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of daily summary ozone data for the Millbrook School +site (#0014) in Wake County, NC for June 18, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.dailysummary(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of monitors.
+with the provided parameter, stateFIPS, county_code, and sitenum +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+All monitors that operated between the bdate and edate will be returned
+Examples
+Return a table of all SO2 monitors at the Hawaii NP site (#0007) in +Hawaii County, HI that were operating between May 1 2015-2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.monitors(parameter="42401",
+ bdate=date(year=2015,
+ month=5,
+ day=1,),
+ edate=date(year=2019,
+ month=5,
+ day=2),
+ stateFIPS="15",
+ countycode="001",
+ sitenum="0007")
+
Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, sitenum, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quality assurance +Annual Performance Evaluation data to be retrieved at a time. This +function conveniently extracts date information from the bdate and edate +parameters then makes repeated calls to the AQSAPI retrieving a maximum of +one calendar year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return an DataFrame containing annual performance evaluation data for +ozone at the Fairhope site in Baldwin County, AL for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.annualpeferomanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="003",
+ sitenum="0010")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by site for a parameter code aggregated by matching +input parameter, sitenum, countycode and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quality assurance +Annual Performance Evaluation transaction data to be retrieved at a time. +This function conveniently extracts date information from the bdate and +edate parameters then makes repeated calls to the AQSAPI retrieving a +maximum of one calendar year of data at a time. Each calendar year of data +requires a separate API call so multiple years of data will require +multiple API calls. As the number of years of data being requested +increases so does the length of time that it will take to retrieve results. +There is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame containing annual performance evaluation data (raw) +for ozone at the Fairhope site in Baldwin County, AL for 2017 +in RD format:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_annualperformanceevaltransaction(parameter = "44201",
+ bdate = date(year=2017,
+ month=1,
+ day=1),
+ edate = date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS = "01",
+ countycode = "003",
+ sitenum = "0010")
+
Return a table of blank quality assurance data. +Blanks are unexposed sample collection devices (e.g., +filters) that are transported with the exposed sample devices +to assess if contamination is occurring during the transport +or handling of the samples. Data is aggregated at the site level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of qa_blank data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a table of PM2.5 blank data for the Muscle Shoals site (#0014) in +Colbert County, AL for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_blanks(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01",
+ countycode="033",
+ sitenum="1002")
+
Return a table of collocated assessment data aggregated by matching +input parameter, stateFIPS, county_code, and sitenum provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of collocated assessments +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of collocated assessment data for FRM PM2.5 at the +Huntsville Old Airport site (#0014) in Madison County, AL +for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1,
+ ),
+ edate=date(year=2013,
+ month=1,
+ day=31,
+ ),
+ stateFIPS="01",
+ countycode="089",
+ sitenum="0014")
+
Return Quality assurance flowrate audit data.
+Return a table containing flow rate audit data aggregated by +parameter code, stateFIPS, countycode and site number for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate audit data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Returns a table of all SO2 monitors at the Hawaii NP site (#0007) in +Hawaii County, HI that were operating on May 1, 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of containing flow rate verification data aggregated by +matching input parameter, stateFIPS, county_code, and sitenum provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate verifications +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of flow rate verification +data for the Muscle Shoals site (#1002) in Colbert County, AL +for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="25",
+ countycode="001",
+ sitenum="0002")
+
Return a table of one point QC raw data aggregated +by parameter code, stateFIPS, countycode and site number.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of flow rate audit data to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Returns a One Point QC data for ozone at the Truro National Seashore +site (#0002) in Barnstable County, MA in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="25",
+ countycode="001",
+ sitenum="0002")
+
Return a table of Performance Evaluation Program (PEP) audit +data aggregated by parameter code, stateFIPS, countycode and +site number for the time frame between bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of pep audit data +to be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of pep Audit data for FRM PM2.5 +at the Huntsville Old Airport site (#0014) in Madison County, AL +for 2017 - 2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2019,
+ month=12,
+ day=31),
+ stateFIPS="01",
+ countycode="089",
+ sitenum="0014")
+
Return a DataFrame of quarterly data aggregated at the site level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS, county_code, and sitenum provided for bdate - edate time frame. +Variables returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return DataFrame containing quarterly summaries for FRM/FEM PM2.5 data +for Millbrook School in Wake County, NC for each quarter of 2016.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.aqs_quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2016,
+ month=1,
+ day=31),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return sample data where the data is aggregated at the site level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of sampledata to +be retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return a DataFrame of ozone monitoring data for the +Millbrook School site (/#0014) in Wake County, NC for June 18, 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bysite.sampledata(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a table of Returns transactionsample data aggregated by site +in the AQS Submission Transaction Format (RD) sample (raw) data aggregated +by matching input parameter, stateFIPS, county_code, and sitenum provided +for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+number (with leading zeros) within the county and state +being requested.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
sitenum (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of transaction data +data to be retrieved at a time. This function conveniently extracts +date information from the bdate and edate parameters then makes +repeated calls to the AQSAPI retrieving a maximum of one calendar +year of data at a time. Each calendar year of data requires a +separate API call so multiple years of data will require multiple API +calls. As the number of years of data being requested increases so +does the length of time that it will take to retrieve results. There +is also a 5 second wait time inserted between successive API calls to +prevent overloading the API server. This operation has a linear run +time of /(Big O notation: O/(n + 5 seconds/)/).
+Examples
+Return all ozone transaction data for the Millbrook School site (#0014) +in Wake County, NC for June 18, 2017:
+from datetime import date
+import pyaqsapi as aqs
+...
+aqs.bysite.transactionsample(parameter="44201",
+ bdate=date(year=2017,
+ month=6,
+ day=18),
+ edate=date(year=2017,
+ month=6,
+ day=18,),
+ stateFIPS="37",
+ countycode="183",
+ sitenum="0014")
+
Return a DataFrame of annual data aggregated at the state level.
+Annual summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables returned include +mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with all benzene samples from +North Carolina collected from May 15th, 1995 - May 15, 1999:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.annualsummary(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1999, month=5, day=15),
+ stateFIPS="37")
+
Return a DataFrame of data aggregated at the state level.
+Daily summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of all benzene daily +summaries from North Carolina collected on May 15th, 1995:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.dailysummary(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1995, month=5, day=15),
+ stateFIPS="37")
+
Return a table of monitors.
+Return a table of monitors and related metadata at all sites +with the provided parameter and stateFIPS for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+selected state.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of SO2 monitors in Hawaii that were operating on +May 01, 2017.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2017, month=1, day=1), +edate=date(year=2017, month=12, day=31), +stateFIPS=”01”)
+Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, and stateFIPS provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation +data for ozone in Alabama for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by county for a parameter code aggregated by matching +input parameter and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data +for ozone in Alabama for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during +the transport or handling of the samples. Data is aggregated at the state +level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame which contains PM2.5 blank data +for Alabama for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_blanks(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1999, month=5, day=15),
+ stateFIPS="37")
+
Return a table of collocated assessment data aggregated by matching input +parameter and stateFIPS provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of collocated +assessment data for FRM2.5 for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ stateFIPS="01")
+
Return Quality assurance flowrate audit data.
+Return a table of monitors and related metadata at all sites +with the provided parameter and stateFIPS for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+selected state.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit +data for Alabama in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01")
+
Return a table containing flow rate Verification data for a parameter code +aggregated matching input parameter, and stateFIPS, provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate verification data for the state of +Alabama for 2017-2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2019,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return a DataFrame or an AQS_Data Mart_APIv2 S3 object containing Quality +assurance data - flow rate audit raw data aggregated by state FIPS for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of one point QC check +data for ozone in Massachusetts in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ stateFIPS="25")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by parameter code, and stateFIPS for the time frame between +bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of PEP audit data for PM2.5 in Alabama 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=12, day=31),
+ stateFIPS="01")
+
Return a DataFrame of quarterly data aggregated at the state level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS a provided for bdate - edate time frame. Variables returned +include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return an aqs S3 object containing quarterly summaries for +FRM/FEM PM2.5 data for North Carolina for each quarter of 2016-2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="37")
+
Return sample data where the data is aggregated at the state level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
duration (None | str)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with all benzene samples from +North Carolina collected from May 15th, 1995 - May 15, 1999:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.sampledata(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1995, month=5, day=15),
+ stateFIPS="37")
+
Return transactionsample data - aggregated by state in the AQS Submission +Transaction Format (RD) sample (raw) data for a parameter code aggregated +by matching input parameter, and stateFIPS provided for bdate - edate time +frame. Includes data both in submitted and standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing benzene transaction sample data for +North Carolina on May 15, 1995:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.transactionsample(parameter="45201",
+ bdate=date(year=1995,
+ month=5,
+ day=15),
+ edate=date(year=1995,
+ month=5,
+ day=15),
+ stateFIPS="37")
+
Functions that aggregated data by state.
+Return a DataFrame of annual data aggregated at the state level.
+Annual summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables returned include +mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with all benzene samples from +North Carolina collected from May 15th, 1995 - May 15, 1999:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.annualsummary(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1999, month=5, day=15),
+ stateFIPS="37")
+
Return a DataFrame of data aggregated at the state level.
+Daily summary contains a DataFrame matching the input parameter and +stateFIPS provided for bdate - edate time frame. Variables +returned include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of all benzene daily +summaries from North Carolina collected on May 15th, 1995:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.dailysummary(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1995, month=5, day=15),
+ stateFIPS="37")
+
Return a table of monitors.
+Return a table of monitors and related metadata at all sites +with the provided parameter and stateFIPS for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+selected state.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of SO2 monitors in Hawaii that were operating on +May 01, 2017.
+import pyaqsapi as aqs +from datetime import date
+bdate=date(year=2017, month=1, day=1), +edate=date(year=2017, month=12, day=31), +stateFIPS=”01”)
+Return quality assurance performance evaluation data - aggregated by +site for a parameter code aggregated by matching input +parameter, and stateFIPS provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation +data for ozone in Alabama for 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_annualperformanceeval(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return AQS submissions transaction format (RD) of the annual +performance evaluation data (raw). Includes data pairs for +QA - aggregated by county for a parameter code aggregated by matching +input parameter and stateFIPS provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing annual performance evaluation data +for ozone in Alabama for 2017 in RD format.:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_annualperformanceevaltransaction(parameter="44201",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return a table of blank quality assurance data. Blanks are unexposed +sample collection devices (e.g., filters) that are transported with the +exposed sample devices to assess if contamination is occurring during +the transport or handling of the samples. Data is aggregated at the state +level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame which contains PM2.5 blank data +for Alabama for January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_blanks(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1999, month=5, day=15),
+ stateFIPS="37")
+
Return a table of collocated assessment data aggregated by matching input +parameter and stateFIPS provided for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of collocated +assessment data for FRM2.5 for January 2013:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_collocated_assessments(parameter="88101",
+ bdate=date(year=2013,
+ month=1,
+ day=1),
+ edate=date(year=2013,
+ month=1,
+ day=31),
+ stateFIPS="01")
+
Return Quality assurance flowrate audit data.
+Return a table of monitors and related metadata at all sites +with the provided parameter and stateFIPS for bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+selected state.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate audit +data for Alabama in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_flowrateaudit(parameter="88101",
+ bdate=date(year=2018,
+ month=1,
+ day=1),
+ edate=date(year=2018,
+ month=1,
+ day=31),
+ stateFIPS="01")
+
Return a table containing flow rate Verification data for a parameter code +aggregated matching input parameter, and stateFIPS, provided for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of flow rate verification data for the state of +Alabama for 2017-2019:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_flowrateverification(parameter="88101",
+ bdate=date(year=2017,
+ month=1,
+ day=1),
+ edate=date(year=2019,
+ month=12,
+ day=31),
+ stateFIPS="01")
+
Return a DataFrame or an AQS_Data Mart_APIv2 S3 object containing Quality +assurance data - flow rate audit raw data aggregated by state FIPS for +bdate - edate time frame.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of one point QC check +data for ozone in Massachusetts in January 2018:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_one_point_qc(parameter="44201",
+ bdate=date(year=2018, month=1, day=1),
+ edate=date(year=2018, month=1, day=31),
+ stateFIPS="25")
+
Return a table of Performance Evaluation Program (PEP) audit data +aggregated by parameter code, and stateFIPS for the time frame between +bdate and edate.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame of PEP audit data for PM2.5 in Alabama 2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.qa_pep_audit(parameter="88101",
+ bdate=date(year=2017, month=1, day=1),
+ edate=date(year=2017, month=12, day=31),
+ stateFIPS="01")
+
Return a DataFrame of quarterly data aggregated at the state level.
+Quarterly summary contains a DataFrame matching the input parameter, +stateFIPS a provided for bdate - edate time frame. Variables returned +include mean value, maxima, percentiles, and etc.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Notes
+The AQS API only allows for a single year of quarterly summary to be +retrieved at a time. This function conveniently extracts date +information from the bdate and edate parameters then makes repeated +calls to the AQSAPI retrieving a maximum of one calendar year of data +at a time. Each calendar year of data requires a separate API call so +multiple years of data will require multiple API calls. As the number +of years of data being requested increases so does the length of time +that it will take to retrieve results. There is also a 5 second wait +time inserted between successive API calls to prevent overloading the +API server. This operation has a linear run time of +/(Big O notation: O/(n + 5 seconds/)/).
+Also Note that for quarterly data, only the year portion of the bdate +and edate are used and all 4 quarters in the year are returned.
+Examples
+Return an aqs S3 object containing quarterly summaries for +FRM/FEM PM2.5 data for North Carolina for each quarter of 2016-2017:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.quarterlysummary(parameter="88101",
+ bdate=date(year=2016,
+ month=1,
+ day=1),
+ edate=date(year=2017,
+ month=12,
+ day=31),
+ stateFIPS="37")
+
Return sample data where the data is aggregated at the state level.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+parameter duration code that limits returned data to a +specific sample duration. The default value of None results +in no filtering based on duration code.Valid durations +include actual sample durations and not calculated durations +such as 8 hour carbon monoxide or ozone rolling averages, +3/6 day PM averages or lead 3 month rolling averages. Use +aqs_sampledurations() for a list of all available +duration codes.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
duration (None | str)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame with all benzene samples from +North Carolina collected from May 15th, 1995 - May 15, 1999:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.sampledata(parameter="45201",
+ bdate=date(year=1995, month=5, day=15),
+ edate=date(year=1995, month=5, day=15),
+ stateFIPS="37")
+
Return transactionsample data - aggregated by state in the AQS Submission +Transaction Format (RD) sample (raw) data for a parameter code aggregated +by matching input parameter, and stateFIPS provided for bdate - edate time +frame. Includes data both in submitted and standard units.
+which represents the parameter code of the air +pollutant related to the data being requested.
+selection. Only data on or after this date will be returned.
+selection. Only data on or before this date will be returned.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+last change” that indicates when the data was last updated. +cbdate is used to filter data based on the change date. +Only data that changed on or after this date will be returned. +This is an optional variable which defaults to None.
+change” that indicates when the data was last updated. +cedate is used to filter data based on the change date. +Only data that changed on or before this date will be +returned. This is an optional variable which defaults +to None.
+returns a AQSAPI_v2 object.
+parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (None | date)
cedate (None | date)
return_header (bool | None)
AQSAPI_V2 | DataFrame
+Examples
+Return a DataFrame containing benzene transaction sample data for +North Carolina on May 15, 1995:
+import pyaqsapi as aqs
+from datetime import date
+...
+aqs.bystate.transactionsample(parameter="45201",
+ bdate=date(year=1995,
+ month=5,
+ day=15),
+ edate=date(year=1995,
+ month=5,
+ day=15),
+ stateFIPS="37")
+
annualsummary()
dailysummary()
monitors()
qa_annualperformanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
annualsummary()
dailysummary()
monitors()
qa_annualpeferomanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
annualsummary()
dailysummary()
monitors()
qa_annualperformanceeval()
qa_annualperformanceevaltransaction()
qa_blanks()
qa_collocated_assessments()
qa_flowrateaudit()
qa_flowrateverification()
qa_one_point_qc()
qa_pep_audit()
quarterlysummary()
sampledata()
transactionsample()
helperfunctions.
+Bases: object
++AQSAPI_V2 class used to store and retrieve data from the EPA AQS +Datamart API.
+++# for some reason Sphinx does not like this Attributes section so it is +# commented out, for now.
+# Attributes +# ———- +# _header (pandas DataFrame): header information returned from the +# AQS Datamart API. +# _request_time (str): the time stamp that the call to the AQS Datamart +# API was received. +# _status (str): the status (associated with the _status_code) returned +# from a call to the AQS Datamart API. +# _status_code (str): the numeric status_code (represented as a string) +# that is returned from a call to the AQS Datamart API. +# _rows (str): the number of rows contained in the _data. +# _url (str): a string representing the URL used to make the AQS Datamart +# API call. +# _data (pandas DataFrame): the data returned from a call to the +# AQS Datamart API.
+
Methods
+set_data(): |
++ |
set_header(): |
++ |
get_data(): |
++ |
get_header(): |
++ |
get_status_code(): |
++ |
get_header(): |
++ |
get_url(): |
++ |
get_header(): |
++ |
get_request_time(): |
++ |
Return the Data portion of the AQSAPI_V2 instance.
+DataFrame
+Return the Header portion of the AQSAPI_V2 instance.
+DataFrame
+Retrieve the time that the request to the AQS DataMart API was made.
+str
+Retrieve the status code from the API call.
+str
+Retrieve the URL of the AQS DataMart API request.
+str
+Set the Data of a single AQSAPI_V2 object.
+Data must be a pandas DataFrame.
+Data (DataFrame)
+None
+Set the header of a single AQSAPI_V2 object. Header must be a +pandas DataFrame.
+A pandas.DataFrame instance with the header information.
+Header (DataFrame)
+None
+Set the user credentials for the AQS API. This function +needs to be called once and only once every time this library +is re-loaded. Users must have a valid username and key which +can be obtained through the use of the aqs_sign_up function, +use pyaqsapi.aqs_sign_up() to sign up for AQS data mart credentials.
+that will be used to connect to the AQS API.
+AQS Data Mart.
+username (None | str)
key (None | str)
None
+Coerces a single AQS_Data_Mart_APIv2 instance or a list of +AQS_Data_Mart_APIv2 instance into a single DataFrame object. +This function decouples the Data from the AQSAPI_v2 object and returns +only the Data portion as a DataFrame. If the input is a list of AQSAPI_v2 +objects combines the Data portion of each AQS_Data_Mart_APIv2 object +into a DataFrame with Header information discarded. +Else returns the input with no changes.
+ +listfunctions.
+Return a table of all Core Based Statistical Areas (cbsa) and their +associated cbsa_codes.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of Core Based Statistical Areas (cbsas) +and their respective cbsa codes:
+aqs_cbsas()
+
Return a table of Parameter classes (groups of parameters, i.e. “criteria” +or “all”). The information from this function can be used as input to other +API calls.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of parameter classes (groups of parameters, i.e. +“criteria” or all”):
+aqs_classes()
+
Return a table of all counties in within the stateFIPS provided.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+returns a AQSAPI_v2 object.
+stateFIPS (str)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Returns a DataFrame of all the counties +in North Carolina the county FIPS codes (county codes) for each.:
+aqs_counties_by_state(stateFIPS = "37")
+
service requested.
+API. For a list of available services refer to +https://aqs.epa.gov/aqsweb/documents/data_api.html#services
+returns a AQSAPI_v2 object.
+API.
+service (str)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame containing a list and definitions +of fields in the Sample Data service.:
+aqs_fieldsbyservice(service = "sampleData")
+
Return a table explaining the status of the AQS API.
+returns a AQSAPI_v2 object.
+API.
+return_header (bool | None)
+AQSAPI_V2 | DataFrame
+Examples
+Check if the AQS API is up, running and accepting requests.:
+aqs_isAvailable()
+
Return a table of any known issues with system functionality or the data. +These are usually issues that have been identified internally and will +require some time to correct in Data Mart or the API. This function +implements a direct API call to Data Mart and returns data directly from +the API. Issues returned via this function do not include any issues from +the pyaqsapi python package.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Retrieve a DataFrame of known issues directly from the AQS data mart API:
+aqs_knownissues()
+
Return a DataFrame of monitoring agencies (MA).
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Returns a DataFrame of monitoring agencies and their respective +monitoring agency codes.:
+aqs_mas()
+
Return a table of Parameter classes (groups of parameters, i.e. “criteria” +or “all”). The information from this function can be used as input to other +API calls.
+requested, use aqs_classes() for retrieving available +classes. The parameterclass python character object must be +a valid parameterclass as returned from aqs_classes(). +The class must be an exact match to what is returned from +aqs_classes().
+returns a AQSAPI_v2 object.
+parameterclass (str)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of parameter classes (groups of parameters, i.e. +“criteria” or all”):
+aqs_classes()
+
Return a table of primary quality assurance organizations (pqaos).
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of primary quality assurance organizations (pqaos):
+aqs_pqaos()
+
Return a table Returns that contains change history to the AQS Data Mart +API.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of the EPA AQS Data Mart API revision history:
+aqs_revisionHistory()
+
Return a table of sample durations and their associated duration codes. +Returned values are not calculated durations such as 8 hour carbon monoxide +or ozone rolling averages, 3/6 day PM averages or Pb 3 month rolling +averages.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of:
+aqs_sampledurations()
+
Return data containing a table of all air monitoring sites with the input +state and county FIPS code combination.
+state FIPS code (with leading zero) for the state being +requested. Use aqs_states() for the list of available +FIPS codes.
+state FIPS code for the county being requested +(with leading zero(s)). Use aqs_counties_by_state() for +the list of available county codes for each state.
+returns a AQSAPI_v2 object.
+stateFIPS (str)
countycode (str)
return_header (bool | None)
DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of all the counties +in North Carolina the county FIPS codes (county codes) for each.:
+aqs_counties_by_state(stateFIPS = "37")
+
Return a table of US states, US territories, and the district or Columbia +with their respective FIPS codes.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Examples
+Return a DataFrame of states and their FIPS codes:
+aqs_states()}
+
metadatafunctions.
+Return the status of the AQS API.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Return a table of any known issues with system functionality or the data. +These are usually issues that have been identified internally and will +require some time to correct in Data Mart or the API. This function +implements a direct API call to Data Mart and returns data directly from +the API. Issues returned via this function do not include any issues from +the pyaqsapi python package.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+Return the change history to the AQS Data Mart API.
+returns a AQSAPI_v2 object.
+return_header (bool | None)
+DataFrame | AQSAPI_V2
+setupfunctions.
+Use this service to register as a new user or to reset an existing user’s +key. A verification email will be sent to the email account specified. To +reset a password: If the request is made with an email that is already +registered, a new key will be issued for that account and emailed to the +listed address. Usage is the same in either case. Refer to the email +message for further instructions before continuing.
+will be used to register with the AQS API or change an existing +user’s key. A verification email will be sent to the account +specified. Follow the instructions in the verification e-mail +before proceeding to use any other functionality of the AQS API. +Register your credential with the aqs_credentials() before using +the other functions in this library.
+email (str)
+None
+