Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

xippios-usda-gats

Latest version: v0.4.0

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
PyPI package Publisher: xippios
0 Stars
0 Forks
4 Versions
409 Downloads
Python Repo language

Scan summary

xippios-usda-gats was last scanned on 28 Nov 2026 at version 0.4.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions; the latest was published on 28 Nov 2026.
  • Findings: No rules fired in version 0.4.0.
  • Downloads: 409 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.4.0 LATEST 28 Nov 2026 No rules fired
0.3.0 21 Nov 2026 No rules fired
0.2.0 28 Oct 2026 No rules fired
0.1.0 26 Oct 2026 Not shown

No rules fired in 0.4.0

Findings

Findings for v0.4.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.4.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

xippios-usda-gats

Typed Python client, MCP server and FastAPI routes for USDA FAS Global Agricultural Trade System, part of the xippios SDK family. Names and semantics follow the upstream documentation; every response carries its metadata (source, endpoint, retrieved_at, request), and the data tasks the release time of what they answer. It depends on xippios-usda-fas, the shared package of the USDA FAS sources, for the api.data.gov gateway and the kit of its snapshot script.

Scope

Of GATS's API the package wraps all nineteen operations that its documentation lists (docs/upstream/): the Census exports, imports and re-exports of one partner in one month, the same by US customs district, the UN Trade exports, imports and re-exports of one reporter in one year, the four release lists and the six lists of codes, five of which the package ships and refreshes before each release. GATS documents path parameters alone, partnerCode, year and month for the Census operations and reporterCode and year for the UN Trade operations, and the tasks take every one. The documentation lists XML beside JSON among the forms that each operation produces; the package asks for JSON, so XML is the one documented choice that a caller cannot make (https://github.com/xippios/sdk-usda-gats/issues/64). What the package adds is one partner's series over months and filters that select records of an answer, of a release list and of the packaged lists. It ranks no partner, sums no record and picks no month for the caller: a caller reads every record as GATS sends it. What the package observed of GATS that the documentation does not say, each note with its probe, stands in docs/upstream/OBSERVED.md.

Install

uv add xippios-usda-gats            # client only
uv add "xippios-usda-gats[mcp]"     # + MCP server
uv add "xippios-usda-gats[http]"    # + FastAPI router

Set DATA_GOV_API_KEY in the environment. Nothing is read from files.

30-second example

from xippios.usda.gats import get_census_exports, get_census_release_dates
from xippios.usda.gats.models import ProductType

result = get_census_exports("CH", 2026, 8, hs10_code="02")  # US exports to China, August 2026
len(result.data)  # 26: the month's HS10 products of chapter 02, of 777 in all
row = result.data[0]
row.hs10_code, row.value, row.quantity1  # "0201206000", Decimal("30819.0"), Decimal("1018.0")
result.meta.vintage  # "2026-10-06T08:00:00": the month's release time, as upstream states it
result.meta.published_at  # datetime(2026, 10, 6, 8, 0): that time, without a zone
result.meta.published_at_naive  # True: upstream prints its release times without one
result.meta.request  # {"partner_code": "CH", "year": 2026, "month": 8, "hs10_code": "02"}
result.meta.retrieved_at

releases = get_census_release_dates(ProductType.X)  # X exports, M imports
releases.data[0]  # statistical_year_month="202608", release_time_stamp=2026-10-06 08:00 (naive)
this_year = get_census_release_dates(ProductType.X, statistical_year_month="2026")
len(this_year.data)  # 8: 202608 back to 202601; an unreleased or pre-1967 year gives []

partner_code is GATS's own two-character code, not ISO ("CH" China, "MX" Mexico, "JA" Japan, "IC" Iceland), checked against the countries list packaged in reference/ before any call, since GATS answers an unknown code with an empty list, as it answers a listed partner without trade. An unknown code is refused, naming close codes (an ISO or GENC code leads to its partner code first: "CHN" names CH before CN) or pointing to list_countries when none is close. Of the 26 codes GATS marks discontinued (discontinuedOn), the 7 that are no other code's parent hold no trade after their last month: a Census task answers such a month with an empty list and sends no request, its note in meta.notes naming the code's month, the listed codes of the same name and the code's own parent where it has one. "D1" (Denmark) ended in 198712, so 2026-08 answers [] with a note naming 9U and DA, while 1987-06 is fetched. The other 19 are parents, codes other records name as their countryParentCode ("SZ" Switzerland, the parent of SR and LS), and pass for every month, as do the two-digit codes of region R99, "01" (Caribbean,nes) to "18" (ASEAN). month is 1 to 12 and year four digits; hs10_code keeps the products whose code starts with it, a full ten-digit code for one product or a prefix such as a chapter, applied after the one data request. get_census_imports takes the same arguments and adds five consumption and CIF fields per record; get_census_reexports answers the exports' record for US re-exports.

