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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
# tap-pubg
# `tap-pubg`

`tap-pubg` is a Singer tap for pubg.
pubg tap class.

Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.
Built with the [Meltano SDK](https://sdk.meltano.com) for Singer Taps and Targets.

## Installation
## Capabilities

* `catalog`
* `state`
* `discover`
* `about`
* `stream-maps`
* `schema-flattening`

## Settings

| Setting | Required | Default | Description |
|:--------------------|:--------:|:-------:|:------------|
| api_key | True | None | The token to authenticate against the API service |
| player_names | True | None | Player Names sepearted by commas that you'd like to pull, maximum of 10 |
| platform | True | None | platform, ie steam |
| stream_maps | False | None | Config object for stream maps capability. |
| stream_map_config | False | None | User-defined config values to be used within map expressions. |
| flattening_enabled | False | None | 'True' to enable schema flattening and automatically expand nested properties. |
| flattening_max_depth| False | None | The max depth to flatten schemas. |

A full list of supported settings and capabilities is available by running: `tap-pubg --about`

- [ ] `Developer TODO:` Update the below as needed to correctly describe the install procedure. For instance, if you do not have a PyPi repo, or if you want users to directly install from your git repo, you can modify this step as appropriate.

```bash
pipx install tap-pubg
```

## Configuration

Expand Down
5 changes: 1 addition & 4 deletions tap_pubg/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class PubgStream(RESTStream):
"""pubg stream class."""

_LOG_REQUEST_METRIC_URLS=True
@property
def url_base(self) -> str:
"""Return the API URL root, configurable via tap settings."""
Expand Down Expand Up @@ -71,9 +71,6 @@ def get_url_params(
params: dict = {}
if next_page_token:
params["page"] = next_page_token
if self.replication_key:
params["sort"] = "asc"
params["order_by"] = self.replication_key
return params

def parse_response(self, response: requests.Response) -> Iterable[dict]:
Expand Down
273 changes: 270 additions & 3 deletions tap_pubg/schemas/match.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,278 @@
{
"type": "object",
"properties": {
"type": {
"createdAt": {
"type": "string",
"format": "date-time"
},
"URL": {
"type": "string"
},
"id": {
"type": "string"
"data": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"shardId": {
"type": "string"
},
"tags": {
"type": "null"
},
"mapName": {
"type": "string"
},
"isCustomMatch": {
"type": "boolean"
},
"seasonState": {
"type": "string"
},
"gameMode": {
"type": "string"
},
"duration": {
"type": "integer"
},
"stats": {
"type": "null"
},
"titleId": {
"type": "string"
},
"matchType": {
"type": "string"
},
"createdAt": {
"type": "string"
}
}
},
"relationships": {
"type": "object",
"properties": {
"rosters": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
}
}
},
"assets": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
}
}
}
}
},
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
},
"schema": {
"type": "string"
}
}
}
}
},
"included": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"stats": {
"type": "object",
"properties": {
"DBNOs": {
"type": "integer"
},
"assists": {
"type": "integer"
},
"boosts": {
"type": "integer"
},
"damageDealt": {
"type": "number"
},
"deathType": {
"type": "string"
},
"headshotKills": {
"type": "integer"
},
"heals": {
"type": "integer"
},
"killPlace": {
"type": "integer"
},
"killStreaks": {
"type": "integer"
},
"kills": {
"type": "integer"
},
"longestKill": {
"type": "number"
},
"name": {
"type": "string"
},
"playerId": {
"type": "string"
},
"revives": {
"type": "integer"
},
"rideDistance": {
"type": "number"
},
"roadKills": {
"type": "integer"
},
"swimDistance": {
"type": "number"
},
"teamKills": {
"type": "integer"
},
"timeSurvived": {
"type": "number"
},
"vehicleDestroys": {
"type": "integer"
},
"walkDistance": {
"type": "number"
},
"weaponsAcquired": {
"type": "integer"
},
"winPlace": {
"type": "integer"
},
"rank": {
"type": "integer"
},
"teamId": {
"type": "integer"
}
}
},
"actor": {
"type": "string"
},
"shardId": {
"type": "string"
},
"won": {
"type": "string"
},
"description": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"URL": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"relationships": {
"type": "object",
"properties": {
"participants": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
}
}
},
"team": {
"type": "object",
"properties": {
"data": {
"type": "null"
}
}
}
}
}
}
}
},
"links": {
"type": "object",
"properties": {
"self": {
"type": "string"
}
}
},
"meta": {
"type": "object"
}
}
}
Loading