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.
cython-extensions-sc2
Advanced tools
API Documentation - for a full list of included functions.
cython-extensions-sc2
is a library designed for the python-sc2 API.
Its purpose is to offer optimized Cython alternatives for commonly used functions,
along with additional useful custom functions.
Note: This library is included for ares-sc2
users by default, no further setup is required.
This library also supports python-sc2
and sharpy-sc2
bots, see Getting Started below.
Example speedups, results may vary depending on machine and exact scenario. This is by no means a list of all functionality offered.
function | speedup |
---|---|
units.closest_to | 6.85 - 13x speedup depending on scenario |
distance_to | 3 to 7x speedup depending on scenario |
position.center | 2x speedup |
already_pending for units | 6.62x speedup |
units.in_attack_range | 2.05x speedup |
units.sorted_by_distance_to | 8.62x speedup |
unit.is_facing | 9.1x speedup |
Point2.towards | 14.29x speedup |
Tip: use cy_distance_to_squared
where possible for extra 1.3x speedup.
To quickly get up and running locally (for python versions 3.10, 3.11, 3.12), install cython-extensions-sc2
with:
pip install cython-extensions-sc2
When shipping to ladder, grab ubuntu-latest_python3.11.zip
from releases in this repo
and extract cython_extensions
directory within the zip to the root of your bot's directory, like so:
MyBot
└───cython_extensions
│ └───cython-extensions library files
└───your bot files and directories
If you already have a python-sc2
, or sharpy-sc2
development environment setup,
then cython-extensions
should work out the box with your bot without the need to install extra requirements. Simply check out the releases on this
repo and download the correct zip
for your system.
For example a Windows user should download windows-latest_python3.11.zip
.
Inside this zip you will find a cython_extensions
directory, this should be placed in your bot's root directory
like so:
MyBot
└───cython_extensions
│ └───cython-extensions library files
└───your bot files and directories
cython-extensions-sc2
For ease of use all cython functions are importable via the main module, for example:
from cython_extensions import cy_distance_to, cy_attack_ready, cy_closest_to
note: in this project all library functions have a cy_
prefix to prevent confusion with python alternatives.
poetry install
This will set up a new environment, install all required dependencies and compile the cython code for your system.
If you modify the cython code, run poetry build
to compile it.
Contributors are very welcome! There are many missing alternative python-sc2
functions, and if you're
into optimization, the existing functions could likely be improved.
Please use conventional commits if you choose to contribute, it helps the automatic releases detect a new version and generates an accurate changelog.
Example git messages:
feat: add new cython function
fix: fixed buggy function
test: add new test
ci: update github workflow
docs: add new docs
chore: add dependency
FAQs
Unknown package
We found that cython-extensions-sc2 demonstrated a healthy version release cadence and project activity because the last version was released less than 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.