SpaceTrackQuery¶
SpaceTrackQuery ¶
SpaceTrackQuery(request_class: RequestClass)
Fluent query builder for SpaceTrack API queries.
Constructs URL path strings for the Space-Track.org REST API. All builder methods return self for method chaining.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_class | RequestClass | The type of data to query. | required |
Example
Initialize instance.
build method descriptor ¶
build() -> str
Build the URL path string for this query.
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The URL path string. |
controller method descriptor ¶
controller(controller: RequestController) -> SpaceTrackQuery
Override the default controller for this query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
controller | RequestController | The controller to use. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
distinct method descriptor ¶
distinct(enabled: bool) -> SpaceTrackQuery
Enable or disable distinct results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled | bool | Whether to return distinct results. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
empty_result method descriptor ¶
empty_result(enabled: bool) -> SpaceTrackQuery
Enable or disable empty result return.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled | bool | Whether to allow empty results. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
favorites method descriptor ¶
favorites(favorites: str) -> SpaceTrackQuery
Set a favorites filter for the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
favorites | str | The favorites identifier. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
filter method descriptor ¶
filter(field: str, value: str) -> SpaceTrackQuery
Add a filter predicate to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field | str | The field name (e.g., "NORAD_CAT_ID", "EPOCH"). | required |
value | str | The filter value, optionally with operator prefix. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
format method descriptor ¶
format(fmt: OutputFormat) -> SpaceTrackQuery
Set the output format for query results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fmt | OutputFormat | The desired output format. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
limit method descriptor ¶
limit(count: int) -> SpaceTrackQuery
Set the maximum number of results to return.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count | int | Maximum number of records. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
limit_offset method descriptor ¶
limit_offset(count: int, offset: int) -> SpaceTrackQuery
Set the maximum number of results and an offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count | int | Maximum number of records. | required |
offset | int | Number of records to skip. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
metadata method descriptor ¶
metadata(enabled: bool) -> SpaceTrackQuery
Enable or disable metadata in the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enabled | bool | Whether to include metadata. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
order_by method descriptor ¶
order_by(field: str, order: SortOrder) -> SpaceTrackQuery
Add an ordering clause to the query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field | str | The field to sort by. | required |
order | SortOrder | The sort direction. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
predicates_filter method descriptor ¶
predicates_filter(fields: list[str]) -> SpaceTrackQuery
Specify which fields to include in the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fields | list[str] | List of field names to include. | required |
Returns:
| Name | Type | Description |
|---|---|---|
SpaceTrackQuery | SpaceTrackQuery | Self for method chaining. |
See Also¶
- Query Builder Guide -- Building queries with examples
- Operators -- Filter operator functions for query values
- Enumerations -- RequestClass, SortOrder, OutputFormat