A parent answers for its children under its own code, as the two recorded ones did, so the package accepts every parent for every month (docs/upstream/OBSERVED.md, "A parent code answers for its children"); "01" and "18" answered an empty list, which means no data, as for any listed partner without trade, and the package assumes no member list for the region codes ("The region codes 01 and 18 answer the empty list").

The customs-district forms answer the same partner-month by US customs district, one record per district and HS10 code, and take customs_district_id too, checked against the packaged districts list (an unknown id names the nearest listed ones):

from xippios.usda.gats import get_customs_district_imports

fillets = get_customs_district_imports("IC", 2026, 8, hs10_code="0304", customs_district_id=10)
len(fillets.data)  # 13: fish fillets from Iceland through New York, of 51 in all districts

Each data task makes two requests, a release list and the month, or fewer while the client's cache holds them: the list for an hour, the month for five minutes, so a narrower filter on a month already read sends no request. The imports forms check the imports list; the exports forms and the re-exports forms check the exports list, the latter by assumption, since upstream publishes no re-export release list. A month not released yet raises NotFoundError naming the latest released and saying that the release list was read and no data requested. A month before January 1967, where both lists begin, is a period GATS holds no data for: the exports and imports forms answer it with an empty list and a note that names what the list holds, sending no data request, while the re-exports and customs-district forms, whose list is another flow's, refuse every month it lacks, naming the list read and the assumption. A listed partner without trade in a released month is an empty list. meta.vintage of the exports and imports forms is the month's release time from that list, as upstream states it ("2026-10-06T08:00:00" for August 2026): upstream's identifier of the release that last revised the figures, since Census applies corrections once a year and the list records only each month's latest release. The re-exports and customs-district forms leave meta.vintage and meta.published_at empty, since the list states the release of another flow. The month itself is in meta.request and in every record's date. For up to an hour after a release the cached list may still give a revised month the previous release's time, or refuse a month just released, and the refusal says when the list was fetched: an accepted lag. meta.published_at is the same release time parsed and kept without a zone, since FAS states none for its release times, with meta.published_at_naive set; get_census_release_dates returns them as upstream states them, every month's or, with statistical_year_month, one year's or one month's, a prefix of upstream's field of that name applied after the one request and recorded in meta.request.

Month series

The three series tasks answer one partner over a range of months, at most 60 in Python and over HTTP and 24 over MCP by default (the ceiling is process-wide, see MCP), as one flat list in month order; every record carries its month in date:

from xippios.usda.gats import get_census_import_series

fish = get_census_import_series(  # fish from Iceland
    "IC", start_year=2026, start_month=7, end_year=2026, end_month=8, hs10_code="03"
)
len(fish.data)  # 85: 42 records for July, then 43 for August, each month in upstream order
row = fish.data[0]
row.date, row.hs10_code, row.value  # "202607", "0302140003", Decimal("1252640.0")
fish.meta.vintage  # "2026-10-06T08:00:00": the newest release among the months, August's
fish.meta.request  # the six arguments: partner_code, start_year, ..., hs10_code="03"

