Releases: sachin-sankar/swiftshadow
v2.1.0
What's New?
Thanks to issues #32 and #37, SwiftShadow can now be seamlessly integrated into async environments. If you're planning to use SwiftShadow with frameworks like FastAPI, check out the documentation for guidance.
Full Changelog: v2.0.1...v2.1.0
v2.0.1
What's Changed
- Proxy Validation Improvements by @sachin-sankar in #35
- Fixes #34
Full Changelog: v2.0.0...v2.0.1
v2.0.0
v2 🚀
The swiftshadow
library has undergone significant changes in version 2.0.0
. This release introduces new features, improvements, and bug fixes to enhance the functionality and usability of the library. Below is a summary of the key changes:
New Features ✨
-
Asynchronous Proxy Validation ⚡:
- The library now uses
aiohttp
for asynchronous proxy validation, improving performance when checking large lists of proxies. - The
validate_proxies
function invalidator.py
validates proxies concurrently, reducing the time required to fetch working proxies.
- The library now uses
-
New Proxy Providers 🌐:
- Added support for multiple new proxy providers:
GoodProxy
OpenProxyList
MuRongPIG
KangProxy
Mmpx12
Anonym0usWork1221
ProxySpace
- These providers expand the pool of available proxies and improve reliability.
- Added support for multiple new proxy providers:
-
Improved Proxy Model 📦:
- Introduced the
Proxy
dataclass inmodels.py
to represent proxy objects. - Added utility methods to the
Proxy
class:as_requests_dict()
: Converts the proxy into a dictionary compatible with therequests
library.as_string()
: Returns the proxy in the format<protocol>://<ip>:<port>
.
- Introduced the
-
Enhanced Caching 🗄️:
- Caching is now handled using
pickle
for better performance and reliability. - The
CacheData
dataclass inmodels.py
represents the structure of cached data, including expiry time and proxy list.
- Caching is now handled using
-
Improved Logging 📝:
- Logging is now more robust, with support for writing logs to a file (
swiftshadow.log
) in the cache directory. - Debug logging can be enabled for detailed insights into the library's operations.
- Logging is now more robust, with support for writing logs to a file (
-
Type Annotations 🏷️:
- Added extensive type annotations across the codebase for better code clarity and IDE support.
- Introduced custom types in
types.py
for structured data handling (e.g.,MonosansProxyDict
).
Breaking Changes ⚠️
-
Class Renaming 🔄:
- The
Proxy
class has been renamed toProxyInterface
to better reflect its purpose and avoid confusion with theProxy
dataclass.
- The
-
Cache File Format 📂:
- The cache file format has changed from JSON to
pickle
for better performance and compatibility with Python objects.
- The cache file format has changed from JSON to
-
Provider Function Signature 📜:
- Provider functions are now asynchronous and return a list of
Proxy
objects instead of raw proxy data.
- Provider functions are now asynchronous and return a list of
-
Removed
constants.py
🗑️:- The
CountryCodes
dictionary has been removed. Users should now rely on ISO 3166-2 country codes directly.
- The
Improvements 🔧
-
Better Proxy Filtering 🎯:
- Proxy filtering by country and protocol is now more efficient and supports more providers.
-
Code Refactoring 🛠️:
- The codebase has been refactored for better modularity and maintainability.
- Introduced dataclasses (
Proxy
,CacheData
,Provider
) to represent core data structures.
-
Enhanced Documentation 📚:
- Added detailed docstrings for classes, methods, and functions to improve usability.
-
New Utility Functions 🛠️:
- Added
plaintextToProxies
inhelpers.py
to convert plaintext proxy lists intoProxy
objects.
- Added
Bug Fixes 🐛
-
Fixed Cache Expiry Handling ⏳:
- The
checkExpiry
function incache.py
now correctly handles cache expiry checks.
- The
-
Improved Error Handling 🚑:
- Better error handling for proxy validation and provider fetching.
-
Fixed Proxy Rotation 🔄:
- The
rotate
method inProxyInterface
now correctly validates the cache before rotation.
- The
Dependencies 📦
- The library now requires
aiohttp
for asynchronous HTTP requests andappdirs
for managing cache directories.
Migration Guide 🧭
- Replace instances of the old
Proxy
class withProxyInterface
. - Use the new
Proxy
dataclass for representing proxy objects.
Benchmark ⏱️
The introduction of asynchronous proxy validation in v2.0.0
has significantly improved performance. Below are the benchmark results comparing synchronous and asynchronous validation:
Benchmark 1: Synchronous Proxy Validation (v1.2.1)
Time (mean ± σ): 162.486 s ± 22.466 s [User: 0.512 s, System: 0.083 s]
Range (min … max): 121.340 s … 189.957 s 10 runs
Benchmark 2: Asynchronous Proxy Validation (v2.0.0)
Time (mean ± σ): 10.764 s ± 0.494 s [User: 1.184 s, System: 0.136 s]
Range (min … max): 10.102 s … 11.535 s 10 runs
Key Takeaways:
- 15x Faster: Asynchronous validation reduces the mean execution time from 162.486 seconds to 10.764 seconds
v1.2.1 Hotfix
Fixes #28 bug and improves library's backwards compatibility for older python versions.
Thanks to @emmamarkle for issue #28
Thanks to @JayacharanR for PR #30
What's Changed
- Update providers.py by @JayacharanR in #30
New Contributors
- @JayacharanR made their first contribution in #30
Full Changelog: v1.2.0...v1.2.1
v1.2.0
Providers Update
- Providers are now dynamically selected.
- 2 New providers , Updated 1 and removed 1 provider. Fixes #26
- Improved proxy checking
What's Changed
- Sync PR by @sachin-sankar in #23
- Version 1.2.0 by @sachin-sankar in #27
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Logging Update
This update adds basic logging functionality to swiftshadow.
🆕 Added
- Basic Logger
- Ability to customize logging functionality using
debug
andlogToFile
parameters inProxy
class.
🗑️ Removed
- Removed support for and class
ProxyChains
v1.0.2
v1.0.1
This is a hotfix
release to fix #19
What's Changed
- Patch release 1.0.1 PR by @sachin-sankar in #21
Full Changelog: v1.0.0...v1.0.1
v1.0.0
I'm thrilled to announce the first stable release of SwiftShadow 🎉! It's been an exciting journey, and I'm proud to share the following changes that have been implemented:
🔧Change Log:
- I've moved the
Proxy
class to theswiftshadow.classes
module to enhance import statements and make them more intuitive. - I've introduced a new feature called
QuickProxy
, a function designed for fast and cacheless proxying. - I've enhanced the
Proxy
class by allowing users to specify a cache folder according to their requirements.
⚠️ Note:
It's important to note that this release is not backwards compatible. I've made significant changes that may impact existing code. Please review the modifications carefully and update your code accordingly. Thank you for your support, and I'm excited to see how SwiftShadow evolves with your feedback!