Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/celerium/pokemontcg-powershellwrapper
PowerShell wrapper for the PokemonTCG API
https://github.com/celerium/pokemontcg-powershellwrapper
celerium pokemon pokemon-api powershell tcg
Last synced: 10 days ago
JSON representation
PowerShell wrapper for the PokemonTCG API
- Host: GitHub
- URL: https://github.com/celerium/pokemontcg-powershellwrapper
- Owner: Celerium
- License: mit
- Created: 2024-11-03T15:22:28.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-03T16:21:19.000Z (2 months ago)
- Last Synced: 2024-11-03T16:25:27.151Z (2 months ago)
- Topics: celerium, pokemon, pokemon-api, powershell, tcg
- Language: PowerShell
- Homepage: https://celerium.github.io/PokemonTCG-PowerShellWrapper/
- Size: 1.05 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
Celerium_PokemonTCG
[![Az_Pipeline][Az_Pipeline-shield]][Az_Pipeline-url]
[![GitHub_Pages][GitHub_Pages-shield]][GitHub_Pages-url][![PoshGallery_Version][PoshGallery_Version-shield]][PoshGallery_Version-url]
[![PoshGallery_Platforms][PoshGallery_Platforms-shield]][PoshGallery_Platforms-url]
[![PoshGallery_Downloads][PoshGallery_Downloads-shield]][PoshGallery_Downloads-url]
[![codeSize][codeSize-shield]][codeSize-url][![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url][![Blog][Website-shield]][Website-url]
[![GitHub_License][GitHub_License-shield]][GitHub_License-url]---
## Buy me a coffee
Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)
---
---
## About The Project
The [PokemonTCG](https://www.PokemonTCG.com/) offers users the ability to extract data from PokemonTCG into third-party reporting tools and aims to abstract away the details of interacting with PokemonTCG's API endpoints in such a way that is consistent with PowerShell nomenclature. This gives system administrators and PowerShell developers a convenient and familiar way of using PokemonTCG's API to create documentation scripts, automation, and integrations.
- :book: Project documentation can be found on [Github Pages](https://celerium.github.io/PokemonTCG-PowerShellWrapper/)
- :book: PokemonTCG's REST API documentation on their management portal [here](https://docs.pokemontcg.io/).PokemonTCG features a REST API that makes use of common HTTP request methods. In order to maintain PowerShell best practices, only approved verbs are used.
- GET -> `Get-`
Additionally, PowerShell's `verb-noun` nomenclature is respected. Each noun is prefixed with `PokemonTCG` in an attempt to prevent naming problems.
For example, one might access the `/cards` endpoint by running the following PowerShell command with the appropriate parameters:
```posh
Get-PokemonTCGCard -id 'base1-1'
```## Install
This module can be installed directly from the [PowerShell Gallery](https://www.powershellgallery.com/packages/PokemonTCG) with the following command:
```posh
Install-Module -Name PokemonTCG
```- :information_source: This module supports PowerShell 5.0+ and *should* work in PowerShell Core.
- :information_source: If you are running an older version of PowerShell, or if PowerShellGet is unavailable, you can manually download the *main* branch and place the *PokemonTCG* folder into the (default) `C:\Program Files\WindowsPowerShell\Modules` folder.Project documentation can be found on [Github Pages](https://celerium.github.io/PokemonTCG-PowerShellWrapper/)
- A full list of functions can be retrieved by running `Get-Command -Module PokemonTCG`.
- Help info and a list of parameters can be found by running `Get-Help `, such as:```posh
Get-Help Get-PokemonTCGCard
Get-Help Get-PokemonTCGCard -Full
```## Initial Setup
After installing this module, you will need to configure both the *base URI* & *API keys* that are used to talk with the PokemonTCG API.
1. Run `Add-PokemonTCGBaseURI`
- By default, PokemonTCG's `https://api.pokemontcg.io/v2` URI is used.
- If you have your own API gateway or proxy, you may put in your own custom URI by specifying the `-BaseURI` parameter:
- `Add-PokemonTCGBaseURI -BaseURI http://myapi.gateway.celerium.org`
2. Run `Add-PokemonTCGApiKey -ApiKey 12345`
- If you aren't using an API key, you are [rate limited](https://docs.pokemontcg.io/getting-started/rate-limits) to 1000 requests a day, and a maximum of 30 per minute
- PokemonTCG API keys are generated via the PokemonTCG [dev portal](https://dev.pokemontcg.io/)
3. [**optional**] Run `Export-PokemonTCGModuleSettings`
- This will create a config file at `%UserProfile%\PokemonTCG` that holds the *base uri* & *API keys* information.
- Next time you run `Import-Module -Name PokemonTCG`, this configuration file will automatically be loaded.
- :warning: Exporting module settings encrypts your API keys in a format that can **only be unencrypted by the user principal** that encrypted the secret. It makes use of .NET DPAPI, which for Windows uses reversible encrypted tied to your user principal. This means that you **cannot copy** your configuration file to another computer or user account and expect it to work.
- :warning: However in Linux\Unix operating systems the secret keys are more obfuscated than encrypted so it is recommend to use a more secure & cross-platform storage method.## Usage
Calling an API resource is as simple as running `Get-PokemonTCG`
- The following is a table of supported functions and their corresponding API resources:
- Table entries with [ `-` ] indicate that the functionality is **NOT** supported by the PokemonTCG API at this time.| API Resource | Create | Read | Update | Delete |
| ------------- | -------| -------------------------- | -------- | ------ |
| Cards | - | `Get-PokemonTCGCard` | - | - |
| Sets | - | `Get-PokemonTCGSet` | - | - |
| Types | - | `Get-PokemonTCGType` | - | - |
| Subtypes | - | `Get-PokemonTCGSubtype` | - | - |
| Supertypes | - | `Get-PokemonTCGSupertype` | - | - |
| Rarites | - | `Get-PokemonTCGRarity` | - | - |Each `Get-PokemonTCG*` function will respond with the raw data that PokemonTCG's API provides.
- :warning: Returned data is mostly structured the same but can vary between commands.
## Roadmap
- [ ] Add Changelog
- [x] Build more robust Pester & ScriptAnalyzer tests
- [x] Figure out how to do CI & PowerShell gallery automation
- [ ] Add example scripts & automationSee the [open issues](https://github.com/Celerium/PokemonTCG-PowerShellWrapper/issues) for a full list of proposed features (and known issues).
---
## Contributing
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!See the [CONTRIBUTING](https://github.com/Celerium/PokemonTCG-PowerShellWrapper/blob/main/.github/CONTRIBUTING.md) guide for more information about contributing.
## License
Distributed under the MIT License. See [`LICENSE`](https://github.com/Celerium/PokemonTCG-PowerShellWrapper/blob/main/LICENSE) for more information.
[![GitHub_License][GitHub_License-shield]][GitHub_License-url]
## Contact
## Acknowledgments
Big thank you to the following people and services as they have provided me with lots of helpful information as I continue this project!
- [GitHub Pages](https://pages.github.com)
- [Img Shields](https://shields.io)
- [Font Awesome](https://fontawesome.com)
- [Choose an Open Source License](https://choosealicense.com)
- [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)[Az_Pipeline-shield]: https://img.shields.io/azure-devops/build/AzCelerium/PokemonTCG/11?style=for-the-badge&label=DevOps_Build
[Az_Pipeline-url]: https://dev.azure.com/AzCelerium/PokemonTCG/_build?definitionId=11[GitHub_Pages-shield]: https://img.shields.io/github/actions/workflow/status/celerium/PokemonTCG-PowerShellWrapper/pages%2Fpages-build-deployment?style=for-the-badge&label=GitHub%20Pages
[GitHub_Pages-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/actions/workflows/pages/pages-build-deployment[GitHub_License-shield]: https://img.shields.io/github/license/celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[GitHub_License-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/blob/main/LICENSE[PoshGallery_Version-shield]: https://img.shields.io/powershellgallery/v/PokemonTCG?include_prereleases&style=for-the-badge
[PoshGallery_Version-url]: https://www.powershellgallery.com/packages/PokemonTCG[PoshGallery_Platforms-shield]: https://img.shields.io/powershellgallery/p/PokemonTCG?style=for-the-badge
[PoshGallery_Platforms-url]: https://www.powershellgallery.com/packages/PokemonTCG[PoshGallery_Downloads-shield]: https://img.shields.io/powershellgallery/dt/PokemonTCG?style=for-the-badge
[PoshGallery_Downloads-url]: https://www.powershellgallery.com/packages/PokemonTCG[website-shield]: https://img.shields.io/website?up_color=blue&url=https%3A%2F%2Fcelerium.org&style=for-the-badge&label=Blog
[website-url]: https://celerium.org[codeSize-shield]: https://img.shields.io/github/repo-size/celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[codeSize-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper[contributors-shield]: https://img.shields.io/github/contributors/celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[contributors-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/graphs/contributors[forks-shield]: https://img.shields.io/github/forks/celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[forks-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/network/members[stars-shield]: https://img.shields.io/github/stars/celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[stars-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/stargazers[issues-shield]: https://img.shields.io/github/issues/Celerium/PokemonTCG-PowerShellWrapper?style=for-the-badge
[issues-url]: https://github.com/Celerium/PokemonTCG-PowerShellWrapper/issues