get_census_export_series, get_census_import_series and get_census_reexport_series take partner_code by position and start_year, start_month, end_year, end_month and hs10_code, which filters every month, by name. Everything is checked before the first request, the partner code for the start and for the end month; a start after the end, or a range longer than the ceiling in force, is refused, naming the ceiling. The months after the last of a discontinued code that is no other code's parent are passed over without a request and named in a note ("D1" for 1987-06 to 1988-01 fetches the seven months to 198712), while a parent code passes for every month. The flow's release list is read once: a range with a month not released yet raises NotFoundError naming that month and the latest released, rather than returning the months that are, and the exports and imports series pass over the months before January 1967 in a note, while the re-exports series refuses every month the list lacks. meta.vintage of the exports and imports series is the newest release time among the range's months, which across Census's annual revision can be an earlier month's than the end month's (2025-12 to 2026-02 gives December's revised 2026-06-24T08:00:00); get_census_release_dates has each month's own.

Pacing. A series spends one keyed request per month, plus the release list unless the client's cache holds it, and sends them one after another at the client's pace of one request per second, never at once: 60 months take about a minute and 60 of the key's 1,000 requests per hour. A quota spent partway raises RateLimitError, naming the months answered before it, and none of the months is returned.

UN Trade data

The UN half of GATS is frozen. Both UN Trade release lists end with statistical year 2019, and their newest release is dated 2021-01-18: no later year has appeared since (docs/upstream/OBSERVED.md, "The UN Trade release lists end in 2019"). The package wraps this data faithfully, as GATS serves it, so that a product-level comparison with UN Comtrade is possible elsewhere; it maps no code. Reporter, partner and HS6 codes stay GATS's own (list_countries, list_hs6_commodities), not UN Comtrade's and not ISO.

GATS serves trade "as reported by UN COMTrade", one reporter and one statistical year per request, one record per partner and HS6 code:

from xippios.usda.gats import get_un_exports, get_un_release_dates
from xippios.usda.gats.models import ProductType

fish = get_un_exports("IC", 2019, hs6_code="03")  # Iceland's 2019 exports, HS chapter 03
len(fish.data)  # 1024 records, partner by partner, of 3,980 for the whole year
row = fish.data[0]
row.partner_country_code, row.hs6_code, row.value  # "AE", "030211", Decimal("10620.0")
fish.meta.vintage  # "2020-06-03T05:50:46": Iceland 2019's release time in the exports list
fish.meta.request  # {"reporter_code": "IC", "year": 2019, "hs6_code": "03"}: the filters given

coverage = get_un_release_dates(ProductType.X, reporter_code="IC")
[r.statistical_year for r in coverage.data]  # ["2019", "2018", ..., "1989"]: 31 years

get_un_exports, get_un_imports and get_un_reexports take reporter_code and year by position and two filters by name, applied after the one data request: partner_country_code, upstream's field that it reads (exact), and hs6_code (a full code from the packaged HS6 list, or a prefix of 1 to 5 digits). The records keep GATS's codes as the data carries them, older ones included: the UN data uses AS (Australia), DA (Denmark), IT (Italy), NO (Norway) and NZ (New Zealand) for later years, which the countries list marks discontinued in 1987, and never their successors of the same name (A2, N3, ...), as docs/upstream/OBSERVED.md notes. So the UN tasks check both country codes for membership in the packaged list only; the Census tasks' discontinuation rule does not apply. An ISO or GENC code that several listed codes share is refused naming first the codes the flow's UN release list holds as reporters: "AUS" names AS before A2, "FRA" names F1 before FR. The lists follow no rule on the codes themselves (the parent reports for Australia, its child for France, both for Germany), so such a refusal reads the list first, still before the data request, and comes unranked when the list cannot be read; the Census tasks keep the current code first. Before the data request a task checks the reporter-year against the flow's UN release list, which the client keeps for a day, the feed being frozen: the imports task the imports list, the exports task and, by assumption, the re-exports task the exports list, since upstream publishes no re-export list. GATS answers an unknown reporter, a future year and an unreleased year alike with an empty list, so a year after the latest the list holds for any reporter raises NotFoundError naming the reporter's listed years and the latest year, saying that the release list was read and no data requested. A reporter-year the list lacks at or before that year is a period GATS holds no data for: the exports and imports tasks answer it with an empty list and a note naming the same, sending no data request, while the re-exports task, whose list is another flow's, refuses it. A listed reporter-year without trade is an empty list (Iceland's 2019 re-exports). meta.vintage of the exports and imports tasks is the reporter-year's release time as upstream states it, and meta.published_at that time parsed, naive, as for the Census tasks; the re-exports task leaves both empty. The client keeps a reporter-year's answer for a day. One reporter-year can be large, India's 2016 exports more than the 16 MiB the cache stores (docs/upstream/OBSERVED.md, "One UN Trade answer is a reporter's whole year"). get_un_release_dates(product_type, *, reporter_code=None, statistical_year=None) returns either list, one record per reporter and year, newest year first.

Reference lists

Five GATS lists ship with the package under reference/, and their list_* tasks answer from them without a call; meta.retrieved_at is when the package fetched the list, and meta.vintage stays empty, since upstream gives the lists no version:

from xippios.usda.gats import list_countries, list_hs6_commodities
from xippios.usda.gats.enums import UnitOfMeasureId

list_countries(search="CHN").data  # [Country(country_code="CH", ..., iso3_code="CHN", ...)]
list_countries(region_code="R05").data  # CA, GL, MX, SB, US (North America)
list_hs6_commodities(hs6_code="0201").data  # the three HS6 codes of heading 0201
UnitOfMeasureId.KILOGRAMS  # 47, the unit id of the data records

list_regions() (15), list_countries(*, region_code=None, search=None) (322 codes, current and discontinued; search on the code, the name, the ISO and the GENC code, and a region_code the packaged regions list lacks refused naming the closest), list_hs6_commodities(*, search=None, hs6_code=None) (2,909; search on the code, the name and the description, hs6_code a prefix of the code, as list_commodities' hs10_code), list_units_of_measure() (108, ids 0 to 107, which enums.UnitOfMeasureId names) and list_customs_districts() (53, e.g. 10 NEW YORK, N.Y.).

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases xippios-usda-gats

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229