Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ufervor/smartmixin
A Python library for Clash configuration file manipulation.
https://github.com/ufervor/smartmixin
clash clash-config
Last synced: 4 days ago
JSON representation
A Python library for Clash configuration file manipulation.
- Host: GitHub
- URL: https://github.com/ufervor/smartmixin
- Owner: UFervor
- License: gpl-3.0
- Created: 2024-02-04T21:40:14.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-05T07:35:51.000Z (11 months ago)
- Last Synced: 2024-12-13T13:11:37.918Z (10 days ago)
- Topics: clash, clash-config
- Language: Python
- Homepage: https://ufervor.github.io/SmartMixin/
- Size: 625 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Home
Smart Mixin is a Python library for Clash configuration file manipulation.
## Prerequisites
Python >= 3.10.0
## Installation
To install Smart Mixin, run the following command in your terminal:
```
pip3 install smartmixin
```Alternatively, you can clone the repository and install it manually:
```
git clone https://github.com/UFervor/SmartMixin.git
cd SmartMixin
pip3 install .
```## Usage Examples
Here's a quick example to get you started. This script downloads a configuration from `https://example.com/abc`, removes all proxies whose names match the regex expression `Official Website|Expire`, and then dumps the modified YAML configuration to `config.yaml`.
```python
from SmartMixin import Config, select_all, ClashforWindows# Initialize the configuration
conf = Config("https://example.com/abc", UA=ClashforWindows("0.20.39"))# Select and delete the specified proxies
select_all(conf.Proxies, False, re_name="Official Website|Expire").delete(globally=True)# Dump the modified configuration to a file
with open("config.yaml", "w") as f:
f.write(conf.YAML)
```## Documentation
For more detailed information about Smart-Mixin's features and usage, please refer to [the documentation](https://ufervor.github.io/SmartMixin/).