Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Ruby parser for PokéPaste, the format used by Pokémon Showdown and various teambuilders.
Install with RubyGems:
gem install pokepaste
If using in your application, include in your Gemfile
:
gem "pokepaste"
or your .gemspec
:
Gem::Specification.new do |gem|
# ...
gem.add_runtime_dependency "pokepaste"
end
To parse a PokéPaste:
# From a string
team = PokePaste::parse(str)
# From pokepast.es
team = PokePaste::fetch("https://pokepast.es/5c46f9ec443664cb")
team = PokePaste::fetch("5c46f9ec443664cb") # full URL optional
These methods return an instance of PokePaste::Team
, an Enumerable
containing an instance of PokePaste::Pokemon
for each Pokémon on
the team. You can loop over the team as with any Enumerable, and access the
data like so:
team.each do |pkmn|
pkmn.species # required
pkmn.nickname # default nil
pkmn.gender # default nil
pkmn.item # default nil
# EVs and IVs are hashes with the stat as the key
# (:hp, :atk, :def, :spa, :spd, or :spe)
pkmn.evs[:hp] # default 0
pkmn.ivs[:spa] # default 31
pkmn.shiny? # default is false
pkmn.ability # default is nil
pkmn.tera_type # default is nil
pkmn.level # default is 50
pkmn.happiness # default is 255
pkmn.nature # default is :hardy (neutral nature)
# Moves are an array with the names of the moves as strings. If more than
# one move is specified for a slot, they will be put into an array
pkmn.moves # default is []
end
You can edit any of these properties, and process back into PokéPaste format
with #to_s
:
paste = team.to_s
single_pokemon = team[3].to_s
To make a new paste, you can initialize a new PokePaste::Team
and populate
it like so:
team = PokePaste::Team.new
team << PokePaste::Pokemon.new(
species: "Bulbasaur",
nickname: "Bud",
ivs: {atk: 0},
shiny: true,
moves: %w[Tackle Growl]
)
puts team # prints the paste
And I suppose if you wanted to use this library just to fetch the raw text from a paste on pokepast.es, you could:
raw_paste = PokePaste.fetch(url_or_id).to_s
This library is purely a parser for the PokéPaste format, it does not contain any data about the Pokémon, whether or not the moves are valid, their abilities, anything like that. You could enter nonsense into any of the given fields and they will be parsed to and from the PokéPaste format happily. Validating anything beyond the syntax of the PokéPaste is left up to the user.
This library is released under the MIT license. See the
LICENSE.md
file included with this code or
the official page on OSI for more information.
I am not affiliated with Nintendo, Game Freak, The Pokémon Company, or any of their subsidiaries. This is a free fan-made project. Pokémon is © and ™ Nintendo.
FAQs
Unknown package
We found that pokepaste demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.